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
TestEm3
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 "PhysListEmStandardWVI.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 "
G4UnitsTable.hh
"
49
#include "
G4SystemOfUnits.hh
"
50
51
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52
53
PhysicsList::PhysicsList
() :
G4VModularPhysicsList
()
54
{
55
fCurrentDefaultCut = 1.0*
mm
;
56
fCutForGamma = fCurrentDefaultCut;
57
fCutForElectron = fCurrentDefaultCut;
58
fCutForPositron = fCurrentDefaultCut;
59
60
fMessenger =
new
PhysicsListMessenger
(
this
);
61
62
SetVerboseLevel
(1);
63
64
// EM physics
65
fEmName =
G4String
(
"local"
);
66
fEmPhysicsList =
new
PhysListEmStandard
(fEmName);
67
68
}
69
70
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71
72
PhysicsList::~PhysicsList
()
73
{
74
delete
fMessenger;
75
}
76
77
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79
// Bosons
80
#include "
G4ChargedGeantino.hh
"
81
#include "
G4Geantino.hh
"
82
#include "
G4Gamma.hh
"
83
#include "
G4OpticalPhoton.hh
"
84
85
// leptons
86
#include "
G4MuonPlus.hh
"
87
#include "
G4MuonMinus.hh
"
88
#include "
G4NeutrinoMu.hh
"
89
#include "
G4AntiNeutrinoMu.hh
"
90
91
#include "
G4Electron.hh
"
92
#include "
G4Positron.hh
"
93
#include "
G4NeutrinoE.hh
"
94
#include "
G4AntiNeutrinoE.hh
"
95
96
// Mesons
97
#include "
G4PionPlus.hh
"
98
#include "
G4PionMinus.hh
"
99
#include "
G4PionZero.hh
"
100
#include "
G4Eta.hh
"
101
#include "
G4EtaPrime.hh
"
102
103
#include "
G4KaonPlus.hh
"
104
#include "
G4KaonMinus.hh
"
105
#include "
G4KaonZero.hh
"
106
#include "
G4AntiKaonZero.hh
"
107
#include "
G4KaonZeroLong.hh
"
108
#include "
G4KaonZeroShort.hh
"
109
110
// Baryons
111
#include "
G4Proton.hh
"
112
#include "
G4AntiProton.hh
"
113
#include "
G4Neutron.hh
"
114
#include "
G4AntiNeutron.hh
"
115
116
// Nuclei
117
#include "
G4Deuteron.hh
"
118
#include "
G4Triton.hh
"
119
#include "
G4Alpha.hh
"
120
#include "
G4GenericIon.hh
"
121
122
void
PhysicsList::ConstructParticle
()
123
{
124
// pseudo-particles
125
G4Geantino::GeantinoDefinition
();
126
G4ChargedGeantino::ChargedGeantinoDefinition
();
127
128
// gamma
129
G4Gamma::GammaDefinition
();
130
131
// optical photon
132
G4OpticalPhoton::OpticalPhotonDefinition
();
133
134
// leptons
135
G4Electron::ElectronDefinition
();
136
G4Positron::PositronDefinition
();
137
G4MuonPlus::MuonPlusDefinition
();
138
G4MuonMinus::MuonMinusDefinition
();
139
140
G4NeutrinoE::NeutrinoEDefinition
();
141
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
142
G4NeutrinoMu::NeutrinoMuDefinition
();
143
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
144
145
// mesons
146
G4PionPlus::PionPlusDefinition
();
147
G4PionMinus::PionMinusDefinition
();
148
G4PionZero::PionZeroDefinition
();
149
G4Eta::EtaDefinition
();
150
G4EtaPrime::EtaPrimeDefinition
();
151
G4KaonPlus::KaonPlusDefinition
();
152
G4KaonMinus::KaonMinusDefinition
();
153
G4KaonZero::KaonZeroDefinition
();
154
G4AntiKaonZero::AntiKaonZeroDefinition
();
155
G4KaonZeroLong::KaonZeroLongDefinition
();
156
G4KaonZeroShort::KaonZeroShortDefinition
();
157
158
// barions
159
G4Proton::ProtonDefinition
();
160
G4AntiProton::AntiProtonDefinition
();
161
G4Neutron::NeutronDefinition
();
162
G4AntiNeutron::AntiNeutronDefinition
();
163
164
// ions
165
G4Deuteron::DeuteronDefinition
();
166
G4Triton::TritonDefinition
();
167
G4Alpha::AlphaDefinition
();
168
G4GenericIon::GenericIonDefinition
();
169
}
170
171
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172
173
#include "
G4ProcessManager.hh
"
174
#include "
G4Decay.hh
"
175
176
void
PhysicsList::ConstructProcess
()
177
{
178
AddTransportation
();
179
180
// electromagnetic Physics List
181
//
182
fEmPhysicsList->
ConstructProcess
();
183
184
// Add Decay Process
185
//
186
G4Decay
* fDecayProcess =
new
G4Decay
();
187
188
theParticleIterator
->
reset
();
189
while
( (*
theParticleIterator
)() ){
190
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
191
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
192
193
if
(fDecayProcess->
IsApplicable
(*particle)) {
194
195
pmanager ->
AddProcess
(fDecayProcess);
196
197
// set ordering for PostStepDoIt and AtRestDoIt
198
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxPostStep
);
199
pmanager ->
SetProcessOrdering
(fDecayProcess,
idxAtRest
);
200
201
}
202
}
203
204
// stepLimitation (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 ==
"standardWVI"
) {
256
257
fEmName =
name
;
258
delete
fEmPhysicsList;
259
fEmPhysicsList =
new
PhysListEmStandardWVI
(name);
260
261
}
else
if
(name ==
"emlivermore"
) {
262
263
fEmName =
name
;
264
delete
fEmPhysicsList;
265
fEmPhysicsList =
new
G4EmLivermorePhysics
();
266
267
}
else
if
(name ==
"empenelope"
) {
268
269
fEmName =
name
;
270
delete
fEmPhysicsList;
271
fEmPhysicsList =
new
G4EmPenelopePhysics
();
272
273
}
else
{
274
275
G4cout
<<
"PhysicsList::AddPhysicsList: <"
<< name <<
">"
276
<<
" is not defined"
277
<<
G4endl
;
278
}
279
}
280
281
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
282
283
#include "StepMax.hh"
284
285
void
PhysicsList::AddStepMax
()
286
{
287
// Step limitation seen as a process
288
fStepMaxProcess =
new
StepMax
();
289
290
theParticleIterator
->
reset
();
291
while
((*
theParticleIterator
)()){
292
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
293
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
294
295
if
(fStepMaxProcess->
IsApplicable
(*particle))
296
{
297
pmanager ->
AddDiscreteProcess
(fStepMaxProcess);
298
}
299
}
300
}
301
302
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
303
304
void
PhysicsList::SetCuts
()
305
{
306
if
(
verboseLevel
>0) {
307
G4cout
<<
"PhysicsList::SetCuts:"
;
308
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
309
}
310
311
// set cut values for gamma at first and for e- second and next for e+,
312
// because some processes for e+/e- need cut values for gamma
313
SetCutValue
(fCutForGamma,
"gamma"
);
314
SetCutValue
(fCutForElectron,
"e-"
);
315
SetCutValue
(fCutForPositron,
"e+"
);
316
317
// Cut for proton not used in EM processes except single scattering
318
// so electron cut is used in this example
319
SetCutValue
(fCutForElectron,
"proton"
);
320
321
if
(
verboseLevel
>0)
DumpCutValuesTable
();
322
}
323
324
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
325
326
void
PhysicsList::SetCutForGamma
(
G4double
cut)
327
{
328
fCutForGamma = cut;
329
SetParticleCuts
(fCutForGamma,
G4Gamma::Gamma
());
330
}
331
332
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
333
334
void
PhysicsList::SetCutForElectron
(
G4double
cut)
335
{
336
fCutForElectron = cut;
337
SetParticleCuts
(fCutForElectron,
G4Electron::Electron
());
338
}
339
340
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
341
342
void
PhysicsList::SetCutForPositron
(
G4double
cut)
343
{
344
fCutForPositron = cut;
345
SetParticleCuts
(fCutForPositron,
G4Positron::Positron
());
346
}
347
348
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
349
Generated on Sat May 25 2013 14:31:57 for Geant4 by
1.8.4