ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
MedicalBeam.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MedicalBeam.hh
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
// ********************************************************************
25
//
26
//
29
30
#ifndef MEDICAL_BEAM_H
31
#define MEDICAL_BEAM_H
32
33
#include "
globals.hh
"
34
#include "
G4ThreeVector.hh
"
35
#include "
G4VUserPrimaryGeneratorAction.hh
"
36
37
class
G4ParticleDefinition
;
38
39
class
MedicalBeam
:
public
G4VUserPrimaryGeneratorAction
{
40
public
:
41
enum
FieldShape
{
kSQUARE
=0,
kCIRCLE
};
42
43
MedicalBeam
();
44
~MedicalBeam
();
45
46
// set/get functions...
47
void
SetParticleDefinition
(
G4ParticleDefinition
* pd);
48
const
G4ParticleDefinition
*
GetParticleDefinition
()
const
;
49
50
void
SetKineticE
(
G4double
e
);
51
G4double
GetKineticE
()
const
;
52
53
void
SetSourcePosition
(
const
G4ThreeVector
&
pos
);
54
G4ThreeVector
GetSourcePosition
()
const
;
55
56
void
SetFieldShape
(
FieldShape
shape);
57
FieldShape
GetFieldShape
()
const
;
58
59
void
SetSSD
(
G4double
ssd);
60
G4double
GetSSD
()
const
;
61
62
void
SetFieldXY
(
G4double
fx,
G4double
fy);
63
G4double
GetFieldX
()
const
;
64
G4double
GetFieldY
()
const
;
65
66
void
SetFieldR
(
G4double
r
);
67
G4double
GetFieldR
()
const
;
68
69
// methods...
70
virtual
void
GeneratePrimaries
(
G4Event
* anEvent);
71
72
private
:
73
// local methods...
74
G4ThreeVector
GenerateBeamDirection
()
const
;
75
76
G4ParticleDefinition
*
fparticle
;
77
G4double
fkineticE
;
78
G4ThreeVector
fsourcePosition
;
79
80
G4double
fSSD
;
// (SSD= Source Skin Depth)
81
FieldShape
ffieldShape
;
82
G4double
ffieldXY
[2];
83
G4double
ffieldR
;
84
85
};
86
87
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88
inline
void
MedicalBeam::SetParticleDefinition
(
G4ParticleDefinition
* pd)
89
{
90
fparticle
= pd;
91
}
92
93
inline
const
G4ParticleDefinition
*
MedicalBeam::GetParticleDefinition
()
const
94
{
95
return
fparticle
;
96
}
97
98
inline
void
MedicalBeam::SetKineticE
(
G4double
e
)
99
{
100
fkineticE
=
e
;
101
}
102
103
inline
G4double
MedicalBeam::GetKineticE
()
const
104
{
105
return
fkineticE
;
106
}
107
108
inline
void
MedicalBeam::SetSourcePosition
(
const
G4ThreeVector
&
pos
)
109
{
110
fsourcePosition
=
pos
;
111
}
112
113
inline
G4ThreeVector
MedicalBeam::GetSourcePosition
()
const
114
{
115
return
fsourcePosition
;
116
}
117
118
inline
void
MedicalBeam::SetFieldShape
(
MedicalBeam::FieldShape
shape)
119
{
120
ffieldShape
= shape;
121
}
122
123
inline
MedicalBeam::FieldShape
MedicalBeam::GetFieldShape
()
const
124
{
125
return
ffieldShape
;
126
}
127
128
inline
void
MedicalBeam::SetSSD
(
G4double
ssd)
129
{
130
fSSD
= ssd;
131
}
132
133
inline
G4double
MedicalBeam::GetSSD
()
const
134
{
135
return
fSSD
;
136
}
137
138
inline
void
MedicalBeam::SetFieldXY
(
G4double
fx,
G4double
fy)
139
{
140
ffieldXY
[0] = fx;
141
ffieldXY
[1] = fy;
142
}
143
144
inline
G4double
MedicalBeam::GetFieldX
()
const
145
{
146
return
ffieldXY
[0];
147
}
148
149
inline
G4double
MedicalBeam::GetFieldY
()
const
150
{
151
return
ffieldXY
[1];
152
}
153
154
inline
void
MedicalBeam::SetFieldR
(
G4double
r
)
155
{
156
ffieldR
=
r
;
157
}
158
159
inline
G4double
MedicalBeam::GetFieldR
()
const
160
{
161
return
ffieldR
;
162
}
163
164
#endif
geant4
tree
geant4-10.6-release
examples
extended
parallel
MPI
examples
exMPI04
include
MedicalBeam.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:53
using
1.8.2 with
ECCE GitHub integration