Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 "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 {
80  fMessenger = new PhysicsListMessenger(this);
81 
82  // EM physics
83  fEmName = G4String("local");
84  fEmPhysicsList = new PhysListEmStandard(fEmName);
85 
86  defaultCutValue = 1.*mm;
87  fCutForGamma = defaultCutValue;
88  fCutForElectron = defaultCutValue;
89  fCutForPositron = defaultCutValue;
90 
91  SetVerboseLevel(1);
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 
97 {
98  delete fEmPhysicsList;
99  delete fMessenger;
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
105 {
106 // pseudo-particles
109 
110 // gamma
112 
113 // optical photon
115 
116 // leptons
121 
126 
127 // mesons
128  G4MesonConstructor mConstructor;
129  mConstructor.ConstructParticle();
130 
131 // barions
132  G4BaryonConstructor bConstructor;
133  bConstructor.ConstructParticle();
134 
135 // ions
136  G4IonConstructor iConstructor;
137  iConstructor.ConstructParticle();
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141 
143 {
145  fEmPhysicsList->ConstructProcess();
146  AddDecay();
147  AddStepMax();
148 }
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151 
152 #include "G4Decay.hh"
153 
155 {
156  // Add Decay Process
157 
158  G4Decay* fDecayProcess = new G4Decay();
159 
161  while( (*theParticleIterator)() ){
163  G4ProcessManager* pmanager = particle->GetProcessManager();
164 
165  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
166 
167  pmanager ->AddProcess(fDecayProcess);
168 
169  // set ordering for PostStepDoIt and AtRestDoIt
170  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
171  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
172 
173  }
174  }
175 }
176 
177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
178 
179 #include "StepMax.hh"
180 
182 {
183  // Step limitation seen as a process
184  StepMax* stepMaxProcess = new StepMax();
185 
187  while ((*theParticleIterator)()){
189  G4ProcessManager* pmanager = particle->GetProcessManager();
190 
191  if (stepMaxProcess->IsApplicable(*particle))
192  {
193  pmanager ->AddDiscreteProcess(stepMaxProcess);
194  }
195  }
196 }
197 
198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
199 
201 {
202  if (verboseLevel>-1) {
203  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
204  }
205 
206  if (name == fEmName) return;
207 
208  if (name == "local") {
209 
210  fEmName = name;
211  delete fEmPhysicsList;
212  fEmPhysicsList = new PhysListEmStandard(name);
213 
214  } else if (name == "emstandard_opt0") {
215 
216  fEmName = name;
217  delete fEmPhysicsList;
218  fEmPhysicsList = new G4EmStandardPhysics();
219 
220  } else if (name == "emstandard_opt1") {
221 
222  fEmName = name;
223  delete fEmPhysicsList;
224  fEmPhysicsList = new G4EmStandardPhysics_option1();
225 
226  } else if (name == "emstandard_opt2") {
227 
228  fEmName = name;
229  delete fEmPhysicsList;
230  fEmPhysicsList = new G4EmStandardPhysics_option2();
231 
232  } else if (name == "emstandard_opt3") {
233 
234  fEmName = name;
235  delete fEmPhysicsList;
236  fEmPhysicsList = new G4EmStandardPhysics_option3();
237 
238  } else if (name == "standardSS") {
239 
240  fEmName = name;
241  delete fEmPhysicsList;
242  fEmPhysicsList = new PhysListEmStandardSS(name);
243 
244  } else if (name == "standardGS") {
245 
246  fEmName = name;
247  delete fEmPhysicsList;
248  fEmPhysicsList = new PhysListEmStandardGS(name);
249 
250  } else if (name == "standardWVI") {
251 
252  fEmName = name;
253  delete fEmPhysicsList;
254  fEmPhysicsList = new PhysListEmStandardWVI(name);
255 
256  } else {
257 
258  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
259  << " is not defined"
260  << G4endl;
261  }
262 }
263 
264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
265 
267 {
268 
269  if (verboseLevel >0){
270  G4cout << "PhysicsList::SetCuts:";
271  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
272  }
273 
274  // set cut values for gamma at first and for e- second and next for e+,
275  // because some processes for e+/e- need cut values for gamma
276  SetCutValue(fCutForGamma, "gamma");
277  SetCutValue(fCutForElectron, "e-");
278  SetCutValue(fCutForPositron, "e+");
279 
281 }
282 
283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284 
286 {
287  fCutForGamma = cut;
288  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
289 }
290 
291 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
292 
294 {
295  fCutForElectron = cut;
296  SetParticleCuts(fCutForElectron, G4Electron::Electron());
297 }
298 
299 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
300 
302 {
303  fCutForPositron = cut;
304  SetParticleCuts(fCutForPositron, G4Positron::Positron());
305 }
306 
307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
308