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