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 "
PhysListEmStandardNR.hh
"
38
#include "
G4EmStandardPhysics.hh
"
39
#include "
G4EmStandardPhysics_option1.hh
"
40
#include "
G4EmStandardPhysics_option2.hh
"
41
#include "
G4EmStandardPhysics_option3.hh
"
42
#include "
G4EmStandardPhysics_option4.hh
"
43
#include "
G4EmStandardPhysicsWVI.hh
"
44
#include "
G4EmStandardPhysicsGS.hh
"
45
#include "
G4EmStandardPhysicsSS.hh
"
46
47
#include "
G4EmLivermorePhysics.hh
"
48
#include "
G4EmPenelopePhysics.hh
"
49
#include "
G4EmLowEPPhysics.hh
"
50
51
#include "
G4DecayPhysics.hh
"
52
53
#include "
G4HadronElasticPhysics.hh
"
54
#include "
G4HadronDElasticPhysics.hh
"
55
#include "
G4HadronHElasticPhysics.hh
"
56
#include "
G4HadronInelasticQBBC.hh
"
57
#include "
G4IonPhysics.hh
"
58
59
#include "
G4LossTableManager.hh
"
60
#include "
G4EmConfigurator.hh
"
61
#include "
G4UnitsTable.hh
"
62
63
#include "
G4ProcessManager.hh
"
64
#include "
G4Decay.hh
"
65
66
#include "StepMax.hh"
67
68
#include "
G4IonFluctuations.hh
"
69
#include "
G4IonParametrisedLossModel.hh
"
70
#include "
G4UniversalFluctuation.hh
"
71
72
#include "
G4BraggIonGasModel.hh
"
73
#include "
G4BetheBlochIonGasModel.hh
"
74
75
#include "
G4PhysicalConstants.hh
"
76
#include "
G4SystemOfUnits.hh
"
77
78
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79
80
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
(),
81
fStepMaxProcess(nullptr)
82
{
83
fHelIsRegisted
=
false
;
84
fBicIsRegisted
=
false
;
85
fBiciIsRegisted
=
false
;
86
87
// protected member of the base class
88
verboseLevel
= 1;
89
90
fMessenger
=
new
PhysicsListMessenger
(
this
);
91
92
// EM physics
93
fEmName
=
G4String
(
"emstandard_opt0"
);
94
fEmPhysicsList
=
new
G4EmStandardPhysics
(
verboseLevel
);
95
96
// Deacy physics and all particles
97
fDecPhysicsList
=
new
G4DecayPhysics
(
verboseLevel
);
98
}
99
100
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101
102
PhysicsList::~PhysicsList
()
103
{
104
delete
fMessenger
;
105
delete
fEmPhysicsList
;
106
delete
fDecPhysicsList
;
107
for
(
size_t
i=0; i<
fHadronPhys
.size(); i++) {
delete
fHadronPhys
[i];}
108
}
109
110
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111
112
void
PhysicsList::ConstructParticle
()
113
{
114
fDecPhysicsList
->
ConstructParticle
();
115
}
116
117
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118
119
void
PhysicsList::ConstructProcess
()
120
{
121
// transportation
122
//
123
AddTransportation
();
124
125
// electromagnetic physics list
126
//
127
fEmPhysicsList
->
ConstructProcess
();
128
129
// decay physics list
130
//
131
fDecPhysicsList
->
ConstructProcess
();
132
133
// hadronic physics lists
134
for
(
size_t
i=0; i<
fHadronPhys
.size(); i++) {
135
fHadronPhys
[i]->ConstructProcess();
136
}
137
138
// step limitation (as a full process)
139
//
140
AddStepMax
();
141
}
142
143
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
144
145
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
146
{
147
if
(
verboseLevel
>1) {
148
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
149
}
150
151
if
(name ==
fEmName
)
return
;
152
153
if
(name ==
"local"
) {
154
155
fEmName
=
name
;
156
delete
fEmPhysicsList
;
157
fEmPhysicsList
=
new
PhysListEmStandard
(name);
158
159
}
else
if
(name ==
"emstandard_opt0"
) {
160
161
fEmName
=
name
;
162
delete
fEmPhysicsList
;
163
fEmPhysicsList
=
new
G4EmStandardPhysics
(
verboseLevel
);
164
165
}
else
if
(name ==
"emstandard_opt1"
) {
166
167
fEmName
=
name
;
168
delete
fEmPhysicsList
;
169
fEmPhysicsList
=
new
G4EmStandardPhysics_option1
(
verboseLevel
);
170
171
}
else
if
(name ==
"emstandard_opt2"
) {
172
173
fEmName
=
name
;
174
delete
fEmPhysicsList
;
175
fEmPhysicsList
=
new
G4EmStandardPhysics_option2
(
verboseLevel
);
176
177
}
else
if
(name ==
"emstandard_opt3"
) {
178
179
fEmName
=
name
;
180
delete
fEmPhysicsList
;
181
fEmPhysicsList
=
new
G4EmStandardPhysics_option3
(
verboseLevel
);
182
183
}
else
if
(name ==
"emstandard_opt4"
) {
184
185
fEmName
=
name
;
186
delete
fEmPhysicsList
;
187
fEmPhysicsList
=
new
G4EmStandardPhysics_option4
(
verboseLevel
);
188
189
}
else
if
(name ==
"ionGasModels"
) {
190
191
AddPhysicsList
(
"emstandard_opt0"
);
192
fEmName
=
name
;
193
AddIonGasModels
();
194
195
}
else
if
(name ==
"standardNR"
) {
196
197
fEmName
=
name
;
198
delete
fEmPhysicsList
;
199
fEmPhysicsList
=
new
PhysListEmStandardNR
(name);
200
201
}
else
if
(name ==
"emlivermore"
) {
202
fEmName
=
name
;
203
delete
fEmPhysicsList
;
204
fEmPhysicsList
=
new
G4EmLivermorePhysics
(
verboseLevel
);
205
206
}
else
if
(name ==
"empenelope"
) {
207
fEmName
=
name
;
208
delete
fEmPhysicsList
;
209
fEmPhysicsList
=
new
G4EmPenelopePhysics
(
verboseLevel
);
210
211
}
else
if
(name ==
"emlowenergy"
) {
212
fEmName
=
name
;
213
delete
fEmPhysicsList
;
214
fEmPhysicsList
=
new
G4EmLowEPPhysics
(
verboseLevel
);
215
216
}
else
if
(name ==
"emstandardSS"
) {
217
218
fEmName
=
name
;
219
delete
fEmPhysicsList
;
220
fEmPhysicsList
=
new
G4EmStandardPhysicsSS
(
verboseLevel
);
221
222
}
else
if
(name ==
"emstandardWVI"
) {
223
224
fEmName
=
name
;
225
delete
fEmPhysicsList
;
226
fEmPhysicsList
=
new
G4EmStandardPhysicsWVI
(
verboseLevel
);
227
228
}
else
if
(name ==
"emstandardGS"
) {
229
230
fEmName
=
name
;
231
delete
fEmPhysicsList
;
232
fEmPhysicsList
=
new
G4EmStandardPhysicsGS
(
verboseLevel
);
233
234
}
else
if
(name ==
"elastic"
&& !
fHelIsRegisted
) {
235
fHadronPhys
.push_back(
new
G4HadronElasticPhysics
(
verboseLevel
));
236
fHelIsRegisted
=
true
;
237
238
}
else
if
(name ==
"DElastic"
&& !
fHelIsRegisted
) {
239
fHadronPhys
.push_back(
new
G4HadronDElasticPhysics
(
verboseLevel
));
240
fHelIsRegisted
=
true
;
241
242
}
else
if
(name ==
"HElastic"
&& !
fHelIsRegisted
) {
243
fHadronPhys
.push_back(
new
G4HadronHElasticPhysics
(
verboseLevel
));
244
fHelIsRegisted
=
true
;
245
246
}
else
if
(name ==
"binary"
&& !
fBicIsRegisted
) {
247
fHadronPhys
.push_back(
new
G4HadronInelasticQBBC
(
verboseLevel
));
248
fBicIsRegisted
=
true
;
249
250
}
else
if
(name ==
"binary_ion"
&& !
fBiciIsRegisted
) {
251
fHadronPhys
.push_back(
new
G4IonPhysics
(
verboseLevel
));
252
fBiciIsRegisted
=
true
;
253
254
}
else
{
255
256
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
257
<<
" is not defined"
258
<<
G4endl
;
259
}
260
}
261
262
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
263
264
void
PhysicsList::AddStepMax
()
265
{
266
// Step limitation seen as a process
267
fStepMaxProcess
=
new
StepMax
();
268
269
auto
particleIterator
=
GetParticleIterator
();
270
particleIterator
->reset();
271
while
((*
particleIterator
)()){
272
G4ParticleDefinition
*
particle
=
particleIterator
->value();
273
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
274
275
if
(
fStepMaxProcess
->
IsApplicable
(*particle) && pmanager)
276
{
277
pmanager ->
AddDiscreteProcess
(
fStepMaxProcess
);
278
}
279
}
280
}
281
282
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
283
284
void
PhysicsList::AddIonGasModels
()
285
{
286
G4EmConfigurator
*
em_config
=
287
G4LossTableManager::Instance
()->
EmConfigurator
();
288
auto
particleIterator
=
GetParticleIterator
();
289
particleIterator
->reset();
290
while
((*
particleIterator
)())
291
{
292
G4ParticleDefinition
* particle =
particleIterator
->value();
293
G4String
partname = particle->
GetParticleName
();
294
if
(partname ==
"alpha"
|| partname ==
"He3"
|| partname ==
"GenericIon"
) {
295
G4BraggIonGasModel
* mod1 =
new
G4BraggIonGasModel
();
296
G4BetheBlochIonGasModel
* mod2 =
new
G4BetheBlochIonGasModel
();
297
G4double
eth = 2.*
MeV
*particle->
GetPDGMass
()/
proton_mass_c2
;
298
em_config->
SetExtraEmModel
(partname,
"ionIoni"
,mod1,
""
,0.0,eth,
299
new
G4IonFluctuations
());
300
em_config->
SetExtraEmModel
(partname,
"ionIoni"
,mod2,
""
,eth,100*
TeV
,
301
new
G4UniversalFluctuation
());
302
303
}
304
}
305
}
306
307
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
308
geant4
tree
geant4-10.6-release
examples
extended
electromagnetic
TestEm7
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration