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
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 "
G4EmStandardPhysicsSS.hh
"
44
#include "
G4EmStandardPhysicsGS.hh
"
45
#include "
G4EmStandardPhysicsWVI.hh
"
46
#include "
G4EmLivermorePhysics.hh
"
47
#include "
G4EmPenelopePhysics.hh
"
48
#include "
G4EmLowEPPhysics.hh
"
49
50
#include "
G4LossTableManager.hh
"
51
#include "
G4UnitsTable.hh
"
52
#include "
G4SystemOfUnits.hh
"
53
54
// particles
55
56
#include "
G4BosonConstructor.hh
"
57
#include "
G4LeptonConstructor.hh
"
58
#include "
G4MesonConstructor.hh
"
59
#include "
G4BosonConstructor.hh
"
60
#include "
G4BaryonConstructor.hh
"
61
#include "
G4IonConstructor.hh
"
62
#include "
G4ShortLivedConstructor.hh
"
63
64
G4ThreadLocal
StepMax
*
PhysicsList::fStepMaxProcess
= 0;
65
66
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
()
69
{
70
fMessenger
=
new
PhysicsListMessenger
(
this
);
71
72
SetVerboseLevel
(1);
73
74
// EM physics
75
fEmPhysicsList
=
new
PhysListEmStandard
(
fEmName
=
"local"
);
76
77
G4LossTableManager::Instance
();
78
SetDefaultCutValue
(1.*
mm
);
79
}
80
81
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82
83
PhysicsList::~PhysicsList
()
84
{
85
delete
fMessenger
;
86
delete
fEmPhysicsList
;
87
}
88
89
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
91
void
PhysicsList::ConstructParticle
()
92
{
93
G4BosonConstructor
pBosonConstructor;
94
pBosonConstructor.
ConstructParticle
();
95
96
G4LeptonConstructor
pLeptonConstructor;
97
pLeptonConstructor.
ConstructParticle
();
98
99
G4MesonConstructor
pMesonConstructor;
100
pMesonConstructor.
ConstructParticle
();
101
102
G4BaryonConstructor
pBaryonConstructor;
103
pBaryonConstructor.
ConstructParticle
();
104
105
G4IonConstructor
pIonConstructor;
106
pIonConstructor.
ConstructParticle
();
107
108
G4ShortLivedConstructor
pShortLivedConstructor;
109
pShortLivedConstructor.
ConstructParticle
();
110
}
111
112
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113
114
#include "
G4ProcessManager.hh
"
115
116
void
PhysicsList::ConstructProcess
()
117
{
118
// transportation
119
//
120
AddTransportation
();
121
122
// electromagnetic physics list
123
//
124
fEmPhysicsList
->
ConstructProcess
();
125
126
// Em options
127
//
128
G4EmParameters
* param =
G4EmParameters::Instance
();
129
param->
SetBuildCSDARange
(
true
);
130
131
// decay process
132
//
133
AddDecay
();
134
135
// radioactive decay Process
136
//
137
AddRadioactiveDecay
();
138
139
// step limitation (as a full process)
140
//
141
AddStepMax
();
142
}
143
144
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145
146
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
147
{
148
if
(
verboseLevel
>-1) {
149
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
150
}
151
152
if
(name ==
fEmName
)
return
;
153
154
if
(name ==
"local"
) {
155
fEmName
=
name
;
156
delete
fEmPhysicsList
;
157
fEmPhysicsList
=
new
PhysListEmStandard
(name);
158
159
}
else
if
(name ==
"emstandard_opt0"
) {
160
fEmName
=
name
;
161
delete
fEmPhysicsList
;
162
fEmPhysicsList
=
new
G4EmStandardPhysics
();
163
164
}
else
if
(name ==
"emstandard_opt1"
) {
165
fEmName
=
name
;
166
delete
fEmPhysicsList
;
167
fEmPhysicsList
=
new
G4EmStandardPhysics_option1
();
168
169
}
else
if
(name ==
"emstandard_opt2"
) {
170
fEmName
=
name
;
171
delete
fEmPhysicsList
;
172
fEmPhysicsList
=
new
G4EmStandardPhysics_option2
();
173
174
}
else
if
(name ==
"emstandard_opt3"
) {
175
fEmName
=
name
;
176
delete
fEmPhysicsList
;
177
fEmPhysicsList
=
new
G4EmStandardPhysics_option3
();
178
179
}
else
if
(name ==
"emstandard_opt4"
) {
180
fEmName
=
name
;
181
delete
fEmPhysicsList
;
182
fEmPhysicsList
=
new
G4EmStandardPhysics_option4
();
183
184
}
else
if
(name ==
"emstandardSS"
) {
185
fEmName
=
name
;
186
delete
fEmPhysicsList
;
187
fEmPhysicsList
=
new
G4EmStandardPhysicsSS
();
188
189
}
else
if
(name ==
"emstandardGS"
) {
190
fEmName
=
name
;
191
delete
fEmPhysicsList
;
192
fEmPhysicsList
=
new
G4EmStandardPhysicsGS
();
193
194
}
else
if
(name ==
"emstandardWVI"
) {
195
fEmName
=
name
;
196
delete
fEmPhysicsList
;
197
fEmPhysicsList
=
new
G4EmStandardPhysicsWVI
();
198
199
}
else
if
(name ==
"emlowenergy"
) {
200
fEmName
=
name
;
201
delete
fEmPhysicsList
;
202
fEmPhysicsList
=
new
G4EmLowEPPhysics
();
203
204
}
else
if
(name ==
"emlivermore"
) {
205
fEmName
=
name
;
206
delete
fEmPhysicsList
;
207
fEmPhysicsList
=
new
G4EmLivermorePhysics
();
208
209
}
else
if
(name ==
"empenelope"
) {
210
fEmName
=
name
;
211
delete
fEmPhysicsList
;
212
fEmPhysicsList
=
new
G4EmPenelopePhysics
();
213
214
}
else
{
215
216
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
217
<<
" is not defined"
218
<<
G4endl
;
219
}
220
}
221
222
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
223
224
#include "
G4Decay.hh
"
225
226
void
PhysicsList::AddDecay
()
227
{
228
// decay process
229
//
230
G4Decay
* fDecayProcess =
new
G4Decay
();
231
232
auto
particleIterator
=
GetParticleIterator
();
233
particleIterator
->reset();
234
while
( (*
particleIterator
)() ){
235
G4ParticleDefinition
*
particle
=
particleIterator
->value();
236
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
237
238
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
239
240
pmanager ->
AddProcess
(fDecayProcess);
241
242
// set ordering for PostStepDoIt and AtRestDoIt
243
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
244
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
245
246
}
247
}
248
}
249
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
250
251
#include "
G4PhysicsListHelper.hh
"
252
#include "
G4RadioactiveDecay.hh
"
253
#include "
G4GenericIon.hh
"
254
#include "
G4NuclideTable.hh
"
255
256
void
PhysicsList::AddRadioactiveDecay
()
257
{
258
G4RadioactiveDecay
* radioactiveDecay =
new
G4RadioactiveDecay
();
259
260
radioactiveDecay->
SetARM
(
true
);
//Atomic Rearangement
261
262
G4PhysicsListHelper
* ph =
G4PhysicsListHelper::GetPhysicsListHelper
();
263
ph->
RegisterProcess
(radioactiveDecay,
G4GenericIon::GenericIon
());
264
265
// mandatory for G4NuclideTable
266
//
267
G4NuclideTable::GetInstance
()->
SetThresholdOfHalfLife
(0.1*
picosecond
);
268
}
269
270
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
271
272
#include "StepMax.hh"
273
274
void
PhysicsList::AddStepMax
()
275
{
276
// Step limitation seen as a process
277
fStepMaxProcess
=
new
StepMax
();
278
279
auto
particleIterator
=
GetParticleIterator
();
280
particleIterator
->reset();
281
while
((*
particleIterator
)()){
282
G4ParticleDefinition
* particle =
particleIterator
->value();
283
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
284
285
if
(
fStepMaxProcess
->
IsApplicable
(*particle))
286
{
287
pmanager ->
AddDiscreteProcess
(
fStepMaxProcess
);
288
}
289
}
290
}
291
292
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
electromagnetic
TestEm11
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration