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 "
PhysListEmStandardSSM.hh
"
38
39
#include "
G4EmStandardPhysics.hh
"
40
#include "
G4EmStandardPhysics_option1.hh
"
41
#include "
G4EmStandardPhysics_option2.hh
"
42
#include "
G4EmStandardPhysics_option3.hh
"
43
#include "
G4EmStandardPhysics_option4.hh
"
44
#include "
G4EmStandardPhysicsWVI.hh
"
45
#include "
G4EmStandardPhysicsGS.hh
"
46
#include "
G4EmStandardPhysicsSS.hh
"
47
#include "
G4EmLivermorePhysics.hh
"
48
#include "
G4EmPenelopePhysics.hh
"
49
#include "
G4EmLowEPPhysics.hh
"
50
#include "
G4EmDNAPhysics.hh
"
51
#include "
G4EmDNAPhysics_option1.hh
"
52
#include "
G4EmDNAPhysics_option2.hh
"
53
#include "
G4EmDNAPhysics_option3.hh
"
54
#include "
G4EmDNAPhysics_option4.hh
"
55
#include "
G4EmDNAPhysics_option5.hh
"
56
#include "
G4EmDNAPhysics_option6.hh
"
57
#include "
G4EmDNAPhysics_option7.hh
"
58
59
#include "
G4LossTableManager.hh
"
60
#include "
G4UnitsTable.hh
"
61
#include "
G4SystemOfUnits.hh
"
62
63
// particles
64
65
#include "
G4BosonConstructor.hh
"
66
#include "
G4LeptonConstructor.hh
"
67
#include "
G4MesonConstructor.hh
"
68
#include "
G4BosonConstructor.hh
"
69
#include "
G4BaryonConstructor.hh
"
70
#include "
G4IonConstructor.hh
"
71
#include "
G4ShortLivedConstructor.hh
"
72
#include "
G4DNAGenericIonsManager.hh
"
73
74
G4ThreadLocal
StepMax
*
PhysicsList::fStepMaxProcess
=
nullptr
;
75
76
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
78
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
()
79
{
80
fMessenger
=
new
PhysicsListMessenger
(
this
);
81
82
SetVerboseLevel
(1);
83
84
// EM physics
85
fEmPhysicsList
=
new
PhysListEmStandard
(
fEmName
=
"local"
);
86
87
// Em options
88
//
89
G4EmParameters::Instance
()->
SetBuildCSDARange
(
true
);
90
91
SetDefaultCutValue
(1.*
mm
);
92
}
93
94
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95
96
PhysicsList::~PhysicsList
()
97
{
98
delete
fMessenger
;
99
delete
fEmPhysicsList
;
100
}
101
102
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103
104
void
PhysicsList::ConstructParticle
()
105
{
106
G4BosonConstructor
pBosonConstructor;
107
pBosonConstructor.
ConstructParticle
();
108
109
G4LeptonConstructor
pLeptonConstructor;
110
pLeptonConstructor.
ConstructParticle
();
111
112
G4MesonConstructor
pMesonConstructor;
113
pMesonConstructor.
ConstructParticle
();
114
115
G4BaryonConstructor
pBaryonConstructor;
116
pBaryonConstructor.
ConstructParticle
();
117
118
G4IonConstructor
pIonConstructor;
119
pIonConstructor.
ConstructParticle
();
120
121
G4ShortLivedConstructor
pShortLivedConstructor;
122
pShortLivedConstructor.
ConstructParticle
();
123
124
// DNA
125
G4DNAGenericIonsManager
* genericIonsManager;
126
genericIonsManager=
G4DNAGenericIonsManager::Instance
();
127
genericIonsManager->
GetIon
(
"alpha++"
);
128
genericIonsManager->
GetIon
(
"alpha+"
);
129
genericIonsManager->
GetIon
(
"helium"
);
130
genericIonsManager->
GetIon
(
"hydrogen"
);
131
}
132
133
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
134
135
#include "
G4ProcessManager.hh
"
136
137
void
PhysicsList::ConstructProcess
()
138
{
139
// transportation
140
//
141
AddTransportation
();
142
143
// electromagnetic physics list
144
//
145
fEmPhysicsList
->
ConstructProcess
();
146
147
// decay process
148
//
149
AddDecay
();
150
151
// step limitation (as a full process)
152
//
153
AddStepMax
();
154
}
155
156
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157
158
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
159
{
160
if
(
verboseLevel
>-1) {
161
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
162
}
163
164
if
(name ==
fEmName
)
return
;
165
166
if
(name ==
"local"
) {
167
168
fEmName
=
name
;
169
delete
fEmPhysicsList
;
170
fEmPhysicsList
=
new
PhysListEmStandard
(name);
171
172
}
else
if
(name ==
"emstandard_opt0"
) {
173
174
fEmName
=
name
;
175
delete
fEmPhysicsList
;
176
fEmPhysicsList
=
new
G4EmStandardPhysics
();
177
178
}
else
if
(name ==
"emstandard_opt1"
) {
179
180
fEmName
=
name
;
181
delete
fEmPhysicsList
;
182
fEmPhysicsList
=
new
G4EmStandardPhysics_option1
();
183
184
}
else
if
(name ==
"emstandard_opt2"
) {
185
186
fEmName
=
name
;
187
delete
fEmPhysicsList
;
188
fEmPhysicsList
=
new
G4EmStandardPhysics_option2
();
189
190
}
else
if
(name ==
"emstandard_opt3"
) {
191
192
fEmName
=
name
;
193
delete
fEmPhysicsList
;
194
fEmPhysicsList
=
new
G4EmStandardPhysics_option3
();
195
196
}
else
if
(name ==
"emstandard_opt4"
) {
197
198
fEmName
=
name
;
199
delete
fEmPhysicsList
;
200
fEmPhysicsList
=
new
G4EmStandardPhysics_option4
();
201
202
}
else
if
(name ==
"emstandardSS"
) {
203
204
fEmName
=
name
;
205
delete
fEmPhysicsList
;
206
fEmPhysicsList
=
new
G4EmStandardPhysicsSS
();
207
208
}
else
if
(name ==
"standardSSM"
) {
209
210
fEmName
=
name
;
211
delete
fEmPhysicsList
;
212
fEmPhysicsList
=
new
PhysListEmStandardSSM
(name);
213
214
}
else
if
(name ==
"emstandardWVI"
) {
215
216
fEmName
=
name
;
217
delete
fEmPhysicsList
;
218
fEmPhysicsList
=
new
G4EmStandardPhysicsWVI
();
219
220
}
else
if
(name ==
"standardGS"
) {
221
222
fEmName
=
name
;
223
delete
fEmPhysicsList
;
224
fEmPhysicsList
=
new
G4EmStandardPhysicsGS
();
225
226
}
else
if
(name ==
"emlivermore"
) {
227
fEmName
=
name
;
228
delete
fEmPhysicsList
;
229
fEmPhysicsList
=
new
G4EmLivermorePhysics
();
230
231
}
else
if
(name ==
"empenelope"
) {
232
fEmName
=
name
;
233
delete
fEmPhysicsList
;
234
fEmPhysicsList
=
new
G4EmPenelopePhysics
();
235
236
}
else
if
(name ==
"emlowenergy"
) {
237
fEmName
=
name
;
238
delete
fEmPhysicsList
;
239
fEmPhysicsList
=
new
G4EmLowEPPhysics
();
240
241
}
else
if
(name ==
"dna"
) {
242
fEmName
=
name
;
243
delete
fEmPhysicsList
;
244
fEmPhysicsList
=
new
G4EmDNAPhysics
();
245
246
}
else
if
(name ==
"dna_opt1"
) {
247
fEmName
=
name
;
248
delete
fEmPhysicsList
;
249
fEmPhysicsList
=
new
G4EmDNAPhysics_option1
();
250
251
}
else
if
(name ==
"dna_opt2"
) {
252
fEmName
=
name
;
253
delete
fEmPhysicsList
;
254
fEmPhysicsList
=
new
G4EmDNAPhysics_option2
();
255
256
}
else
if
(name ==
"dna_opt3"
) {
257
fEmName
=
name
;
258
delete
fEmPhysicsList
;
259
fEmPhysicsList
=
new
G4EmDNAPhysics_option3
();
260
261
}
else
if
(name ==
"dna_opt4"
) {
262
fEmName
=
name
;
263
delete
fEmPhysicsList
;
264
fEmPhysicsList
=
new
G4EmDNAPhysics_option4
();
265
266
}
else
if
(name ==
"dna_opt5"
) {
267
fEmName
=
name
;
268
delete
fEmPhysicsList
;
269
fEmPhysicsList
=
new
G4EmDNAPhysics_option5
();
270
271
}
else
if
(name ==
"dna_opt6"
) {
272
fEmName
=
name
;
273
delete
fEmPhysicsList
;
274
fEmPhysicsList
=
new
G4EmDNAPhysics_option6
();
275
276
}
else
if
(name ==
"dna_opt7"
) {
277
fEmName
=
name
;
278
delete
fEmPhysicsList
;
279
fEmPhysicsList
=
new
G4EmDNAPhysics_option7
();
280
281
}
else
{
282
283
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
284
<<
" is not defined"
285
<<
G4endl
;
286
}
287
G4EmParameters::Instance
()->
SetBuildCSDARange
(
true
);
288
}
289
290
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291
292
#include "
G4Decay.hh
"
293
294
void
PhysicsList::AddDecay
()
295
{
296
// decay process
297
//
298
G4Decay
* fDecayProcess =
new
G4Decay
();
299
300
auto
particleIterator
=
GetParticleIterator
();
301
particleIterator
->reset();
302
while
( (*
particleIterator
)() ){
303
G4ParticleDefinition
*
particle
=
particleIterator
->value();
304
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
305
306
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
307
308
pmanager ->
AddProcess
(fDecayProcess);
309
310
// set ordering for PostStepDoIt and AtRestDoIt
311
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
312
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
313
314
}
315
}
316
}
317
318
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319
320
#include "StepMax.hh"
321
322
void
PhysicsList::AddStepMax
()
323
{
324
// Step limitation seen as a process
325
fStepMaxProcess
=
new
StepMax
();
326
327
auto
particleIterator
=
GetParticleIterator
();
328
particleIterator
->reset();
329
while
((*
particleIterator
)()){
330
G4ParticleDefinition
* particle =
particleIterator
->value();
331
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
332
333
if
(
fStepMaxProcess
->
IsApplicable
(*particle))
334
{
335
pmanager ->
AddDiscreteProcess
(
fStepMaxProcess
);
336
}
337
}
338
}
339
340
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
electromagnetic
TestEm12
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration