Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
extended
parallel
MPI
examples
exMPI02
include
MedicalBeam.hh
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
27
28
#ifndef MEDICAL_BEAM_H
29
#define MEDICAL_BEAM_H
30
31
#include "
globals.hh
"
32
#include "
G4ThreeVector.hh
"
33
#include "
G4VUserPrimaryGeneratorAction.hh
"
34
35
class
G4ParticleDefinition
;
36
37
class
MedicalBeam
:
public
G4VUserPrimaryGeneratorAction
{
38
public
:
39
enum
FieldShape
{
SQUARE
=0,
CIRCLE
};
40
41
MedicalBeam
();
42
~MedicalBeam
();
43
44
// set/get functions...
45
void
SetParticleDefinition
(
G4ParticleDefinition
* pd);
46
const
G4ParticleDefinition
*
GetParticleDefinition
()
const
;
47
48
void
SetKineticE
(
G4double
e
);
49
G4double
GetKineticE
()
const
;
50
51
void
SetSourcePosition
(
const
G4ThreeVector
& pos);
52
G4ThreeVector
GetSourcePosition
()
const
;
53
54
void
SetFieldShape
(
FieldShape
shape);
55
FieldShape
GetFieldShape
()
const
;
56
57
void
SetSSD
(
G4double
ssd);
58
G4double
GetSSD
()
const
;
59
60
void
SetFieldXY
(
G4double
fx,
G4double
fy);
61
G4double
GetFieldX
()
const
;
62
G4double
GetFieldY
()
const
;
63
64
void
SetFieldR
(
G4double
r
);
65
G4double
GetFieldR
()
const
;
66
67
// methods...
68
virtual
void
GeneratePrimaries
(
G4Event
* anEvent);
69
70
protected
:
71
G4ParticleDefinition
*
particle
;
72
G4double
kineticE
;
73
G4ThreeVector
sourcePosition
;
74
75
G4double
SSD
;
// (SSD= Source Skin Depth)
76
FieldShape
fieldShape
;
77
G4double
fieldXY
[2];
78
G4double
fieldR
;
79
80
// local methods...
81
G4ThreeVector
GenerateBeamDirection
()
const
;
82
};
83
84
// ====================================================================
85
inline
void
MedicalBeam::SetParticleDefinition
(
G4ParticleDefinition
* pd)
86
{
particle
= pd; }
87
88
inline
const
G4ParticleDefinition
*
MedicalBeam::GetParticleDefinition
()
const
89
{
return
particle
; }
90
91
inline
void
MedicalBeam::SetKineticE
(
G4double
e
)
92
{
kineticE
=
e
; }
93
94
inline
G4double
MedicalBeam::GetKineticE
()
const
95
{
return
kineticE
; }
96
97
inline
void
MedicalBeam::SetSourcePosition
(
const
G4ThreeVector
& pos)
98
{
sourcePosition
= pos; }
99
100
inline
G4ThreeVector
MedicalBeam::GetSourcePosition
()
const
101
{
return
sourcePosition
; }
102
103
inline
void
MedicalBeam::SetFieldShape
(
MedicalBeam::FieldShape
shape)
104
{
fieldShape
= shape; }
105
106
inline
MedicalBeam::FieldShape
MedicalBeam::GetFieldShape
()
const
107
{
return
fieldShape
; }
108
109
inline
void
MedicalBeam::SetSSD
(
G4double
ssd)
110
{
SSD
= ssd; }
111
112
inline
G4double
MedicalBeam::GetSSD
()
const
113
{
return
SSD
; }
114
115
inline
void
MedicalBeam::SetFieldXY
(
G4double
fx,
G4double
fy)
116
{
fieldXY
[0]= fx;
fieldXY
[1]= fy; }
117
118
inline
G4double
MedicalBeam::GetFieldX
()
const
119
{
return
fieldXY
[0]; }
120
121
inline
G4double
MedicalBeam::GetFieldY
()
const
122
{
return
fieldXY
[1]; }
123
124
inline
void
MedicalBeam::SetFieldR
(
G4double
r
)
125
{
fieldR
=
r
; }
126
127
inline
G4double
MedicalBeam::GetFieldR
()
const
128
{
return
fieldR
; }
129
130
#endif
131
Generated on Sat May 25 2013 14:32:00 for Geant4 by
1.8.4