Geant4
9.6.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
geant4_9_6_p02
examples
advanced
xray_fluorescence
src
XrayFluoPhysicsList.cc
Go to the documentation of this file.
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
theParticleIterator
->
reset
();
181
while
( (*
theParticleIterator
)() ){
182
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
183
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
184
185
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
186
187
pmanager ->
AddProcess
(fDecayProcess);
188
189
// set ordering for PostStepDoIt and AtRestDoIt
190
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
191
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
192
193
}
194
}
195
}
196
197
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198
199
void
XrayFluoPhysicsList::AddStepMax
()
200
{
201
// Step limitation seen as a process
202
XrayFluoStepMax
* stepMaxProcess =
new
XrayFluoStepMax
();
203
204
theParticleIterator
->
reset
();
205
while
((*
theParticleIterator
)()){
206
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
207
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
208
209
if
(stepMaxProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
())
210
{
211
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
212
}
213
}
214
}
215
216
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
217
218
void
XrayFluoPhysicsList::AddPhysicsList
(
const
G4String
&
name
)
219
{
220
if
(
verboseLevel
>-1) {
221
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
222
}
223
224
if
(name == emName)
return
;
225
226
if
(name ==
"emlivermore"
) {
227
228
emName =
name
;
229
delete
emPhysicsList;
230
emPhysicsList =
new
G4EmLivermorePhysics
;
231
232
}
else
if
(name ==
"emstandard"
) {
233
emName =
name
;
234
delete
emPhysicsList;
235
emPhysicsList =
new
G4EmStandardPhysics
();
236
237
}
else
if
(name ==
"emstandard_opt1"
) {
238
239
emName =
name
;
240
delete
emPhysicsList;
241
emPhysicsList =
new
G4EmStandardPhysics_option1
();
242
243
}
else
if
(name ==
"emstandard_opt2"
) {
244
245
emName =
name
;
246
delete
emPhysicsList;
247
emPhysicsList =
new
G4EmStandardPhysics_option2
();
248
249
}
else
if
(name ==
"emstandard_opt3"
) {
250
251
emName =
name
;
252
delete
emPhysicsList;
253
emPhysicsList =
new
G4EmStandardPhysics_option3
();
254
255
}
else
if
(name ==
"empenelope"
){
256
emName =
name
;
257
delete
emPhysicsList;
258
emPhysicsList =
new
G4EmPenelopePhysics
();
259
260
}
else
{
261
262
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
263
<<
" is not defined"
264
<<
G4endl
;
265
}
266
}
267
268
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
269
270
void
XrayFluoPhysicsList::SetCuts
()
271
{
272
if
(
verboseLevel
>0){
273
G4cout
<<
"PhysicsList::SetCuts:"
;
274
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
275
}
276
277
// set cut values for gamma at first and for e- second and next for e+,
278
// because some processes for e+/e- need cut values for gamma
279
SetCutValue
(cutForGamma,
"gamma"
);
280
SetCutValue
(cutForElectron,
"e-"
);
281
SetCutValue
(cutForPositron,
"e+"
);
282
283
if
(
verboseLevel
>0)
DumpCutValuesTable
();
284
}
285
286
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
287
288
void
XrayFluoPhysicsList::SetCutForGamma
(
G4double
cut)
289
{
290
cutForGamma = cut;
291
SetParticleCuts
(cutForGamma,
G4Gamma::Gamma
());
292
}
293
294
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
295
296
void
XrayFluoPhysicsList::SetCutForElectron
(
G4double
cut)
297
{
298
cutForElectron = cut;
299
SetParticleCuts
(cutForElectron,
G4Electron::Electron
());
300
}
301
302
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
303
304
void
XrayFluoPhysicsList::SetCutForPositron
(
G4double
cut)
305
{
306
cutForPositron = cut;
307
SetParticleCuts
(cutForPositron,
G4Positron::Positron
());
308
}
309
310
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
311
312
void
XrayFluoPhysicsList::SetCutForProton
(
G4double
cut)
313
{
314
cutForProton = cut;
315
SetParticleCuts
(cutForProton,
G4Proton::Proton
());
316
}
317
318
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319
320
//void XrayFluoPhysicsList::SetFluorescence(G4bool value)
321
//{
322
// G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
323
// if(de) { de->SetFluo(value); }
324
//}
325
326
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
327
328
//void XrayFluoPhysicsList::SetPIXE(G4bool value)
329
//{
330
// G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
331
// if(de) { de->SetPIXE(value); }
332
//}
333
334
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Generated on Sat May 25 2013 14:32:15 for Geant4 by
1.8.4