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 "PhysListEmStandardSSM.hh"
40 #include "PhysListEmStandardGS.hh"
41 #include "PhysListEmStandardWVI.hh"
42 
43 #include "G4EmStandardPhysics.hh"
48 #include "G4EmLivermorePhysics.hh"
49 #include "G4EmPenelopePhysics.hh"
50 
51 #include "G4Decay.hh"
52 #include "StepMax.hh"
53 
54 #include "G4UnitsTable.hh"
55 #include "G4SystemOfUnits.hh"
56 
57 #include "G4ParticleDefinition.hh"
58 #include "G4ProcessManager.hh"
59 
60 // Bosons
61 #include "G4ChargedGeantino.hh"
62 #include "G4Geantino.hh"
63 #include "G4Gamma.hh"
64 #include "G4OpticalPhoton.hh"
65 
66 // leptons
67 #include "G4MuonPlus.hh"
68 #include "G4MuonMinus.hh"
69 #include "G4NeutrinoMu.hh"
70 #include "G4AntiNeutrinoMu.hh"
71 
72 #include "G4Electron.hh"
73 #include "G4Positron.hh"
74 #include "G4NeutrinoE.hh"
75 #include "G4AntiNeutrinoE.hh"
76 
77 // Hadrons
78 #include "G4MesonConstructor.hh"
79 #include "G4BaryonConstructor.hh"
80 #include "G4IonConstructor.hh"
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  fMessenger = new PhysicsListMessenger(this);
87 
88  // EM physics
89  fEmName = G4String("local");
90  fEmPhysicsList = new PhysListEmStandard(fEmName);
91 
92  defaultCutValue = 1.*mm;
93 
94  fCutForGamma = defaultCutValue;
95  fCutForElectron = defaultCutValue;
96  fCutForPositron = defaultCutValue;
97 
98  SetVerboseLevel(1);
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {
105  delete fEmPhysicsList;
106  delete fMessenger;
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112 {
113  // pseudo-particles
116 
117  // gamma
119 
120  // leptons
125 
130 
131  // mesons
132  G4MesonConstructor mConstructor;
133  mConstructor.ConstructParticle();
134 
135  // barions
136  G4BaryonConstructor bConstructor;
137  bConstructor.ConstructParticle();
138 
139  // ions
140  G4IonConstructor iConstructor;
141  iConstructor.ConstructParticle();
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 
147 {
149  fEmPhysicsList->ConstructProcess();
150  AddDecay();
151  AddStepMax();
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 
157 {
158  // Add Decay Process
159 
160  G4Decay* fDecayProcess = new G4Decay();
161 
163  while( (*theParticleIterator)() ){
165  G4ProcessManager* pmanager = particle->GetProcessManager();
166 
167  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
168 
169  pmanager ->AddProcess(fDecayProcess);
170 
171  // set ordering for PostStepDoIt and AtRestDoIt
172  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
173  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
174 
175  }
176  }
177 }
178 
179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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) && !particle->IsShortLived())
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 == "emstandard_opt4") {
239 
240  fEmName = name;
241  delete fEmPhysicsList;
242  fEmPhysicsList = new G4EmStandardPhysics_option4();
243 
244  } else if (name == "standardSS") {
245 
246  fEmName = name;
247  delete fEmPhysicsList;
248  fEmPhysicsList = new PhysListEmStandardSS(name);
249 
250  } else if (name == "standardSSM") {
251 
252  fEmName = name;
253  delete fEmPhysicsList;
254  fEmPhysicsList = new PhysListEmStandardSSM(name);
255 
256  } else if (name == "standardWVI") {
257 
258  fEmName = name;
259  delete fEmPhysicsList;
260  fEmPhysicsList = new PhysListEmStandardWVI(name);
261 
262  } else if (name == "standardGS") {
263 
264  fEmName = name;
265  delete fEmPhysicsList;
266  fEmPhysicsList = new PhysListEmStandardGS(name);
267 
268  } else if (name == "empenelope"){
269  fEmName = name;
270  delete fEmPhysicsList;
271  fEmPhysicsList = new G4EmPenelopePhysics();
272 
273  } else if (name == "emlivermore"){
274  fEmName = name;
275  delete fEmPhysicsList;
276  fEmPhysicsList = new G4EmLivermorePhysics();
277 
278  } else {
279 
280  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
281  << " is not defined"
282  << G4endl;
283  }
284 }
285 
286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
287 
289 {
290  if (verboseLevel >0) {
291  G4cout << "PhysicsList::SetCuts:";
292  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
293  }
294 
295  // set cut values for gamma at first and for e- second and next for e+,
296  // because some processes for e+/e- need cut values for gamma
297  SetCutValue(fCutForGamma, "gamma");
298  SetCutValue(fCutForElectron, "e-");
299  SetCutValue(fCutForPositron, "e+");
300 
302 }
303 
304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
305 
307 {
308  fCutForGamma = cut;
309  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
310 }
311 
312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
313 
315 {
316  fCutForElectron = cut;
317  SetParticleCuts(fCutForElectron, G4Electron::Electron());
318 }
319 
320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
321 
323 {
324  fCutForPositron = cut;
325  SetParticleCuts(fCutForPositron, G4Positron::Positron());
326 }
327 
328 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......