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
extended
electromagnetic
TestEm2
src
PhysicsList.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
//
28
//
29
// $Id$
30
//
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "PhysicsList.hh"
35
#include "PhysicsListMessenger.hh"
36
37
#include "PhysListEmStandard.hh"
38
39
#include "
G4EmStandardPhysics.hh
"
40
#include "
G4EmStandardPhysics_option1.hh
"
41
#include "
G4EmStandardPhysics_option2.hh
"
42
#include "
G4EmStandardPhysics_option3.hh
"
43
#include "
G4EmStandardPhysics_option4.hh
"
44
#include "
G4EmLivermorePhysics.hh
"
45
#include "
G4EmPenelopePhysics.hh
"
46
47
#include "
G4Decay.hh
"
48
#include "StepMax.hh"
49
50
#include "
G4LossTableManager.hh
"
51
#include "
G4ProcessManager.hh
"
52
53
#include "
G4UnitsTable.hh
"
54
#include "
G4SystemOfUnits.hh
"
55
56
// Bosons
57
#include "
G4ChargedGeantino.hh
"
58
#include "
G4Geantino.hh
"
59
#include "
G4Gamma.hh
"
60
61
// leptons
62
#include "
G4Electron.hh
"
63
#include "
G4Positron.hh
"
64
#include "
G4MuonPlus.hh
"
65
#include "
G4MuonMinus.hh
"
66
#include "
G4NeutrinoMu.hh
"
67
#include "
G4AntiNeutrinoMu.hh
"
68
69
#include "
G4Electron.hh
"
70
#include "
G4Positron.hh
"
71
#include "
G4NeutrinoE.hh
"
72
#include "
G4AntiNeutrinoE.hh
"
73
74
// Mesons
75
#include "
G4PionPlus.hh
"
76
#include "
G4PionMinus.hh
"
77
#include "
G4PionZero.hh
"
78
#include "
G4Eta.hh
"
79
#include "
G4EtaPrime.hh
"
80
81
#include "
G4KaonPlus.hh
"
82
#include "
G4KaonMinus.hh
"
83
#include "
G4KaonZero.hh
"
84
#include "
G4AntiKaonZero.hh
"
85
#include "
G4KaonZeroLong.hh
"
86
#include "
G4KaonZeroShort.hh
"
87
88
// Baryons
89
#include "
G4Proton.hh
"
90
#include "
G4AntiProton.hh
"
91
#include "
G4Neutron.hh
"
92
#include "
G4AntiNeutron.hh
"
93
94
// Nuclei
95
#include "
G4Alpha.hh
"
96
#include "
G4Deuteron.hh
"
97
#include "
G4Triton.hh
"
98
#include "
G4He3.hh
"
99
#include "
G4GenericIon.hh
"
100
101
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102
103
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
()
104
{
105
G4LossTableManager::Instance
();
106
defaultCutValue
= 1.*
mm
;
107
fCutForGamma =
defaultCutValue
;
108
fCutForElectron =
defaultCutValue
;
109
fCutForPositron =
defaultCutValue
;
110
111
fMessenger =
new
PhysicsListMessenger
(
this
);
112
113
SetVerboseLevel
(1);
114
115
// EM physics
118
fEmName =
"local"
;
119
fEmPhysicsList =
new
PhysListEmStandard
(fEmName);
120
}
121
122
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123
124
PhysicsList::~PhysicsList
()
125
{
126
delete
fMessenger;
127
delete
fEmPhysicsList;
128
}
129
130
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131
132
void
PhysicsList::ConstructParticle
()
133
{
134
// pseudo-particles
135
G4Geantino::GeantinoDefinition
();
136
G4ChargedGeantino::ChargedGeantinoDefinition
();
137
138
// gamma
139
G4Gamma::GammaDefinition
();
140
141
// leptons
142
G4Electron::ElectronDefinition
();
143
G4Positron::PositronDefinition
();
144
G4MuonPlus::MuonPlusDefinition
();
145
G4MuonMinus::MuonMinusDefinition
();
146
147
G4NeutrinoE::NeutrinoEDefinition
();
148
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
149
G4NeutrinoMu::NeutrinoMuDefinition
();
150
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
151
152
// mesons
153
G4PionPlus::PionPlusDefinition
();
154
G4PionMinus::PionMinusDefinition
();
155
G4PionZero::PionZeroDefinition
();
156
G4Eta::EtaDefinition
();
157
G4EtaPrime::EtaPrimeDefinition
();
158
G4KaonPlus::KaonPlusDefinition
();
159
G4KaonMinus::KaonMinusDefinition
();
160
G4KaonZero::KaonZeroDefinition
();
161
G4AntiKaonZero::AntiKaonZeroDefinition
();
162
G4KaonZeroLong::KaonZeroLongDefinition
();
163
G4KaonZeroShort::KaonZeroShortDefinition
();
164
165
// barions
166
G4Proton::ProtonDefinition
();
167
G4AntiProton::AntiProtonDefinition
();
168
G4Neutron::NeutronDefinition
();
169
G4AntiNeutron::AntiNeutronDefinition
();
170
171
// ions
172
G4Deuteron::DeuteronDefinition
();
173
G4Triton::TritonDefinition
();
174
G4He3::He3Definition
();
175
G4Alpha::AlphaDefinition
();
176
G4GenericIon::GenericIonDefinition
();
177
}
178
179
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180
181
void
PhysicsList::ConstructProcess
()
182
{
183
// transportation
184
//
185
AddTransportation
();
186
187
// electromagnetic physics list
188
//
189
fEmPhysicsList->
ConstructProcess
();
190
191
// decay process
192
//
193
AddDecay
();
194
195
// step limitation (as a full process)
196
//
197
AddStepMax
();
198
}
199
200
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
201
202
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
203
{
204
if
(
verboseLevel
>-1) {
205
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
206
}
207
208
if
(name == fEmName)
return
;
209
210
if
(name ==
"local"
) {
211
212
fEmName =
name
;
213
delete
fEmPhysicsList;
214
fEmPhysicsList =
new
PhysListEmStandard
(name);
215
216
}
else
if
(name ==
"emstandard_opt0"
) {
217
218
fEmName =
name
;
219
delete
fEmPhysicsList;
220
fEmPhysicsList =
new
G4EmStandardPhysics
();
221
222
}
else
if
(name ==
"emstandard_opt1"
) {
223
224
fEmName =
name
;
225
delete
fEmPhysicsList;
226
fEmPhysicsList =
new
G4EmStandardPhysics_option1
();
227
228
}
else
if
(name ==
"emstandard_opt2"
) {
229
230
fEmName =
name
;
231
delete
fEmPhysicsList;
232
fEmPhysicsList =
new
G4EmStandardPhysics_option2
();
233
234
}
else
if
(name ==
"emstandard_opt3"
) {
235
236
fEmName =
name
;
237
delete
fEmPhysicsList;
238
fEmPhysicsList =
new
G4EmStandardPhysics_option3
();
239
240
}
else
if
(name ==
"emstandard_opt4"
) {
241
242
fEmName =
name
;
243
delete
fEmPhysicsList;
244
fEmPhysicsList =
new
G4EmStandardPhysics_option4
();
245
246
}
else
if
(name ==
"empenelope"
){
247
fEmName =
name
;
248
delete
fEmPhysicsList;
249
fEmPhysicsList =
new
G4EmPenelopePhysics
();
250
251
}
else
if
(name ==
"emlivermore"
){
252
fEmName =
name
;
253
delete
fEmPhysicsList;
254
fEmPhysicsList =
new
G4EmLivermorePhysics
();
255
256
}
else
{
257
258
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
259
<<
" is not defined"
260
<<
G4endl
;
261
}
262
}
263
264
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
265
266
void
PhysicsList::AddDecay
()
267
{
268
// decay process
269
//
270
G4Decay
* fDecayProcess =
new
G4Decay
();
271
272
theParticleIterator
->
reset
();
273
while
( (*
theParticleIterator
)() ){
274
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
275
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
276
277
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
278
279
pmanager ->
AddProcess
(fDecayProcess);
280
281
// set ordering for PostStepDoIt and AtRestDoIt
282
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
283
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
284
285
}
286
}
287
}
288
289
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
290
291
void
PhysicsList::AddStepMax
()
292
{
293
// Step limitation seen as a process
294
StepMax
* stepMaxProcess =
new
StepMax
();
295
296
theParticleIterator
->
reset
();
297
while
((*
theParticleIterator
)()){
298
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
299
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
300
301
if
(stepMaxProcess->
IsApplicable
(*particle))
302
{
303
pmanager ->
AddDiscreteProcess
(stepMaxProcess);
304
}
305
}
306
}
307
308
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
309
310
void
PhysicsList::SetCuts
()
311
{
312
if
(
verboseLevel
>0) {
313
G4cout
<<
"PhysicsList::SetCuts:"
;
314
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
315
}
316
317
// set cut values for gamma at first and for e- second and next for e+,
318
// because some processes for e+/e- need cut values for gamma
319
SetCutValue
(fCutForGamma,
"gamma"
);
320
SetCutValue
(fCutForElectron,
"e-"
);
321
SetCutValue
(fCutForPositron,
"e+"
);
322
323
if
(
verboseLevel
>0)
DumpCutValuesTable
();
324
}
325
326
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
327
328
void
PhysicsList::SetCutForGamma
(
G4double
cut)
329
{
330
fCutForGamma = cut;
331
SetParticleCuts
(fCutForGamma,
G4Gamma::Gamma
());
332
}
333
334
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
335
336
void
PhysicsList::SetCutForElectron
(
G4double
cut)
337
{
338
fCutForElectron = cut;
339
SetParticleCuts
(fCutForElectron,
G4Electron::Electron
());
340
}
341
342
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
343
344
void
PhysicsList::SetCutForPositron
(
G4double
cut)
345
{
346
fCutForPositron = cut;
347
SetParticleCuts
(fCutForPositron,
G4Positron::Positron
());
348
}
349
350
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
351
Generated on Sat May 25 2013 14:31:57 for Geant4 by
1.8.4