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
ExN02PhysicsList.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ExN02PhysicsList.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
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "
ExN02PhysicsList.hh
"
35
36
#include "
G4ProcessManager.hh
"
37
#include "
G4ParticleTypes.hh
"
38
#include "
G4SystemOfUnits.hh
"
39
40
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41
42
ExN02PhysicsList::ExN02PhysicsList
():
G4VUserPhysicsList
()
43
{
44
defaultCutValue
= 1.0*
cm
;
45
SetVerboseLevel
(1);
46
}
47
48
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49
50
ExN02PhysicsList::~ExN02PhysicsList
()
51
{}
52
53
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54
55
void
ExN02PhysicsList::ConstructParticle
()
56
{
57
// In this method, static member functions should be called
58
// for all particles which you want to use.
59
// This ensures that objects of these particle types will be
60
// created in the program.
61
62
ConstructBosons
();
63
ConstructLeptons
();
64
ConstructMesons
();
65
ConstructBaryons
();
66
}
67
68
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
70
void
ExN02PhysicsList::ConstructBosons
()
71
{
72
// pseudo-particles
73
G4Geantino::GeantinoDefinition
();
74
G4ChargedGeantino::ChargedGeantinoDefinition
();
75
76
// gamma
77
G4Gamma::GammaDefinition
();
78
}
79
80
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81
82
void
ExN02PhysicsList::ConstructLeptons
()
83
{
84
// leptons
85
// e+/-
86
G4Electron::ElectronDefinition
();
87
G4Positron::PositronDefinition
();
88
// mu+/-
89
G4MuonPlus::MuonPlusDefinition
();
90
G4MuonMinus::MuonMinusDefinition
();
91
// nu_e
92
G4NeutrinoE::NeutrinoEDefinition
();
93
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
94
// nu_mu
95
G4NeutrinoMu::NeutrinoMuDefinition
();
96
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
97
}
98
99
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100
101
void
ExN02PhysicsList::ConstructMesons
()
102
{
103
// mesons
104
// light mesons
105
G4PionPlus::PionPlusDefinition
();
106
G4PionMinus::PionMinusDefinition
();
107
G4PionZero::PionZeroDefinition
();
108
G4Eta::EtaDefinition
();
109
G4EtaPrime::EtaPrimeDefinition
();
110
G4KaonPlus::KaonPlusDefinition
();
111
G4KaonMinus::KaonMinusDefinition
();
112
G4KaonZero::KaonZeroDefinition
();
113
G4AntiKaonZero::AntiKaonZeroDefinition
();
114
G4KaonZeroLong::KaonZeroLongDefinition
();
115
G4KaonZeroShort::KaonZeroShortDefinition
();
116
}
117
118
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119
120
void
ExN02PhysicsList::ConstructBaryons
()
121
{
122
// barions
123
G4Proton::ProtonDefinition
();
124
G4AntiProton::AntiProtonDefinition
();
125
126
G4Neutron::NeutronDefinition
();
127
G4AntiNeutron::AntiNeutronDefinition
();
128
}
129
130
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131
132
void
ExN02PhysicsList::ConstructProcess
()
133
{
134
AddTransportation
();
135
ConstructEM
();
136
ConstructGeneral
();
137
AddStepMax
();
138
}
139
140
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141
142
#include "
G4ComptonScattering.hh
"
143
#include "
G4GammaConversion.hh
"
144
#include "
G4PhotoElectricEffect.hh
"
145
146
#include "
G4eMultipleScattering.hh
"
147
#include "
G4eIonisation.hh
"
148
#include "
G4eBremsstrahlung.hh
"
149
#include "
G4eplusAnnihilation.hh
"
150
151
#include "
G4MuMultipleScattering.hh
"
152
#include "
G4MuIonisation.hh
"
153
#include "
G4MuBremsstrahlung.hh
"
154
#include "
G4MuPairProduction.hh
"
155
156
#include "
G4hMultipleScattering.hh
"
157
#include "
G4hIonisation.hh
"
158
#include "
G4hBremsstrahlung.hh
"
159
#include "
G4hPairProduction.hh
"
160
161
#include "
G4ionIonisation.hh
"
162
163
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
164
165
void
ExN02PhysicsList::ConstructEM
()
166
{
167
auto
particleIterator
=
GetParticleIterator
();
168
particleIterator
->reset();
169
while
( (*
particleIterator
)() ){
170
G4ParticleDefinition
*
particle
=
particleIterator
->value();
171
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
172
G4String
particleName = particle->
GetParticleName
();
173
174
if
(particleName ==
"gamma"
) {
175
// gamma
176
pmanager->
AddDiscreteProcess
(
new
G4PhotoElectricEffect
);
177
pmanager->
AddDiscreteProcess
(
new
G4ComptonScattering
);
178
pmanager->
AddDiscreteProcess
(
new
G4GammaConversion
);
179
180
}
else
if
(particleName ==
"e-"
) {
181
//electron
182
pmanager->
AddProcess
(
new
G4eMultipleScattering
, -1, 1, 1);
183
pmanager->
AddProcess
(
new
G4eIonisation
, -1, 2, 2);
184
pmanager->
AddProcess
(
new
G4eBremsstrahlung
, -1, 3, 3);
185
186
}
else
if
(particleName ==
"e+"
) {
187
//positron
188
pmanager->
AddProcess
(
new
G4eMultipleScattering
, -1, 1, 1);
189
pmanager->
AddProcess
(
new
G4eIonisation
, -1, 2, 2);
190
pmanager->
AddProcess
(
new
G4eBremsstrahlung
, -1, 3, 3);
191
pmanager->
AddProcess
(
new
G4eplusAnnihilation
, 0,-1, 4);
192
193
}
else
if
( particleName ==
"mu+"
||
194
particleName ==
"mu-"
) {
195
//muon
196
pmanager->
AddProcess
(
new
G4MuMultipleScattering
, -1, 1, 1);
197
pmanager->
AddProcess
(
new
G4MuIonisation
, -1, 2, 2);
198
pmanager->
AddProcess
(
new
G4MuBremsstrahlung
, -1, 3, 3);
199
pmanager->
AddProcess
(
new
G4MuPairProduction
, -1, 4, 4);
200
201
}
else
if
( particleName ==
"proton"
||
202
particleName ==
"pi-"
||
203
particleName ==
"pi+"
) {
204
//proton
205
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
206
pmanager->
AddProcess
(
new
G4hIonisation
, -1, 2, 2);
207
pmanager->
AddProcess
(
new
G4hBremsstrahlung
, -1, 3, 3);
208
pmanager->
AddProcess
(
new
G4hPairProduction
, -1, 4, 4);
209
210
}
else
if
( particleName ==
"alpha"
||
211
particleName ==
"He3"
) {
212
//alpha
213
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
214
pmanager->
AddProcess
(
new
G4ionIonisation
, -1, 2, 2);
215
216
}
else
if
( particleName ==
"GenericIon"
) {
217
//Ions
218
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
219
pmanager->
AddProcess
(
new
G4ionIonisation
, -1, 2, 2);
220
221
}
else
if
((!particle->
IsShortLived
()) &&
222
(particle->
GetPDGCharge
() != 0.0) &&
223
(particle->
GetParticleName
() !=
"chargedgeantino"
)) {
224
//all others charged particles except geantino
225
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
226
pmanager->
AddProcess
(
new
G4hIonisation
, -1, 2, 2);
227
}
228
}
229
}
230
231
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
232
233
#include "
G4Decay.hh
"
234
235
void
ExN02PhysicsList::ConstructGeneral
()
236
{
237
// Add Decay Process
238
G4Decay
* theDecayProcess =
new
G4Decay
();
239
auto
particleIterator
=
GetParticleIterator
();
240
particleIterator
->reset();
241
while
( (*
particleIterator
)() ){
242
G4ParticleDefinition
*
particle
=
particleIterator
->value();
243
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
244
if
(theDecayProcess->
IsApplicable
(*particle)) {
245
pmanager ->
AddProcess
(theDecayProcess);
246
// set ordering for PostStepDoIt and AtRestDoIt
247
pmanager ->
SetProcessOrdering
(theDecayProcess,
idxPostStep
);
248
pmanager ->
SetProcessOrdering
(theDecayProcess,
idxAtRest
);
249
}
250
}
251
}
252
253
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
254
255
#include "
G4StepLimiter.hh
"
256
#include "
G4UserSpecialCuts.hh
"
257
258
void
ExN02PhysicsList::AddStepMax
()
259
{
260
// Step limitation seen as a process
261
G4StepLimiter
* stepLimiter =
new
G4StepLimiter
();
263
264
auto
particleIterator
=
GetParticleIterator
();
265
particleIterator
->reset();
266
while
((*
particleIterator
)()){
267
G4ParticleDefinition
*
particle
=
particleIterator
->value();
268
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
269
270
if
(particle->
GetPDGCharge
() != 0.0)
271
{
272
pmanager ->
AddDiscreteProcess
(stepLimiter);
274
}
275
}
276
}
277
278
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
279
280
void
ExN02PhysicsList::SetCuts
()
281
{
282
//G4VUserPhysicsList::SetCutsWithDefault method sets
283
//the default cut value for all particle types
284
//
285
SetCutsWithDefault
();
286
287
if
(
verboseLevel
>0)
DumpCutValuesTable
();
288
}
289
290
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291
geant4
tree
geant4-10.6-release
examples
extended
parallel
TopC
ParN02
src
ExN02PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration