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
XrayFluoPhysicsList.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file XrayFluoPhysicsList.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
//
27
// History
28
// 14/01/11 Alf re-adapt this file from Physiclist of testEm18
29
//
30
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "
XrayFluoPhysicsList.hh
"
35
#include "
XrayFluoPhysicsListMessenger.hh
"
36
37
#include "
G4SystemOfUnits.hh
"
38
#include "
G4LossTableManager.hh
"
39
#include "
G4EmProcessOptions.hh
"
40
#include "
G4ProcessManager.hh
"
41
42
//#include "PhysListEmStandard.hh"
43
44
#include "
G4EmStandardPhysics.hh
"
45
#include "
G4EmStandardPhysics_option1.hh
"
46
#include "
G4EmStandardPhysics_option2.hh
"
47
#include "
G4EmStandardPhysics_option3.hh
"
48
//#include "XrayFluoPhysListEmStandardFLUO.hh"
49
#include "
G4EmLivermorePhysics.hh
"
50
#include "
G4EmPenelopePhysics.hh
"
51
//#include "G4UAtomicDeexcitation.hh"
52
53
#include "
G4Decay.hh
"
54
#include "
XrayFluoStepMax.hh
"
55
56
#include "
G4UnitsTable.hh
"
57
58
#include "
G4ParticleDefinition.hh
"
59
#include "
G4ProcessManager.hh
"
60
61
// Bosons
62
#include "
G4ChargedGeantino.hh
"
63
#include "
G4Geantino.hh
"
64
#include "
G4Gamma.hh
"
65
#include "
G4OpticalPhoton.hh
"
66
67
// leptons
68
#include "
G4MuonPlus.hh
"
69
#include "
G4MuonMinus.hh
"
70
#include "
G4NeutrinoMu.hh
"
71
#include "
G4AntiNeutrinoMu.hh
"
72
73
#include "
G4Electron.hh
"
74
#include "
G4Positron.hh
"
75
#include "
G4NeutrinoE.hh
"
76
#include "
G4AntiNeutrinoE.hh
"
77
78
// Hadrons
79
#include "
G4Proton.hh
"
80
#include "
G4MesonConstructor.hh
"
81
#include "
G4BaryonConstructor.hh
"
82
#include "
G4IonConstructor.hh
"
83
84
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85
86
XrayFluoPhysicsList::XrayFluoPhysicsList
() :
G4VModularPhysicsList
()
87
{
88
pMessenger
=
new
XrayFluoPhysicsListMessenger
(
this
);
89
90
// EM physics
91
G4LossTableManager::Instance
()->
SetVerbose
(1);
92
93
defaultCutValue
= 1.*
mm
;
94
95
cutForGamma
=
defaultCutValue
;
96
cutForElectron
=
defaultCutValue
;
97
cutForPositron
=
defaultCutValue
;
98
cutForProton
=
defaultCutValue
;
99
100
SetVerboseLevel
(1);
101
102
// EM physics
103
emName
=
G4String
(
"emlivermore"
);
104
emPhysicsList
=
new
G4EmLivermorePhysics
;
105
106
}
107
108
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109
110
XrayFluoPhysicsList::~XrayFluoPhysicsList
()
111
{
112
delete
emPhysicsList
;
113
delete
pMessenger
;
114
}
115
116
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117
118
void
XrayFluoPhysicsList::ConstructParticle
()
119
{
120
// pseudo-particles
121
G4Geantino::GeantinoDefinition
();
122
G4ChargedGeantino::ChargedGeantinoDefinition
();
123
124
// gamma
125
G4Gamma::GammaDefinition
();
126
127
// leptons
128
G4Electron::ElectronDefinition
();
129
G4Positron::PositronDefinition
();
130
G4MuonPlus::MuonPlusDefinition
();
131
G4MuonMinus::MuonMinusDefinition
();
132
133
G4NeutrinoE::NeutrinoEDefinition
();
134
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
135
G4NeutrinoMu::NeutrinoMuDefinition
();
136
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
137
138
// mesons
139
G4MesonConstructor
mConstructor;
140
mConstructor.
ConstructParticle
();
141
142
// barions
143
G4BaryonConstructor
bConstructor;
144
bConstructor.
ConstructParticle
();
145
146
// ions
147
G4IonConstructor
iConstructor;
148
iConstructor.
ConstructParticle
();
149
}
150
151
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152
153
void
XrayFluoPhysicsList::ConstructProcess
()
154
{
155
AddTransportation
();
156
emPhysicsList
->
ConstructProcess
();
157
AddDecay
();
158
AddStepMax
();
159
160
// Em options
161
//
162
G4EmProcessOptions
emOptions;
163
emOptions.
SetBuildCSDARange
(
true
);
164
emOptions.
SetDEDXBinningForCSDARange
(10*10);
165
//emOptions.SetDeexcitationActiveRegion(true); //TBC
166
emOptions.
SetFluo
(
true
);
167
emOptions.
SetAuger
(
true
);
168
emOptions.
SetPIXE
(
true
);
169
170
}
171
172
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
173
174
void
XrayFluoPhysicsList::AddDecay
()
175
{
176
// Add Decay Process
177
178
G4Decay
* fDecayProcess =
new
G4Decay
();
179
180
auto
particleIterator
=
GetParticleIterator
();
181
particleIterator
->reset();
182
while
( (*
particleIterator
)() ){
183
G4ParticleDefinition
*
particle
=
particleIterator
->value();
184
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
185
186
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
187
188
pmanager ->
AddProcess
(fDecayProcess);
189
190
// set ordering for PostStepDoIt and AtRestDoIt
191
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
192
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
193
194
}
195
}
196
}
197
198
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
199
200
void
XrayFluoPhysicsList::AddStepMax
()
201
{
202
// Step limitation seen as a process
203
XrayFluoStepMax
* stepMaxProcess =
new
XrayFluoStepMax
();
204
205
auto
particleIterator
=
GetParticleIterator
();
206
particleIterator
->reset();
207
while
((*
particleIterator
)()){
208
G4ParticleDefinition
*
particle
=
particleIterator
->value();
209
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
210
211
if
(stepMaxProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
())
212
{
213
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
214
}
215
}
216
}
217
218
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
219
220
void
XrayFluoPhysicsList::AddPhysicsList
(
const
G4String
&
name
)
221
{
222
if
(
verboseLevel
>-1) {
223
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
224
}
225
226
if
(name ==
emName
)
return
;
227
228
if
(name ==
"emlivermore"
) {
229
230
emName
=
name
;
231
delete
emPhysicsList
;
232
emPhysicsList
=
new
G4EmLivermorePhysics
;
233
234
}
else
if
(name ==
"emstandard"
) {
235
emName
=
name
;
236
delete
emPhysicsList
;
237
emPhysicsList
=
new
G4EmStandardPhysics
();
238
239
}
else
if
(name ==
"emstandard_opt1"
) {
240
241
emName
=
name
;
242
delete
emPhysicsList
;
243
emPhysicsList
=
new
G4EmStandardPhysics_option1
();
244
245
}
else
if
(name ==
"emstandard_opt2"
) {
246
247
emName
=
name
;
248
delete
emPhysicsList
;
249
emPhysicsList
=
new
G4EmStandardPhysics_option2
();
250
251
}
else
if
(name ==
"emstandard_opt3"
) {
252
253
emName
=
name
;
254
delete
emPhysicsList
;
255
emPhysicsList
=
new
G4EmStandardPhysics_option3
();
256
257
}
else
if
(name ==
"empenelope"
){
258
emName
=
name
;
259
delete
emPhysicsList
;
260
emPhysicsList
=
new
G4EmPenelopePhysics
();
261
262
}
else
{
263
264
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
265
<<
" is not defined"
266
<<
G4endl
;
267
}
268
}
269
270
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
271
272
void
XrayFluoPhysicsList::SetCuts
()
273
{
274
if
(
verboseLevel
>0){
275
G4cout
<<
"PhysicsList::SetCuts:"
;
276
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
277
}
278
279
// set cut values for gamma at first and for e- second and next for e+,
280
// because some processes for e+/e- need cut values for gamma
281
SetCutValue
(
cutForGamma
,
"gamma"
);
282
SetCutValue
(
cutForElectron
,
"e-"
);
283
SetCutValue
(
cutForPositron
,
"e+"
);
284
285
if
(
verboseLevel
>0)
DumpCutValuesTable
();
286
}
287
288
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
289
290
void
XrayFluoPhysicsList::SetCutForGamma
(
G4double
cut)
291
{
292
cutForGamma
= cut;
293
SetParticleCuts
(
cutForGamma
,
G4Gamma::Gamma
());
294
}
295
296
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
297
298
void
XrayFluoPhysicsList::SetCutForElectron
(
G4double
cut)
299
{
300
cutForElectron
= cut;
301
SetParticleCuts
(
cutForElectron
,
G4Electron::Electron
());
302
}
303
304
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
305
306
void
XrayFluoPhysicsList::SetCutForPositron
(
G4double
cut)
307
{
308
cutForPositron
= cut;
309
SetParticleCuts
(
cutForPositron
,
G4Positron::Positron
());
310
}
311
312
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
313
314
void
XrayFluoPhysicsList::SetCutForProton
(
G4double
cut)
315
{
316
cutForProton
= cut;
317
SetParticleCuts
(
cutForProton
,
G4Proton::Proton
());
318
}
319
320
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
321
322
//void XrayFluoPhysicsList::SetFluorescence(G4bool value)
323
//{
324
// G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
325
// if(de) { de->SetFluo(value); }
326
//}
327
328
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
329
330
//void XrayFluoPhysicsList::SetPIXE(G4bool value)
331
//{
332
// G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
333
// if(de) { de->SetPIXE(value); }
334
//}
335
336
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
advanced
xray_fluorescence
src
XrayFluoPhysicsList.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:01
using
1.8.2 with
ECCE GitHub integration