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
TestEm16
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 "
G4ParticleDefinition.hh
"
38
#include "
G4ProcessManager.hh
"
39
#include "
G4ParticleTypes.hh
"
40
#include "
G4ParticleTable.hh
"
41
42
#include "
G4ComptonScattering.hh
"
43
#include "
G4GammaConversion.hh
"
44
#include "
G4PhotoElectricEffect.hh
"
45
#include "
G4RayleighScattering.hh
"
46
47
#include "
G4eMultipleScattering.hh
"
48
#include "
G4eIonisation.hh
"
49
#include "
G4eBremsstrahlung.hh
"
50
#include "
G4eplusAnnihilation.hh
"
51
52
#include "
G4MuMultipleScattering.hh
"
53
#include "
G4MuIonisation.hh
"
54
#include "
G4MuBremsstrahlung.hh
"
55
#include "
G4MuPairProduction.hh
"
56
57
#include "
G4SynchrotronRadiation.hh
"
58
#include "
G4SynchrotronRadiationInMat.hh
"
59
60
#include "
G4StepLimiter.hh
"
61
62
#include "
G4SystemOfUnits.hh
"
63
64
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65
66
PhysicsList::PhysicsList
()
67
:
G4VUserPhysicsList
()
68
{
69
defaultCutValue
= 1.*
km
;
70
71
fSRType =
true
;
72
fMess =
new
PhysicsListMessenger
(
this
);
73
}
74
75
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
77
PhysicsList::~PhysicsList
()
78
{
79
delete
fMess;
80
}
81
82
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83
84
void
PhysicsList::ConstructParticle
()
85
{
86
// In this method, static member functions should be called
87
// for all particles which you want to use.
88
// This ensures that objects of these particle types will be
89
// created in the program.
90
91
ConstructBosons
();
92
ConstructLeptons
();
93
}
94
95
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96
97
void
PhysicsList::ConstructBosons
()
98
{
99
// pseudo-particles
100
G4Geantino::GeantinoDefinition
();
101
G4ChargedGeantino::ChargedGeantinoDefinition
();
102
103
// gamma
104
G4Gamma::GammaDefinition
();
105
}
106
107
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108
109
void
PhysicsList::ConstructLeptons
()
110
{
111
// leptons
112
G4Electron::ElectronDefinition
();
113
G4Positron::PositronDefinition
();
114
G4MuonPlus::MuonPlusDefinition
();
115
G4MuonMinus::MuonMinusDefinition
();
116
117
G4NeutrinoE::NeutrinoEDefinition
();
118
G4AntiNeutrinoE::AntiNeutrinoEDefinition
();
119
G4NeutrinoMu::NeutrinoMuDefinition
();
120
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition
();
121
}
122
123
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124
125
void
PhysicsList::ConstructProcess
()
126
{
127
AddTransportation
();
128
ConstructEM();
129
ConstructGeneral
();
130
}
131
132
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133
134
void
PhysicsList::ConstructEM()
135
{
136
theParticleIterator
->
reset
();
137
while
( (*
theParticleIterator
)() ){
138
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
139
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
140
G4String
particleName = particle->
GetParticleName
();
141
142
if
(particleName ==
"gamma"
) {
143
// gamma
144
pmanager->
AddDiscreteProcess
(
new
G4PhotoElectricEffect
);
145
pmanager->
AddDiscreteProcess
(
new
G4ComptonScattering
);
146
pmanager->
AddDiscreteProcess
(
new
G4GammaConversion
);
147
pmanager->
AddDiscreteProcess
(
new
G4RayleighScattering
);
148
149
}
else
if
(particleName ==
"e-"
) {
150
//electron
151
pmanager->
AddProcess
(
new
G4eMultipleScattering
, -1, 1, 1);
152
pmanager->
AddProcess
(
new
G4eIonisation
, -1, 2, 2);
153
pmanager->
AddProcess
(
new
G4eBremsstrahlung
, -1, 3, 3);
154
if
(fSRType) {
155
pmanager->
AddProcess
(
new
G4SynchrotronRadiation
, -1,-1, 4);
156
}
else
{
157
pmanager->
AddProcess
(
new
G4SynchrotronRadiationInMat
, -1,-1, 4);
158
}
159
pmanager->
AddProcess
(
new
G4StepLimiter
, -1,-1, 5);
160
161
}
else
if
(particleName ==
"e+"
) {
162
//positron
163
pmanager->
AddProcess
(
new
G4eMultipleScattering
, -1, 1, 1);
164
pmanager->
AddProcess
(
new
G4eIonisation
, -1, 2, 2);
165
pmanager->
AddProcess
(
new
G4eBremsstrahlung
, -1, 3, 3);
166
pmanager->
AddProcess
(
new
G4eplusAnnihilation
, 0,-1, 4);
167
if
(fSRType) {
168
pmanager->
AddProcess
(
new
G4SynchrotronRadiation
, -1,-1, 5);
169
}
else
{
170
pmanager->
AddProcess
(
new
G4SynchrotronRadiationInMat
, -1,-1, 5);
171
}
172
pmanager->
AddProcess
(
new
G4StepLimiter
, -1,-1, 6);
173
174
}
else
if
( particleName ==
"mu+"
||
175
particleName ==
"mu-"
) {
176
//muon
177
pmanager->
AddProcess
(
new
G4MuMultipleScattering
, -1, 1, 1);
178
pmanager->
AddProcess
(
new
G4MuIonisation
, -1, 2, 2);
179
pmanager->
AddProcess
(
new
G4MuBremsstrahlung
, -1, 3, 3);
180
pmanager->
AddProcess
(
new
G4MuPairProduction
, -1, 4, 4);
181
182
}
183
}
184
}
185
186
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
187
188
#include "
G4Decay.hh
"
189
190
void
PhysicsList::ConstructGeneral
()
191
{
192
// Add Decay Process
193
G4Decay
* theDecayProcess =
new
G4Decay
();
194
theParticleIterator
->
reset
();
195
while
((*
theParticleIterator
)()){
196
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
197
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
198
if
(theDecayProcess->
IsApplicable
(*particle)) {
199
pmanager ->
AddProcess
(theDecayProcess);
200
// set ordering for PostStepDoIt and AtRestDoIt
201
pmanager ->
SetProcessOrdering
(theDecayProcess,
idxPostStep
);
202
pmanager ->
SetProcessOrdering
(theDecayProcess,
idxAtRest
);
203
}
204
}
205
}
206
207
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
208
209
void
PhysicsList::SetCuts
()
210
{
211
if
(
verboseLevel
>0){
212
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
213
}
214
215
// set cut values for gamma at first and for e- second and next for e+,
216
// because some processes for e+/e- need cut values for gamma
217
SetCutValue
(
defaultCutValue
,
"gamma"
);
218
SetCutValue
(
defaultCutValue
,
"e-"
);
219
SetCutValue
(
defaultCutValue
,
"e+"
);
220
221
if
(
verboseLevel
>0)
DumpCutValuesTable
();
222
}
223
224
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Generated on Sat May 25 2013 14:31:57 for Geant4 by
1.8.4