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
TestEm11
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
#include "PhysListEmStandardSS.hh"
39
40
#include "
G4EmStandardPhysics.hh
"
41
#include "
G4EmStandardPhysics_option1.hh
"
42
#include "
G4EmStandardPhysics_option2.hh
"
43
#include "
G4EmStandardPhysics_option3.hh
"
44
#include "
G4EmStandardPhysics_option4.hh
"
45
#include "
G4EmLivermorePhysics.hh
"
46
#include "
G4EmPenelopePhysics.hh
"
47
48
#include "
G4LossTableManager.hh
"
49
#include "
G4UnitsTable.hh
"
50
#include "
G4SystemOfUnits.hh
"
51
52
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
()
55
{
56
G4LossTableManager::Instance
();
57
defaultCutValue
= 1.*
mm
;
58
fCutForGamma =
defaultCutValue
;
59
fCutForElectron =
defaultCutValue
;
60
fCutForPositron =
defaultCutValue
;
61
62
fStepMaxProcess = 0;
63
64
fMessenger =
new
PhysicsListMessenger
(
this
);
65
66
SetVerboseLevel
(1);
67
68
// EM physics
69
fEmPhysicsList =
new
PhysListEmStandard
(fEmName =
"local"
);
70
71
}
72
73
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
75
PhysicsList::~PhysicsList
()
76
{
77
delete
fMessenger;
78
delete
fEmPhysicsList;
79
}
80
81
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82
83
// Bosons
84
#include "
G4ChargedGeantino.hh
"
85
#include "
G4Geantino.hh
"
86
#include "
G4Gamma.hh
"
87
#include "
G4OpticalPhoton.hh
"
88
89
// leptons
90
#include "
G4MuonPlus.hh
"
91
#include "
G4MuonMinus.hh
"
92
#include "
G4NeutrinoMu.hh
"
93
#include "
G4AntiNeutrinoMu.hh
"
94
95
#include "
G4Electron.hh
"
96
#include "
G4Positron.hh
"
97
#include "
G4NeutrinoE.hh
"
98
#include "
G4AntiNeutrinoE.hh
"
99
100
// Mesons
101
#include "
G4PionPlus.hh
"
102
#include "
G4PionMinus.hh
"
103
#include "
G4PionZero.hh
"
104
#include "
G4Eta.hh
"
105
#include "
G4EtaPrime.hh
"
106
107
#include "
G4KaonPlus.hh
"
108
#include "
G4KaonMinus.hh
"
109
#include "
G4KaonZero.hh
"
110
#include "
G4AntiKaonZero.hh
"
111
#include "
G4KaonZeroLong.hh
"
112
#include "
G4KaonZeroShort.hh
"
113
114
// Baryons
115
#include "
G4Proton.hh
"
116
#include "
G4AntiProton.hh
"
117
#include "
G4Neutron.hh
"
118
#include "
G4AntiNeutron.hh
"
119
120
// Nuclei
121
#include "
G4Alpha.hh
"
122
#include "
G4Deuteron.hh
"
123
#include "
G4Triton.hh
"
124
#include "
G4He3.hh
"
125
#include "
G4GenericIon.hh
"
126
127
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128
129
void
PhysicsList::ConstructParticle
()
130
{
131
// pseudo-particles
132
G4Geantino::GeantinoDefinition
();
133
G4ChargedGeantino::ChargedGeantinoDefinition
();
134
135
// gamma
136
G4Gamma::GammaDefinition
();
137
138
// optical photon
139
G4OpticalPhoton::OpticalPhotonDefinition
();
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
#include "
G4ProcessManager.hh
"
182
#include "
G4EmProcessOptions.hh
"
183
184
void
PhysicsList::ConstructProcess
()
185
{
186
// transportation
187
//
188
AddTransportation
();
189
190
// electromagnetic physics list
191
//
192
fEmPhysicsList->
ConstructProcess
();
193
194
// Em options
195
//
196
G4EmProcessOptions
emOptions;
197
emOptions.
SetBuildCSDARange
(
true
);
198
emOptions.
SetDEDXBinningForCSDARange
(8*10);
199
200
// decay process
201
//
202
AddDecay
();
203
204
// step limitation (as a full process)
205
//
206
AddStepMax
();
207
}
208
209
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
210
211
void
PhysicsList::AddPhysicsList
(
const
G4String
&
name
)
212
{
213
if
(
verboseLevel
>-1) {
214
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
<<
G4endl
;
215
}
216
217
if
(name == fEmName)
return
;
218
219
if
(name ==
"local"
) {
220
221
fEmName =
name
;
222
delete
fEmPhysicsList;
223
fEmPhysicsList =
new
PhysListEmStandard
(name);
224
225
}
else
if
(name ==
"emstandard_opt0"
) {
226
227
fEmName =
name
;
228
delete
fEmPhysicsList;
229
fEmPhysicsList =
new
G4EmStandardPhysics
();
230
231
}
else
if
(name ==
"emstandard_opt1"
) {
232
233
fEmName =
name
;
234
delete
fEmPhysicsList;
235
fEmPhysicsList =
new
G4EmStandardPhysics_option1
();
236
237
}
else
if
(name ==
"emstandard_opt2"
) {
238
239
fEmName =
name
;
240
delete
fEmPhysicsList;
241
fEmPhysicsList =
new
G4EmStandardPhysics_option2
();
242
243
}
else
if
(name ==
"emstandard_opt3"
) {
244
245
fEmName =
name
;
246
delete
fEmPhysicsList;
247
fEmPhysicsList =
new
G4EmStandardPhysics_option3
();
248
249
}
else
if
(name ==
"emstandard_opt4"
) {
250
251
fEmName =
name
;
252
delete
fEmPhysicsList;
253
fEmPhysicsList =
new
G4EmStandardPhysics_option4
();
254
255
}
else
if
(name ==
"standardSS"
) {
256
257
fEmName =
name
;
258
delete
fEmPhysicsList;
259
fEmPhysicsList =
new
PhysListEmStandardSS
(name);
260
261
}
else
if
(name ==
"emlivermore"
) {
262
fEmName =
name
;
263
delete
fEmPhysicsList;
264
fEmPhysicsList =
new
G4EmLivermorePhysics
();
265
266
}
else
if
(name ==
"empenelope"
) {
267
fEmName =
name
;
268
delete
fEmPhysicsList;
269
fEmPhysicsList =
new
G4EmPenelopePhysics
();
270
271
}
else
{
272
273
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
274
<<
" is not defined"
275
<<
G4endl
;
276
}
277
}
278
279
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
280
281
#include "
G4Decay.hh
"
282
283
void
PhysicsList::AddDecay
()
284
{
285
// decay process
286
//
287
G4Decay
* fDecayProcess =
new
G4Decay
();
288
289
theParticleIterator
->
reset
();
290
while
( (*
theParticleIterator
)() ){
291
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
292
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
293
294
if
(fDecayProcess->
IsApplicable
(*particle) && !particle->
IsShortLived
()) {
295
296
pmanager ->
AddProcess
(fDecayProcess);
297
298
// set ordering for PostStepDoIt and AtRestDoIt
299
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
300
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
301
302
}
303
}
304
}
305
306
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
307
308
#include "StepMax.hh"
309
310
void
PhysicsList::AddStepMax
()
311
{
312
// Step limitation seen as a process
313
fStepMaxProcess =
new
StepMax
();
314
315
theParticleIterator
->
reset
();
316
while
((*
theParticleIterator
)()){
317
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
318
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
319
320
if
(fStepMaxProcess->
IsApplicable
(*particle))
321
{
322
pmanager ->
AddDiscreteProcess
(fStepMaxProcess);
323
}
324
}
325
}
326
327
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
328
329
#include "
G4Gamma.hh
"
330
#include "
G4Electron.hh
"
331
#include "
G4Positron.hh
"
332
333
void
PhysicsList::SetCuts
()
334
{
335
if
(
verboseLevel
>0) {
336
G4cout
<<
"PhysicsList::SetCuts:"
;
337
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
338
}
339
340
// set cut values for gamma at first and for e- second and next for e+,
341
// because some processes for e+/e- need cut values for gamma
342
SetCutValue
(fCutForGamma,
"gamma"
);
343
SetCutValue
(fCutForElectron,
"e-"
);
344
SetCutValue
(fCutForPositron,
"e+"
);
345
346
if
(
verboseLevel
>0)
DumpCutValuesTable
();
347
}
348
349
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
350
351
void
PhysicsList::SetCutForGamma
(
G4double
cut)
352
{
353
fCutForGamma = cut;
354
SetParticleCuts
(fCutForGamma,
G4Gamma::Gamma
());
355
}
356
357
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
358
359
void
PhysicsList::SetCutForElectron
(
G4double
cut)
360
{
361
fCutForElectron = cut;
362
SetParticleCuts
(fCutForElectron,
G4Electron::Electron
());
363
}
364
365
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
366
367
void
PhysicsList::SetCutForPositron
(
G4double
cut)
368
{
369
fCutForPositron = cut;
370
SetParticleCuts
(fCutForPositron,
G4Positron::Positron
());
371
}
372
373
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
374
Generated on Sat May 25 2013 14:31:57 for Geant4 by
1.8.4