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
GammaRayTelPhysicsList.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file GammaRayTelPhysicsList.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
// Authors: Susanna Guatelli, susanna@uow.edu.au,
27
// Authors: Jeremy Davis, jad028@uowmail.edu.au
28
//
29
// Code based on the hadrontherapy && radioprotection advanced example
30
31
#include "
GammaRayTelPhysicsList.hh
"
32
#include "
GammaRayTelPhysicsListMessenger.hh
"
33
#include "
G4PhysListFactory.hh
"
34
#include "
G4VPhysicsConstructor.hh
"
35
36
// Physic lists (contained inside the Geant4 distribution)
37
#include "
G4EmStandardPhysics_option3.hh
"
38
#include "
G4EmLivermorePhysics.hh
"
39
#include "
G4EmPenelopePhysics.hh
"
40
#include "
G4EmLivermorePolarizedPhysics.hh
"
// TBC
41
42
#include "
G4DecayPhysics.hh
"
43
#include "
G4HadronElasticPhysics.hh
"
44
#include "
G4HadronDElasticPhysics.hh
"
45
#include "
G4HadronElasticPhysicsHP.hh
"
46
#include "
G4IonBinaryCascadePhysics.hh
"
47
#include "
G4Decay.hh
"
48
#include "
G4StepLimiter.hh
"
49
#include "
G4LossTableManager.hh
"
50
#include "
G4UnitsTable.hh
"
51
#include "
G4SystemOfUnits.hh
"
52
#include "
G4ProcessManager.hh
"
53
54
#include "
G4IonFluctuations.hh
"
55
#include "
G4IonParametrisedLossModel.hh
"
56
#include "
G4EmProcessOptions.hh
"
57
#include "
G4HadronPhysicsQGSP_BIC_HP.hh
"
58
#include "
G4RadioactiveDecayPhysics.hh
"
59
61
GammaRayTelPhysicsList::GammaRayTelPhysicsList
() :
G4VModularPhysicsList
()
62
{
63
G4LossTableManager::Instance
();
64
defaultCutValue
= 100*
micrometer
;
65
cutForGamma
=
defaultCutValue
;
66
cutForElectron
=
defaultCutValue
;
67
cutForPositron
=
defaultCutValue
;
68
69
helIsRegisted
=
false
;
70
bicIsRegisted
=
false
;
71
biciIsRegisted
=
false
;
72
locIonIonInelasticIsRegistered
=
false
;
73
radioactiveDecayIsRegisted
=
false
;
74
75
pMessenger
=
new
GammaRayTelPhysicsListMessenger
(
this
);
76
77
SetVerboseLevel
(1);
78
79
// EM physics
80
emPhysicsList
=
new
G4EmStandardPhysics_option3
(1);
81
emName
=
G4String
(
"emstandard_opt3"
);
82
83
// Decay physics and all particles
84
decPhysicsList
=
new
G4DecayPhysics
();
85
}
86
88
GammaRayTelPhysicsList::~GammaRayTelPhysicsList
()
89
{
90
delete
pMessenger
;
91
delete
emPhysicsList
;
92
delete
decPhysicsList
;
93
for
(
size_t
i=0; i<
hadronPhys
.size(); i++) {
delete
hadronPhys
[i];}
94
}
95
97
void
GammaRayTelPhysicsList::AddPackage
(
const
G4String
&
name
)
98
{
99
G4PhysListFactory
factory;
100
G4VModularPhysicsList
* phys =factory.
GetReferencePhysList
(name);
101
G4int
i=0;
102
const
G4VPhysicsConstructor
* elem= phys->
GetPhysics
(i);
103
G4VPhysicsConstructor
*
tmp
=
const_cast<
G4VPhysicsConstructor
*
>
(elem);
104
while
(elem !=0)
105
{
106
RegisterPhysics
(tmp);
107
elem= phys->
GetPhysics
(++i) ;
108
tmp =
const_cast<
G4VPhysicsConstructor
*
>
(elem);
109
}
110
}
111
113
void
GammaRayTelPhysicsList::ConstructParticle
()
114
{
115
decPhysicsList
->
ConstructParticle
();
116
}
117
119
void
GammaRayTelPhysicsList::ConstructProcess
()
120
{
121
// transportation
122
//
123
AddTransportation
();
124
125
// electromagnetic physics list
126
//
127
emPhysicsList
->
ConstructProcess
();
128
em_config
.
AddModels
();
129
130
// decay physics list
131
//
132
decPhysicsList
->
ConstructProcess
();
133
134
// hadronic physics lists
135
for
(
size_t
i=0; i<
hadronPhys
.size(); i++) {
136
hadronPhys
[i]->ConstructProcess();
137
}
138
139
// step limitation (as a full process)
140
//
141
// AddStepMax();
142
}
143
145
void
GammaRayTelPhysicsList::AddPhysicsList
(
const
G4String
&
name
)
146
{
147
148
if
(
verboseLevel
>1) {
149
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
150
}
151
if
(name ==
emName
)
return
;
152
154
// ELECTROMAGNETIC MODELS
156
157
if
(name ==
"standard_opt3"
) {
158
emName
=
name
;
159
delete
emPhysicsList
;
160
emPhysicsList
=
new
G4EmStandardPhysics_option3
();
161
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3"
<<
G4endl
;
162
163
}
else
if
(name ==
"LowE_Livermore"
) {
164
emName
=
name
;
165
delete
emPhysicsList
;
166
emPhysicsList
=
new
G4EmLivermorePhysics
();
167
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics"
<<
G4endl
;
168
}
else
if
(name ==
"LowE_Penelope"
) {
169
emName
=
name
;
170
delete
emPhysicsList
;
171
emPhysicsList
=
new
G4EmPenelopePhysics
();
172
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics"
<<
G4endl
;
173
}
else
if
(name ==
"LowE_Polarized"
) {
174
emName
=
name
;
175
delete
emPhysicsList
;
176
emPhysicsList
=
new
G4EmLivermorePolarizedPhysics
();
177
G4cout
<<
"THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics"
<<
G4endl
;
178
180
// HADRONIC MODELS
182
}
else
if
(name ==
"elastic"
&& !
helIsRegisted
) {
183
G4cout
<<
"THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()"
<<
G4endl
;
184
hadronPhys
.push_back(
new
G4HadronElasticPhysics
());
185
helIsRegisted
=
true
;
186
187
}
else
if
(name ==
"DElastic"
&& !
helIsRegisted
) {
188
hadronPhys
.push_back(
new
G4HadronDElasticPhysics
());
189
helIsRegisted
=
true
;
190
191
}
else
if
(name ==
"HPElastic"
&& !
helIsRegisted
) {
192
hadronPhys
.push_back(
new
G4HadronElasticPhysicsHP
());
193
helIsRegisted
=
true
;
194
195
}
else
if
(name ==
"binary"
&& !
bicIsRegisted
) {
196
hadronPhys
.push_back(
new
G4HadronPhysicsQGSP_BIC_HP
());
197
bicIsRegisted
=
true
;
198
G4cout
<<
"THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: HadronPhysicsQGSP_BIC_HP()"
<<
G4endl
;
199
200
}
else
if
(name ==
"binary_ion"
&& !
biciIsRegisted
) {
201
hadronPhys
.push_back(
new
G4IonBinaryCascadePhysics
());
202
biciIsRegisted
=
true
;
203
G4cout
<<
"THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4IonBinaryCascadePhysics()"
<<
G4endl
;
204
}
else
if
(name ==
"radioactive_decay"
&& !
radioactiveDecayIsRegisted
) {
205
hadronPhys
.push_back(
new
G4RadioactiveDecayPhysics
());
206
radioactiveDecayIsRegisted
=
true
;
207
G4cout
<<
"THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4RadioactiveDecayPhysics()"
<<
G4endl
;
208
}
else
{
209
210
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
211
<<
" is not defined"
212
<<
G4endl
;
213
}
214
}
215
217
void
GammaRayTelPhysicsList::SetCuts
()
218
{
219
220
if
(
verboseLevel
>0){
221
G4cout
<<
"PhysicsList::SetCuts:"
;
222
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
223
}
224
225
G4double
lowLimit = 250. *
eV
;
226
G4double
highLimit = 100. *
GeV
;
227
G4ProductionCutsTable::GetProductionCutsTable
()->
SetEnergyRange
(lowLimit, highLimit);
228
229
// set cut values for gamma at first and for e- second and next for e+,
230
// because some processes for e+/e- need cut values for gamma
231
SetCutValue
(
cutForGamma
,
"gamma"
);
232
SetCutValue
(
cutForElectron
,
"e-"
);
233
SetCutValue
(
cutForPositron
,
"e+"
);
234
235
if
(
verboseLevel
>0)
DumpCutValuesTable
();
236
}
237
238
void
GammaRayTelPhysicsList::SetCutForGamma
(
G4double
cut)
239
{
240
cutForGamma
= cut;
241
SetParticleCuts
(
cutForGamma
,
G4Gamma::Gamma
());
242
}
243
244
void
GammaRayTelPhysicsList::SetCutForElectron
(
G4double
cut)
245
{
246
cutForElectron
= cut;
247
SetParticleCuts
(
cutForElectron
,
G4Electron::Electron
());
248
}
249
250
void
GammaRayTelPhysicsList::SetCutForPositron
(
G4double
cut)
251
{
252
cutForPositron
= cut;
253
SetParticleCuts
(
cutForPositron
,
G4Positron::Positron
());
254
}
255
geant4
tree
geant4-10.6-release
examples
advanced
gammaray_telescope
src
GammaRayTelPhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:58
using
1.8.2 with
ECCE GitHub integration