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_option0.hh"
37
#include "PhysListEmStandard_option3.hh"
38
#include "PhysListEmStandard_option4.hh"
39
#include "PhysListEmStandard_GS.hh"
40
#include "PhysListEmStandard_WVI.hh"
41
#include "PhysListEmStandard_SS.hh"
42
43
#include "StepMax.hh"
44
45
#include "
G4ParticleDefinition.hh
"
46
47
#include "
G4ProcessManager.hh
"
48
#include "
G4LossTableManager.hh
"
49
#include "
G4UnitsTable.hh
"
50
51
// Bosons
52
#include "
G4ChargedGeantino.hh
"
53
#include "
G4Geantino.hh
"
54
#include "
G4Gamma.hh
"
55
56
// leptons
57
#include "
G4Electron.hh
"
58
#include "
G4Positron.hh
"
59
60
// Hadrons
61
#include "
G4Proton.hh
"
62
#include "
G4GenericIon.hh
"
63
64
#include "
G4SystemOfUnits.hh
"
65
66
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
PhysicsList::PhysicsList
(
DetectorConstruction
* det)
69
:
G4VModularPhysicsList
(),
70
fDetector(det),fMessenger(0),fEmName(
" "
),fEmPhysicsList(0)
71
{
72
G4LossTableManager::Instance
();
73
fMessenger
=
new
PhysicsListMessenger
(
this
);
74
75
// EM physics
76
fEmName
=
G4String
(
"standard_opt3"
);
77
fEmPhysicsList
=
new
PhysListEmStandard_option3
(
fEmName
,
fDetector
);
78
79
defaultCutValue
= 10*
km
;
80
81
SetVerboseLevel
(1);
82
}
83
84
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85
86
PhysicsList::~PhysicsList
()
87
{
88
delete
fEmPhysicsList
;
89
delete
fMessenger
;
90
}
91
92
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93
94
void
PhysicsList::ConstructParticle
()
95
{
96
// pseudo-particles
97
G4Geantino::GeantinoDefinition
();
98
G4ChargedGeantino::ChargedGeantinoDefinition
();
99
100
// gamma
101
G4Gamma::GammaDefinition
();
102
103
// leptons
104
G4Electron::ElectronDefinition
();
105
G4Positron::PositronDefinition
();
106
107
// baryons
108
G4Proton::ProtonDefinition
();
109
110
// Generic Ion
111
G4GenericIon::GenericIonDefinition
();
112
}
113
114
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115
116
void
PhysicsList::ConstructProcess
()
117
{
118
AddTransportation
();
119
fEmPhysicsList
->
ConstructProcess
();
120
121
AddStepMax
();
122
}
123
124
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
125
126
void
PhysicsList::AddStepMax
()
127
{
128
// Step limitation seen as a process
129
StepMax
* stepMaxProcess =
new
StepMax
();
130
131
auto
particleIterator
=
GetParticleIterator
();
132
particleIterator
->reset();
133
while
((*
particleIterator
)()){
134
G4ParticleDefinition
*
particle
=
particleIterator
->value();
135
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
136
137
if
(stepMaxProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
())
138
{
139
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
140
}
141
}
142
}
143
144
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145
146
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
147
{
148
if
(
verboseLevel
>0) {
149
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
150
}
151
152
if
(name ==
fEmName
)
return
;
153
154
if
(name ==
"standard_opt0"
) {
155
156
fEmName
=
name
;
157
delete
fEmPhysicsList
;
158
fEmPhysicsList
=
new
PhysListEmStandard_option0
(name,
fDetector
);
159
160
}
else
if
(name ==
"standard_opt3"
) {
161
162
fEmName
=
name
;
163
delete
fEmPhysicsList
;
164
fEmPhysicsList
=
new
PhysListEmStandard_option3
(name,
fDetector
);
165
166
}
else
if
(name ==
"standard_opt4"
) {
167
168
fEmName
=
name
;
169
delete
fEmPhysicsList
;
170
fEmPhysicsList
=
new
PhysListEmStandard_option4
(name,
fDetector
);
171
172
}
else
if
(name ==
"standard_GS"
) {
173
174
fEmName
=
name
;
175
delete
fEmPhysicsList
;
176
fEmPhysicsList
=
new
PhysListEmStandard_GS
(name,
fDetector
);
177
178
}
else
if
(name ==
"standard_WVI"
) {
179
180
fEmName
=
name
;
181
delete
fEmPhysicsList
;
182
fEmPhysicsList
=
new
PhysListEmStandard_WVI
(name,
fDetector
);
183
184
}
else
if
(name ==
"standard_SS"
) {
185
186
fEmName
=
name
;
187
delete
fEmPhysicsList
;
188
fEmPhysicsList
=
new
PhysListEmStandard_SS
(name,
fDetector
);
189
}
else
{
190
191
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
192
<<
" is not defined"
193
<<
G4endl
;
194
}
195
}
196
197
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198
199
void
PhysicsList::SetCuts
()
200
{
201
if
(
verboseLevel
>0){
202
G4cout
<<
"PhysicsList::SetCuts:"
;
203
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
204
}
205
206
// set cut values for gamma at first and for e- second and next for e+,
207
// because some processes for e+/e- need cut values for gamma
208
SetCutValue
(
defaultCutValue
,
"gamma"
);
209
SetCutValue
(
defaultCutValue
,
"e-"
);
210
SetCutValue
(
defaultCutValue
,
"e+"
);
211
SetCutValue
(
defaultCutValue
,
"proton"
);
212
}
213
214
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
medical
fanoCavity
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:51
using
1.8.2 with
ECCE GitHub integration