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 "PhysListEmStandardWVI.hh"
39 
40 #include "G4EmStandardPhysics.hh"
45 #include "G4EmLivermorePhysics.hh"
46 #include "G4EmPenelopePhysics.hh"
47 
48 #include "G4UnitsTable.hh"
49 #include "G4SystemOfUnits.hh"
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
54 {
55  fCurrentDefaultCut = 1.0*mm;
56  fCutForGamma = fCurrentDefaultCut;
57  fCutForElectron = fCurrentDefaultCut;
58  fCutForPositron = fCurrentDefaultCut;
59 
60  fMessenger = new PhysicsListMessenger(this);
61 
62  SetVerboseLevel(1);
63 
64  // EM physics
65  fEmName = G4String("local");
66  fEmPhysicsList = new PhysListEmStandard(fEmName);
67 
68 }
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71 
73 {
74  delete fMessenger;
75 }
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
79 // Bosons
80 #include "G4ChargedGeantino.hh"
81 #include "G4Geantino.hh"
82 #include "G4Gamma.hh"
83 #include "G4OpticalPhoton.hh"
84 
85 // leptons
86 #include "G4MuonPlus.hh"
87 #include "G4MuonMinus.hh"
88 #include "G4NeutrinoMu.hh"
89 #include "G4AntiNeutrinoMu.hh"
90 
91 #include "G4Electron.hh"
92 #include "G4Positron.hh"
93 #include "G4NeutrinoE.hh"
94 #include "G4AntiNeutrinoE.hh"
95 
96 // Mesons
97 #include "G4PionPlus.hh"
98 #include "G4PionMinus.hh"
99 #include "G4PionZero.hh"
100 #include "G4Eta.hh"
101 #include "G4EtaPrime.hh"
102 
103 #include "G4KaonPlus.hh"
104 #include "G4KaonMinus.hh"
105 #include "G4KaonZero.hh"
106 #include "G4AntiKaonZero.hh"
107 #include "G4KaonZeroLong.hh"
108 #include "G4KaonZeroShort.hh"
109 
110 // Baryons
111 #include "G4Proton.hh"
112 #include "G4AntiProton.hh"
113 #include "G4Neutron.hh"
114 #include "G4AntiNeutron.hh"
115 
116 // Nuclei
117 #include "G4Deuteron.hh"
118 #include "G4Triton.hh"
119 #include "G4Alpha.hh"
120 #include "G4GenericIon.hh"
121 
123 {
124 // pseudo-particles
127 
128 // gamma
130 
131 // optical photon
133 
134 // leptons
139 
144 
145 // mesons
157 
158 // barions
163 
164 // ions
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
173 #include "G4ProcessManager.hh"
174 #include "G4Decay.hh"
175 
177 {
179 
180  // electromagnetic Physics List
181  //
182  fEmPhysicsList->ConstructProcess();
183 
184  // Add Decay Process
185  //
186  G4Decay* fDecayProcess = new G4Decay();
187 
189  while( (*theParticleIterator)() ){
191  G4ProcessManager* pmanager = particle->GetProcessManager();
192 
193  if (fDecayProcess->IsApplicable(*particle)) {
194 
195  pmanager ->AddProcess(fDecayProcess);
196 
197  // set ordering for PostStepDoIt and AtRestDoIt
198  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
199  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
200 
201  }
202  }
203 
204  // stepLimitation (as a full process)
205  //
206  AddStepMax();
207 }
208 
209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
210 
212 {
213  if (verboseLevel>1) {
214  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
215  }
216 
217  if (name == fEmName) return;
218 
219  if (name == "local") {
220 
221  fEmName = name;
222  delete fEmPhysicsList;
223  fEmPhysicsList = new PhysListEmStandard(name);
224 
225  } else if (name == "emstandard_opt0") {
226 
227  fEmName = name;
228  delete fEmPhysicsList;
229  fEmPhysicsList = new G4EmStandardPhysics();
230 
231  } else if (name == "emstandard_opt1") {
232 
233  fEmName = name;
234  delete fEmPhysicsList;
235  fEmPhysicsList = new G4EmStandardPhysics_option1();
236 
237  } else if (name == "emstandard_opt2") {
238 
239  fEmName = name;
240  delete fEmPhysicsList;
241  fEmPhysicsList = new G4EmStandardPhysics_option2();
242 
243  } else if (name == "emstandard_opt3") {
244 
245  fEmName = name;
246  delete fEmPhysicsList;
247  fEmPhysicsList = new G4EmStandardPhysics_option3();
248 
249  } else if (name == "emstandard_opt4") {
250 
251  fEmName = name;
252  delete fEmPhysicsList;
253  fEmPhysicsList = new G4EmStandardPhysics_option4();
254 
255  } else if (name == "standardWVI") {
256 
257  fEmName = name;
258  delete fEmPhysicsList;
259  fEmPhysicsList = new PhysListEmStandardWVI(name);
260 
261  } else if (name == "emlivermore") {
262 
263  fEmName = name;
264  delete fEmPhysicsList;
265  fEmPhysicsList = new G4EmLivermorePhysics();
266 
267  } else if (name == "empenelope") {
268 
269  fEmName = name;
270  delete fEmPhysicsList;
271  fEmPhysicsList = new G4EmPenelopePhysics();
272 
273  } else {
274 
275  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
276  << " is not defined"
277  << G4endl;
278  }
279 }
280 
281 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
282 
283 #include "StepMax.hh"
284 
286 {
287  // Step limitation seen as a process
288  fStepMaxProcess = new StepMax();
289 
291  while ((*theParticleIterator)()){
293  G4ProcessManager* pmanager = particle->GetProcessManager();
294 
295  if (fStepMaxProcess->IsApplicable(*particle))
296  {
297  pmanager ->AddDiscreteProcess(fStepMaxProcess);
298  }
299  }
300 }
301 
302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
303 
305 {
306  if (verboseLevel >0) {
307  G4cout << "PhysicsList::SetCuts:";
308  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
309  }
310 
311  // set cut values for gamma at first and for e- second and next for e+,
312  // because some processes for e+/e- need cut values for gamma
313  SetCutValue(fCutForGamma, "gamma");
314  SetCutValue(fCutForElectron, "e-");
315  SetCutValue(fCutForPositron, "e+");
316 
317  // Cut for proton not used in EM processes except single scattering
318  // so electron cut is used in this example
319  SetCutValue(fCutForElectron, "proton");
320 
322 }
323 
324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
325 
327 {
328  fCutForGamma = cut;
329  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
330 }
331 
332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
333 
335 {
336  fCutForElectron = cut;
337  SetParticleCuts(fCutForElectron, G4Electron::Electron());
338 }
339 
340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
341 
343 {
344  fCutForPositron = cut;
345  SetParticleCuts(fCutForPositron, G4Positron::Positron());
346 }
347 
348 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
349