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
ML2PhysicsList.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ML2PhysicsList.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
// The code was written by :
27
// ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28
// *Barbara Caccia barbara.caccia@iss.it
29
// with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30
// with the contribute of Alessandro Occhigrossi*
31
//
32
// ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33
// *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34
// Viale Regina Elena 299, 00161 Roma (Italy)
35
// tel (39) 06 49902246
36
// fax (39) 06 49387075
37
//
38
// more information:
39
// http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40
//
41
//*******************************************************//
42
//
43
// This class provides all the physic models that can be activated inside ML2;
44
// Each model can be setted via macro commands;
45
// Inside ML2 the models can be activate with three different complementar methods:
46
//
47
// 1. Use of the *Packages*.
48
// Packages (that are contained inside the
49
// Geant4 distribution at $G4INSTALL/source/physics_lists/lists) provide a full set
50
// of models (both electromagnetic and hadronic).
51
// The User can use this method simply add the line /physic/addPackage <nameOfPackage>
52
// in his/her macro file. No other action is required.
53
// For ML2 applications we suggest the use of the QGSP_BIC package
54
// for proton beams. The same can be used
55
// also for ligth ion beam.
56
//
57
//
58
// 2. Use of the *Physic Lists*.
59
// Physic lists are also already ready to use inside the Geant4 distribution
60
// ($G4INSTALL/source/physics_lists/builders). To use them the simple
61
// /physic/addPhysics <nameOfPhysicList> command must be used in the macro.
62
// In ML2 we provide physics list to activate Electromagnetic,
63
// Hadronic elastic and Hadronic inelastic models.
64
//
65
// For ML2 we suggest the use of:
66
//
67
// /physic/addPhysic/emstandard_option3 (electromagnetic model)
68
// /physic/addPhysic/elastic (hadronic elastic model)
69
// /physic/addPhysic/binary (hadronic inelastic models for proton and neutrons)
70
// /physic/addPhysic/binary_ion (hadronic inelastic models for ions)
71
//
72
// Example of the use of physics lists can be found in the macro files
73
//
74
75
#include "
ML2PhysicsList.hh
"
76
#include "
ML2PhysicsListMessenger.hh
"
77
#include "
ML2StepMax.hh
"
78
#include "
G4SystemOfUnits.hh
"
79
#include "
G4VPhysicsConstructor.hh
"
80
81
// Physics lists
82
#include "
G4EmStandardPhysics_option4.hh
"
83
#include "
G4EmStandardPhysics_option3.hh
"
84
#include "
G4EmLivermorePhysics.hh
"
85
#include "
G4EmPenelopePhysics.hh
"
86
#include "
G4DecayPhysics.hh
"
87
#include "
G4HadronElasticPhysics.hh
"
88
#include "
G4HadronInelasticQBBC.hh
"
89
#include "
G4IonBinaryCascadePhysics.hh
"
90
#include "
G4Decay.hh
"
91
92
#include "
G4UnitsTable.hh
"
93
#include "
G4ProcessManager.hh
"
94
96
ML2PhysicsList::ML2PhysicsList
() :
G4VModularPhysicsList
()
97
{
98
defaultCutValue
= 1.*
mm
;
99
helIsRegisted
=
false
;
100
bicIsRegisted
=
false
;
101
biciIsRegisted
=
false
;
102
locIonIonInelasticIsRegistered
=
false
;
103
104
stepMaxProcess
=
nullptr
;
105
106
pMessenger
=
new
ML2PhysicsListMessenger
(
this
);
107
108
SetVerboseLevel
(1);
109
110
// EM physics
111
emPhysicsList
=
new
G4EmStandardPhysics_option3
(1);
112
emName
=
G4String
(
"emstandard_opt3"
);
113
114
// emPhysicsList = new G4EmLivermorePhysics();
115
// emName = G4String("LowE_Livermore");
116
117
// Decay physics and all particles
118
decPhysicsList
=
new
G4DecayPhysics
();
119
}
120
122
ML2PhysicsList::~ML2PhysicsList
()
123
{
124
delete
pMessenger
;
125
delete
emPhysicsList
;
126
delete
decPhysicsList
;
127
for
(
size_t
i=0; i<
hadronPhys
.size(); i++) {
delete
hadronPhys
[i];}
128
}
129
131
void
ML2PhysicsList::ConstructParticle
()
132
{
133
decPhysicsList
->
ConstructParticle
();
134
}
135
137
void
ML2PhysicsList::ConstructProcess
()
138
{
139
// transportation
140
//
141
AddTransportation
();
142
143
// electromagnetic physics list
144
//
145
emPhysicsList
->
ConstructProcess
();
146
147
// decay physics list
148
//
149
decPhysicsList
->
ConstructProcess
();
150
151
// hadronic physics lists
152
for
(
size_t
i=0; i<
hadronPhys
.size(); i++) {
153
hadronPhys
[i]->ConstructProcess();
154
}
155
156
// step limitation (as a full process)
157
//
158
AddStepMax
();
159
}
160
162
void
ML2PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
163
{
164
165
if
(
verboseLevel
>1) {
166
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
167
}
168
if
(name ==
emName
)
return
;
169
171
// ELECTROMAGNETIC MODELS
173
174
if
(name ==
"standard_opt3"
) {
175
emName
=
name
;
176
delete
emPhysicsList
;
177
emPhysicsList
=
new
G4EmStandardPhysics_option3
();
178
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3"
<<
G4endl
;
179
180
}
else
if
(name ==
"standard_opt4"
) {
181
emName
=
name
;
182
delete
emPhysicsList
;
183
emPhysicsList
=
new
G4EmStandardPhysics_option4
();
184
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4"
<<
G4endl
;
185
186
}
else
if
(name ==
"LowE_Livermore"
) {
187
emName
=
name
;
188
delete
emPhysicsList
;
189
emPhysicsList
=
new
G4EmLivermorePhysics
();
190
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics"
<<
G4endl
;
191
192
}
else
if
(name ==
"LowE_Penelope"
) {
193
emName
=
name
;
194
delete
emPhysicsList
;
195
emPhysicsList
=
new
G4EmPenelopePhysics
();
196
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics"
<<
G4endl
;
197
199
// HADRONIC MODELS
201
}
else
if
(name ==
"elastic"
&& !
helIsRegisted
) {
202
G4cout
<<
"THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()"
<<
G4endl
;
203
hadronPhys
.push_back(
new
G4HadronElasticPhysics
());
204
helIsRegisted
=
true
;
205
206
}
else
if
(name ==
"binary"
&& !
bicIsRegisted
) {
207
hadronPhys
.push_back(
new
G4HadronInelasticQBBC
());
208
bicIsRegisted
=
true
;
209
G4cout
<<
"THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()"
<<
G4endl
;
210
211
}
else
if
(name ==
"binary_ion"
&& !
biciIsRegisted
) {
212
hadronPhys
.push_back(
new
G4IonBinaryCascadePhysics
());
213
biciIsRegisted
=
true
;
214
215
}
else
{
216
217
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
218
<<
" is not defined"
219
<<
G4endl
;
220
}
221
}
222
224
void
ML2PhysicsList::AddStepMax
()
225
{
226
// Step limitation seen as a process
227
stepMaxProcess
=
new
ML2StepMax
();
228
229
auto
particleIterator
=
GetParticleIterator
();
230
particleIterator
->reset();
231
while
((*
particleIterator
)()){
232
G4ParticleDefinition
*
particle
=
particleIterator
->value();
233
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
234
235
if
(
stepMaxProcess
->
IsApplicable
(*particle) && pmanager)
236
{
237
pmanager ->
AddDiscreteProcess
(
stepMaxProcess
);
238
}
239
}
240
}
241
242
243
geant4
tree
geant4-10.6-release
examples
advanced
medical_linac
src
ML2PhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:00
using
1.8.2 with
ECCE GitHub integration