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
//
26
//
29
30
#include "PhysicsList.hh"
31
#include "PhysicsListMessenger.hh"
32
33
#include "
G4EmStandardPhysics.hh
"
34
#include "
G4EmStandardPhysics_option1.hh
"
35
#include "
G4EmStandardPhysics_option2.hh
"
36
#include "
G4EmStandardPhysics_option3.hh
"
37
#include "
G4EmStandardPhysics_option4.hh
"
38
#include "
G4EmStandardPhysicsSS.hh
"
39
#include "
G4EmStandardPhysicsWVI.hh
"
40
#include "
G4EmStandardPhysicsGS.hh
"
41
#include "
G4EmLivermorePhysics.hh
"
42
#include "
G4EmPenelopePhysics.hh
"
43
#include "
G4EmLowEPPhysics.hh
"
44
45
#include "
G4LossTableManager.hh
"
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
#include "
G4GenericIon.hh
"
73
74
#include "
G4SystemOfUnits.hh
"
75
76
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
78
PhysicsList::PhysicsList
()
79
:
G4VModularPhysicsList
(), fMessenger(0), fEmPhysicsList(0)
80
{
81
fMessenger
=
new
PhysicsListMessenger
(
this
);
82
83
// EM physics
84
fEmName
=
G4String
(
"emstandard_opt4"
);
85
fEmPhysicsList
=
new
G4EmStandardPhysics_option4
(1);
86
if
(
verboseLevel
>-1) {
87
G4cout
<<
"PhysicsList::Constructor with default list: <"
88
<<
fEmName
<<
">"
<<
G4endl
;
89
}
90
91
G4LossTableManager::Instance
();
92
SetVerboseLevel
(1);
93
}
94
95
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96
97
PhysicsList::~PhysicsList
()
98
{
99
delete
fEmPhysicsList
;
100
delete
fMessenger
;
101
}
102
103
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104
105
void
PhysicsList::ConstructParticle
()
106
{
107
// pseudo-particles
108
G4Geantino::GeantinoDefinition
();
109
G4ChargedGeantino::ChargedGeantinoDefinition
();
110
111
// gamma
112
G4Gamma::GammaDefinition
();
113
114
// optical photon
115
G4OpticalPhoton::OpticalPhotonDefinition
();
116
117
// leptons
118
G4Electron::ElectronDefinition
();
119
G4Positron::PositronDefinition
();
120
G4MuonPlus::MuonPlusDefinition
();
121
G4MuonMinus::MuonMinusDefinition
();
122
123
G4NeutrinoE::NeutrinoEDefinition
();
124
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
125
G4NeutrinoMu::NeutrinoMuDefinition
();
126
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
127
128
// mesons
129
G4MesonConstructor
mConstructor;
130
mConstructor.
ConstructParticle
();
131
132
// barions
133
G4BaryonConstructor
bConstructor;
134
bConstructor.
ConstructParticle
();
135
136
// ions
137
G4IonConstructor
iConstructor;
138
iConstructor.
ConstructParticle
();
139
140
// Required by MT even if ion physics not used
141
G4GenericIon::GenericIonDefinition
();
142
}
143
144
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145
146
void
PhysicsList::ConstructProcess
()
147
{
148
AddTransportation
();
149
fEmPhysicsList
->
ConstructProcess
();
150
AddDecay
();
151
AddStepMax
();
152
}
153
154
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155
156
#include "
G4Decay.hh
"
157
158
void
PhysicsList::AddDecay
()
159
{
160
// Add Decay Process
161
162
G4Decay
* fDecayProcess =
new
G4Decay
();
163
164
auto
particleIterator
=
GetParticleIterator
();
165
particleIterator
->reset();
166
while
( (*
particleIterator
)() ){
167
G4ParticleDefinition
*
particle
=
particleIterator
->value();
168
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
169
170
if
(fDecayProcess->
IsApplicable
(*particle) &&
171
!particle->
IsShortLived
()) {
172
173
pmanager ->
AddProcess
(fDecayProcess);
174
175
// set ordering for PostStepDoIt and AtRestDoIt
176
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
177
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
178
179
}
180
}
181
}
182
183
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184
185
#include "StepMax.hh"
186
187
void
PhysicsList::AddStepMax
()
188
{
189
// Step limitation seen as a process
190
StepMax
* stepMaxProcess =
new
StepMax
();
191
192
auto
particleIterator
=
GetParticleIterator
();
193
particleIterator
->reset();
194
while
((*
particleIterator
)()){
195
G4ParticleDefinition
* particle =
particleIterator
->value();
196
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
197
198
if
(stepMaxProcess->
IsApplicable
(*particle))
199
{
200
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
201
}
202
}
203
}
204
205
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
206
207
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
208
{
209
if
(
verboseLevel
>-1) {
210
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
211
}
212
213
if
(name ==
fEmName
)
return
;
214
215
if
(name ==
"emstandard_opt0"
) {
216
217
fEmName
=
name
;
218
delete
fEmPhysicsList
;
219
fEmPhysicsList
=
new
G4EmStandardPhysics
(1);
220
221
}
else
if
(name ==
"emstandard_opt1"
) {
222
223
fEmName
=
name
;
224
delete
fEmPhysicsList
;
225
fEmPhysicsList
=
new
G4EmStandardPhysics_option1
(1);
226
227
}
else
if
(name ==
"emstandard_opt2"
) {
228
229
fEmName
=
name
;
230
delete
fEmPhysicsList
;
231
fEmPhysicsList
=
new
G4EmStandardPhysics_option2
(1);
232
233
}
else
if
(name ==
"emstandard_opt3"
) {
234
235
fEmName
=
name
;
236
delete
fEmPhysicsList
;
237
fEmPhysicsList
=
new
G4EmStandardPhysics_option3
(1);
238
239
}
else
if
(name ==
"emstandard_opt4"
) {
240
241
fEmName
=
name
;
242
delete
fEmPhysicsList
;
243
fEmPhysicsList
=
new
G4EmStandardPhysics_option4
(1);
244
245
}
else
if
(name ==
"emlowenergy"
) {
246
fEmName
=
name
;
247
delete
fEmPhysicsList
;
248
fEmPhysicsList
=
new
G4EmLowEPPhysics
(1);
249
250
}
else
if
(name ==
"emstandardSS"
) {
251
fEmName
=
name
;
252
delete
fEmPhysicsList
;
253
fEmPhysicsList
=
new
G4EmStandardPhysicsSS
(1);
254
255
}
else
if
(name ==
"emstandardWVI"
) {
256
fEmName
=
name
;
257
delete
fEmPhysicsList
;
258
fEmPhysicsList
=
new
G4EmStandardPhysicsWVI
(1);
259
260
}
else
if
(name ==
"emstandardGS"
) {
261
fEmName
=
name
;
262
delete
fEmPhysicsList
;
263
fEmPhysicsList
=
new
G4EmStandardPhysicsGS
(1);
264
265
}
else
if
(name ==
"emlivermore"
) {
266
fEmName
=
name
;
267
delete
fEmPhysicsList
;
268
fEmPhysicsList
=
new
G4EmLivermorePhysics
(1);
269
270
}
else
if
(name ==
"empenelope"
) {
271
fEmName
=
name
;
272
delete
fEmPhysicsList
;
273
fEmPhysicsList
=
new
G4EmPenelopePhysics
(1);
274
275
}
else
{
276
277
G4ExceptionDescription
description;
278
description
279
<<
" "
280
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
"> is not defined"
;
281
G4Exception
(
"PhysicsList::AddPhysicsList"
,
282
"electronScattering2_F001"
,
FatalException
, description);
283
}
284
}
285
286
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
medical
electronScattering2
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:51
using
1.8.2 with
ECCE GitHub integration