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