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
//
26
// This example is provided by the Geant4-DNA collaboration
27
// Any report or published results obtained using the Geant4-DNA software
28
// shall cite the following Geant4-DNA collaboration publication:
29
// Med. Phys. 37 (2010) 4692-4708
30
// The Geant4-DNA web site is available at http://geant4-dna.org
31
//
32
// If you use this example, please cite the following publication:
33
// Rad. Prot. Dos. 133 (2009) 2-11
34
35
#include "PhysicsList.hh"
36
#include "PhysicsListMessenger.hh"
37
38
#include "
G4SystemOfUnits.hh
"
39
#include "StepMax.hh"
40
41
#include "
G4EmStandardPhysics.hh
"
42
#include "
G4EmStandardPhysics_option1.hh
"
43
#include "
G4EmStandardPhysics_option2.hh
"
44
#include "
G4EmStandardPhysics_option3.hh
"
45
#include "
G4EmStandardPhysics_option4.hh
"
46
#include "
G4EmLivermorePhysics.hh
"
47
#include "
G4EmPenelopePhysics.hh
"
48
#include "
G4DecayPhysics.hh
"
49
50
#include "
G4ProcessManager.hh
"
51
52
#include "
G4Gamma.hh
"
53
#include "
G4Electron.hh
"
54
#include "
G4Positron.hh
"
55
56
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57
58
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
()
59
{
60
fMessenger
=
new
PhysicsListMessenger
(
this
);
61
62
SetVerboseLevel
(1);
63
64
// EM physics
65
fEmName
=
G4String
(
"emlivermore"
);
66
67
fEmPhysicsList
=
new
G4EmLivermorePhysics
();
68
69
// Deacy physics and all particles
70
fDecPhysicsList
=
new
G4DecayPhysics
();
71
}
72
73
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
75
PhysicsList::~PhysicsList
()
76
{
77
delete
fMessenger
;
78
delete
fEmPhysicsList
;
79
delete
fDecPhysicsList
;
80
}
81
82
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83
84
void
PhysicsList::ConstructParticle
()
85
{
86
fDecPhysicsList
->
ConstructParticle
();
87
}
88
89
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90
91
void
PhysicsList::ConstructProcess
()
92
{
93
// transportation
94
AddTransportation
();
95
96
// electromagnetic physics list
97
fEmPhysicsList
->
ConstructProcess
();
98
99
// decay physics list
100
fDecPhysicsList
->
ConstructProcess
();
101
102
// step limitation (as a full process)
103
AddStepMax
();
104
105
}
106
107
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108
109
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
110
{
111
if
(
verboseLevel
>1) {
112
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
113
}
114
115
if
(name ==
fEmName
)
return
;
116
117
if
(name ==
"emstandard_opt0"
) {
118
119
fEmName
=
name
;
120
delete
fEmPhysicsList
;
121
fEmPhysicsList
=
new
G4EmStandardPhysics
(1);
122
123
}
else
if
(name ==
"emstandard_opt1"
) {
124
125
fEmName
=
name
;
126
delete
fEmPhysicsList
;
127
fEmPhysicsList
=
new
G4EmStandardPhysics_option1
();
128
129
}
else
if
(name ==
"emstandard_opt2"
) {
130
131
fEmName
=
name
;
132
delete
fEmPhysicsList
;
133
fEmPhysicsList
=
new
G4EmStandardPhysics_option2
();
134
135
}
else
if
(name ==
"emstandard_opt3"
) {
136
137
fEmName
=
name
;
138
delete
fEmPhysicsList
;
139
fEmPhysicsList
=
new
G4EmStandardPhysics_option3
();
140
141
}
else
if
(name ==
"emstandard_opt4"
) {
142
143
fEmName
=
name
;
144
delete
fEmPhysicsList
;
145
fEmPhysicsList
=
new
G4EmStandardPhysics_option4
();
146
147
}
else
if
(name ==
"emlivermore"
) {
148
149
fEmName
=
name
;
150
delete
fEmPhysicsList
;
151
fEmPhysicsList
=
new
G4EmLivermorePhysics
();
152
153
}
else
if
(name ==
"empenelope"
) {
154
155
fEmName
=
name
;
156
delete
fEmPhysicsList
;
157
fEmPhysicsList
=
new
G4EmPenelopePhysics
();
158
159
}
160
}
161
162
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
163
164
void
PhysicsList::AddStepMax
()
165
{
166
// Step limitation seen as a process
167
StepMax
* stepMaxProcess =
new
StepMax
(
fMessenger
);
168
169
auto
particleIterator
=
GetParticleIterator
();
170
particleIterator
->reset();
171
while
((*
particleIterator
)()){
172
G4ParticleDefinition
*
particle
=
particleIterator
->value();
173
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
174
175
if
(stepMaxProcess->
IsApplicable
(*particle))
176
{
177
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
178
}
179
}
180
}
181
182
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
advanced
microbeam
src
PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:50
using
1.8.2 with
ECCE GitHub integration