Geant4  10.00.p01
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: PhysicsList.cc 68393 2013-03-25 14:22:21Z maire $
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 "PhysListEmStandardGS.hh"
40 #include "PhysListEmStandardWVI.hh"
41 
42 #include "G4EmStandardPhysics.hh"
46 
47 #include "G4UnitsTable.hh"
48 
49 #include "G4ParticleDefinition.hh"
50 #include "G4ProcessManager.hh"
51 
52 // Bosons
53 #include "G4ChargedGeantino.hh"
54 #include "G4Geantino.hh"
55 #include "G4Gamma.hh"
56 #include "G4OpticalPhoton.hh"
57 
58 // leptons
59 #include "G4MuonPlus.hh"
60 #include "G4MuonMinus.hh"
61 #include "G4NeutrinoMu.hh"
62 #include "G4AntiNeutrinoMu.hh"
63 
64 #include "G4Electron.hh"
65 #include "G4Positron.hh"
66 #include "G4NeutrinoE.hh"
67 #include "G4AntiNeutrinoE.hh"
68 
69 // Hadrons
70 #include "G4MesonConstructor.hh"
71 #include "G4BaryonConstructor.hh"
72 #include "G4IonConstructor.hh"
73 
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79  fMessenger(0), fEmName("local"), fEmPhysicsList(0)
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  // EM physics
84  fEmName = G4String("local");
86 
87  defaultCutValue = 1.*mm;
91 
92  SetVerboseLevel(1);
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  delete fEmPhysicsList;
100  delete fMessenger;
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104 
106 {
107 // pseudo-particles
110 
111 // gamma
113 
114 // optical photon
116 
117 // leptons
122 
127 
128 // mesons
129  G4MesonConstructor mConstructor;
130  mConstructor.ConstructParticle();
131 
132 // barions
133  G4BaryonConstructor bConstructor;
134  bConstructor.ConstructParticle();
135 
136 // ions
137  G4IonConstructor iConstructor;
138  iConstructor.ConstructParticle();
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144 {
147  AddDecay();
148  AddStepMax();
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
153 #include "G4Decay.hh"
154 
156 {
157  // Add Decay Process
158 
159  G4Decay* fDecayProcess = new G4Decay();
160 
161  theParticleIterator->reset();
162  while( (*theParticleIterator)() ){
163  G4ParticleDefinition* particle = theParticleIterator->value();
164  G4ProcessManager* pmanager = particle->GetProcessManager();
165 
166  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
167 
168  pmanager ->AddProcess(fDecayProcess);
169 
170  // set ordering for PostStepDoIt and AtRestDoIt
171  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
172  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
173 
174  }
175  }
176 }
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
179 
180 #include "StepMax.hh"
181 
183 {
184  // Step limitation seen as a process
185  StepMax* stepMaxProcess = new StepMax();
186 
187  theParticleIterator->reset();
188  while ((*theParticleIterator)()){
189  G4ParticleDefinition* particle = theParticleIterator->value();
190  G4ProcessManager* pmanager = particle->GetProcessManager();
191 
192  if (stepMaxProcess->IsApplicable(*particle))
193  {
194  pmanager ->AddDiscreteProcess(stepMaxProcess);
195  }
196  }
197 }
198 
199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
200 
202 {
203  if (verboseLevel>-1) {
204  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
205  }
206 
207  if (name == fEmName) return;
208 
209  if (name == "local") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emstandard_opt0") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "emstandard_opt1") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "emstandard_opt2") {
228 
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else if (name == "emstandard_opt3") {
234 
235  fEmName = name;
236  delete fEmPhysicsList;
238 
239  } else if (name == "standardSS") {
240 
241  fEmName = name;
242  delete fEmPhysicsList;
244 
245  } else if (name == "standardGS") {
246 
247  fEmName = name;
248  delete fEmPhysicsList;
250 
251  } else if (name == "standardWVI") {
252 
253  fEmName = name;
254  delete fEmPhysicsList;
256 
257  } else {
258 
259  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
260  << " is not defined"
261  << G4endl;
262  }
263 }
264 
265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
266 
268 {
269 
270  if (verboseLevel >0){
271  G4cout << "PhysicsList::SetCuts:";
272  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
273  }
274 
275  // set cut values for gamma at first and for e- second and next for e+,
276  // because some processes for e+/e- need cut values for gamma
277  SetCutValue(fCutForGamma, "gamma");
280 
282 }
283 
284 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
285 
287 {
288  fCutForGamma = cut;
290 }
291 
292 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
293 
295 {
296  fCutForElectron = cut;
298 }
299 
300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
301 
303 {
304  fCutForPositron = cut;
306 }
307 
308 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
309 
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
void SetCutValue(G4double aCut, const G4String &pname)
void SetCutForGamma(G4double)
Definition: PhysicsList.cc:231
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4String name
Definition: TRTMaterials.hh:40
G4double fCutForPositron
Definition: PhysicsList.hh:70
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void SetCutForPositron(G4double)
Definition: PhysicsList.cc:247
G4double fCutForElectron
Definition: PhysicsList.hh:69
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
void SetCutForElectron(G4double)
Definition: PhysicsList.cc:239
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4double fCutForGamma
Definition: PhysicsList.hh:64
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4Positron * Positron()
Definition: G4Positron.cc:94
void AddDecay()
Definition: PhysicsList.cc:290
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
double G4double
Definition: G4Types.hh:76
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static const double mm
Definition: G4SIunits.hh:102
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81