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
analysis
N03Con
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
//
30
// $Id$
31
//
32
//
33
34
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36
37
#include "PhysicsList.hh"
38
39
#include "
G4ProcessManager.hh
"
40
41
#include "
G4BosonConstructor.hh
"
42
#include "
G4LeptonConstructor.hh
"
43
#include "
G4MesonConstructor.hh
"
44
#include "
G4BosonConstructor.hh
"
45
#include "
G4BaryonConstructor.hh
"
46
#include "
G4IonConstructor.hh
"
47
#include "
G4SystemOfUnits.hh
"
48
49
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50
51
PhysicsList::PhysicsList
():
G4VUserPhysicsList
()
52
{
53
defaultCutValue
= 1.0*
mm
;
54
SetVerboseLevel
(1);
55
}
56
57
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58
59
PhysicsList::~PhysicsList
()
60
{}
61
62
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63
64
void
PhysicsList::ConstructParticle
()
65
{
66
// In this method, static member functions should be called
67
// for all particles which you want to use.
68
// This ensures that objects of these particle types will be
69
// created in the program.
70
71
G4BosonConstructor
pBosonConstructor;
72
pBosonConstructor.
ConstructParticle
();
73
74
G4LeptonConstructor
pLeptonConstructor;
75
pLeptonConstructor.
ConstructParticle
();
76
77
G4MesonConstructor
pMesonConstructor;
78
pMesonConstructor.
ConstructParticle
();
79
80
G4BaryonConstructor
pBaryonConstructor;
81
pBaryonConstructor.
ConstructParticle
();
82
83
G4IonConstructor
pIonConstructor;
84
pIonConstructor.
ConstructParticle
();
85
}
86
87
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88
89
void
PhysicsList::ConstructProcess
()
90
{
91
AddTransportation
();
92
ConstructEM();
93
ConstructDecay();
94
}
95
96
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97
98
#include "
G4ComptonScattering.hh
"
99
#include "
G4GammaConversion.hh
"
100
#include "
G4PhotoElectricEffect.hh
"
101
102
#include "
G4eMultipleScattering.hh
"
103
#include "
G4eIonisation.hh
"
104
#include "
G4eBremsstrahlung.hh
"
105
#include "
G4eplusAnnihilation.hh
"
106
107
#include "
G4MuMultipleScattering.hh
"
108
#include "
G4MuIonisation.hh
"
109
#include "
G4MuBremsstrahlung.hh
"
110
#include "
G4MuPairProduction.hh
"
111
112
#include "
G4hMultipleScattering.hh
"
113
#include "
G4hIonisation.hh
"
114
#include "
G4hBremsstrahlung.hh
"
115
#include "
G4hPairProduction.hh
"
116
117
#include "
G4ionIonisation.hh
"
118
119
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120
121
void
PhysicsList::ConstructEM()
122
{
123
theParticleIterator
->
reset
();
124
while
( (*
theParticleIterator
)() ){
125
G4ParticleDefinition
* particle =
theParticleIterator
->
value
();
126
G4ProcessManager
* pmanager = particle->
GetProcessManager
();
127
G4String
particleName = particle->
GetParticleName
();
128
129
if
(particleName ==
"gamma"
) {
130
// gamma
131
pmanager->
AddDiscreteProcess
(
new
G4PhotoElectricEffect
);
132
pmanager->
AddDiscreteProcess
(
new
G4ComptonScattering
);
133
pmanager->
AddDiscreteProcess
(
new
G4GammaConversion
);
134
135
}
else
if
(particleName ==
"e-"
) {
136
//electron
137
pmanager->
AddProcess
(
new
G4eMultipleScattering
,-1, 1, 1);
138
pmanager->
AddProcess
(
new
G4eIonisation
, -1, 2, 2);
139
pmanager->
AddProcess
(
new
G4eBremsstrahlung
, -1, 3, 3);
140
141
}
else
if
(particleName ==
"e+"
) {
142
//positron
143
pmanager->
AddProcess
(
new
G4eMultipleScattering
,-1, 1, 1);
144
pmanager->
AddProcess
(
new
G4eIonisation
, -1, 2, 2);
145
pmanager->
AddProcess
(
new
G4eBremsstrahlung
, -1, 3, 3);
146
pmanager->
AddProcess
(
new
G4eplusAnnihilation
, 0,-1, 4);
147
148
}
else
if
( particleName ==
"mu+"
||
149
particleName ==
"mu-"
) {
150
//muon
151
pmanager->
AddProcess
(
new
G4MuMultipleScattering
,-1, 1, 1);
152
pmanager->
AddProcess
(
new
G4MuIonisation
, -1, 2, 2);
153
pmanager->
AddProcess
(
new
G4MuBremsstrahlung
, -1, 3, 3);
154
pmanager->
AddProcess
(
new
G4MuPairProduction
, -1, 4, 4);
155
156
}
else
if
( particleName ==
"proton"
||
157
particleName ==
"pi-"
||
158
particleName ==
"pi+"
) {
159
//proton
160
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
161
pmanager->
AddProcess
(
new
G4hIonisation
, -1, 2, 2);
162
pmanager->
AddProcess
(
new
G4hBremsstrahlung
, -1, 3, 3);
163
pmanager->
AddProcess
(
new
G4hPairProduction
, -1, 4, 4);
164
165
}
else
if
( particleName ==
"alpha"
||
166
particleName ==
"He3"
) {
167
//alpha
168
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
169
pmanager->
AddProcess
(
new
G4ionIonisation
, -1, 2, 2);
170
171
}
else
if
( particleName ==
"GenericIon"
) {
172
//Ions
173
pmanager->
AddProcess
(
new
G4hMultipleScattering
, -1, 1, 1);
174
pmanager->
AddProcess
(
new
G4ionIonisation
, -1, 2, 2);
175
176
}
else
if
((!particle->
IsShortLived
()) &&
177
(particle->
GetPDGCharge
() != 0.0) &&
178
(particle->
GetParticleName
() !=
"chargedgeantino"
)) {
179
//all others charged particles except geantino
180
pmanager->
AddProcess
(
new
G4hMultipleScattering
,-1, 1, 1);
181
pmanager->
AddProcess
(
new
G4hIonisation
, -1, 2, 2);
182
}
183
}
184
}
185
186
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
187
188
#include "
G4Decay.hh
"
189
190
void
PhysicsList::ConstructDecay()
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
<<
"PhysicsList::SetCuts:"
;
213
G4cout
<<
"CutLength : "
<<
G4BestUnit
(
defaultCutValue
,
"Length"
) <<
G4endl
;
214
}
215
216
// set cut values for gamma at first and for e- second and next for e+,
217
// because some processes for e+/e- need cut values for gamma
218
//
219
SetCutValue
(
defaultCutValue
,
"gamma"
);
220
SetCutValue
(
defaultCutValue
,
"e-"
);
221
SetCutValue
(
defaultCutValue
,
"e+"
);
222
SetCutValue
(
defaultCutValue
,
"proton"
);
223
224
if
(
verboseLevel
>0)
DumpCutValuesTable
();
225
}
226
227
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
228
Generated on Sat May 25 2013 14:31:57 for Geant4 by
1.8.4