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
PhysicsList.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PhysicsList.cc
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
//
28
//
29
//
30
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33
#include "PhysicsList.hh"
34
#include "PhysicsListMessenger.hh"
35
36
#include "PhysListEmStandard.hh"
37
#include "
PhysListEmStandardSS.hh
"
38
#include "
PhysListEmStandardGS.hh
"
39
#include "
PhysListEmStandardWVI.hh
"
40
41
#include "
G4EmStandardPhysics.hh
"
42
#include "
G4EmStandardPhysics_option1.hh
"
43
#include "
G4EmStandardPhysics_option2.hh
"
44
#include "
G4EmStandardPhysics_option3.hh
"
45
46
#include "
G4UnitsTable.hh
"
47
48
#include "
G4ParticleDefinition.hh
"
49
#include "
G4ProcessManager.hh
"
50
51
// Bosons
52
#include "
G4ChargedGeantino.hh
"
53
#include "
G4Geantino.hh
"
54
#include "
G4Gamma.hh
"
55
#include "
G4OpticalPhoton.hh
"
56
57
// leptons
58
#include "
G4MuonPlus.hh
"
59
#include "
G4MuonMinus.hh
"
60
#include "
G4NeutrinoMu.hh
"
61
#include "
G4AntiNeutrinoMu.hh
"
62
63
#include "
G4Electron.hh
"
64
#include "
G4Positron.hh
"
65
#include "
G4NeutrinoE.hh
"
66
#include "
G4AntiNeutrinoE.hh
"
67
68
// Hadrons
69
#include "
G4MesonConstructor.hh
"
70
#include "
G4BaryonConstructor.hh
"
71
#include "
G4IonConstructor.hh
"
72
73
#include "
G4SystemOfUnits.hh
"
74
75
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
77
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
(),
78
fMessenger(0), fEmName(
"local"
), fEmPhysicsList(0)
79
{
80
fMessenger
=
new
PhysicsListMessenger
(
this
);
81
82
// EM physics
83
fEmName
=
G4String
(
"local"
);
84
fEmPhysicsList
=
new
PhysListEmStandard
(
fEmName
);
85
86
SetDefaultCutValue
(1.*
mm
);
87
SetVerboseLevel
(1);
88
}
89
90
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91
92
PhysicsList::~PhysicsList
()
93
{
94
delete
fEmPhysicsList
;
95
delete
fMessenger
;
96
}
97
98
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99
100
void
PhysicsList::ConstructParticle
()
101
{
102
// pseudo-particles
103
G4Geantino::GeantinoDefinition
();
104
G4ChargedGeantino::ChargedGeantinoDefinition
();
105
106
// gamma
107
G4Gamma::GammaDefinition
();
108
109
// optical photon
110
G4OpticalPhoton::OpticalPhotonDefinition
();
111
112
// leptons
113
G4Electron::ElectronDefinition
();
114
G4Positron::PositronDefinition
();
115
G4MuonPlus::MuonPlusDefinition
();
116
G4MuonMinus::MuonMinusDefinition
();
117
118
G4NeutrinoE::NeutrinoEDefinition
();
119
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
120
G4NeutrinoMu::NeutrinoMuDefinition
();
121
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
122
123
// mesons
124
G4MesonConstructor
mConstructor;
125
mConstructor.
ConstructParticle
();
126
127
// barions
128
G4BaryonConstructor
bConstructor;
129
bConstructor.
ConstructParticle
();
130
131
// ions
132
G4IonConstructor
iConstructor;
133
iConstructor.
ConstructParticle
();
134
}
135
136
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137
138
void
PhysicsList::ConstructProcess
()
139
{
140
AddTransportation
();
141
fEmPhysicsList
->
ConstructProcess
();
142
AddDecay
();
143
AddStepMax
();
144
}
145
146
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147
148
#include "
G4Decay.hh
"
149
150
void
PhysicsList::AddDecay
()
151
{
152
// Add Decay Process
153
154
G4Decay
* fDecayProcess =
new
G4Decay
();
155
156
auto
particleIterator
=
GetParticleIterator
();
157
particleIterator
->reset();
158
while
( (*
particleIterator
)() ){
159
G4ParticleDefinition
*
particle
=
particleIterator
->value();
160
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
161
162
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
163
164
pmanager ->
AddProcess
(fDecayProcess);
165
166
// set ordering for PostStepDoIt and AtRestDoIt
167
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
168
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
169
170
}
171
}
172
}
173
174
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175
176
#include "StepMax.hh"
177
178
void
PhysicsList::AddStepMax
()
179
{
180
// Step limitation seen as a process
181
StepMax
* stepMaxProcess =
new
StepMax
();
182
183
auto
particleIterator
=
GetParticleIterator
();
184
particleIterator
->reset();
185
while
((*
particleIterator
)()){
186
G4ParticleDefinition
* particle =
particleIterator
->value();
187
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
188
189
if
(stepMaxProcess->
IsApplicable
(*particle))
190
{
191
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
192
}
193
}
194
}
195
196
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
197
198
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
199
{
200
if
(
verboseLevel
>-1) {
201
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
202
}
203
204
if
(name ==
fEmName
)
return
;
205
206
if
(name ==
"local"
) {
207
208
fEmName
=
name
;
209
delete
fEmPhysicsList
;
210
fEmPhysicsList
=
new
PhysListEmStandard
(name);
211
212
}
else
if
(name ==
"emstandard_opt0"
) {
213
214
fEmName
=
name
;
215
delete
fEmPhysicsList
;
216
fEmPhysicsList
=
new
G4EmStandardPhysics
();
217
218
}
else
if
(name ==
"emstandard_opt1"
) {
219
220
fEmName
=
name
;
221
delete
fEmPhysicsList
;
222
fEmPhysicsList
=
new
G4EmStandardPhysics_option1
();
223
224
}
else
if
(name ==
"emstandard_opt2"
) {
225
226
fEmName
=
name
;
227
delete
fEmPhysicsList
;
228
fEmPhysicsList
=
new
G4EmStandardPhysics_option2
();
229
230
}
else
if
(name ==
"emstandard_opt3"
) {
231
232
fEmName
=
name
;
233
delete
fEmPhysicsList
;
234
fEmPhysicsList
=
new
G4EmStandardPhysics_option3
();
235
236
}
else
if
(name ==
"standardSS"
) {
237
238
fEmName
=
name
;
239
delete
fEmPhysicsList
;
240
fEmPhysicsList
=
new
PhysListEmStandardSS
(name);
241
242
}
else
if
(name ==
"standardGS"
) {
243
244
fEmName
=
name
;
245
delete
fEmPhysicsList
;
246
fEmPhysicsList
=
new
PhysListEmStandardGS
(name);
247
248
}
else
if
(name ==
"standardWVI"
) {
249
250
fEmName
=
name
;
251
delete
fEmPhysicsList
;
252
fEmPhysicsList
=
new
PhysListEmStandardWVI
(name);
253
254
}
else
{
255
256
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
257
<<
" is not defined"
258
<<
G4endl
;
259
}
260
}
261
262
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
medical
electronScattering
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:51
using
1.8.2 with
ECCE GitHub integration