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 
40 #include "G4EmStandardPhysics.hh"
45 #include "G4EmLivermorePhysics.hh"
46 #include "G4EmPenelopePhysics.hh"
47 
48 #include "G4LossTableManager.hh"
49 #include "G4UnitsTable.hh"
50 #include "G4SystemOfUnits.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 {
57  defaultCutValue = 1.*mm;
58  fCutForGamma = defaultCutValue;
59  fCutForElectron = defaultCutValue;
60  fCutForPositron = defaultCutValue;
61 
62  fStepMaxProcess = 0;
63 
64  fMessenger = new PhysicsListMessenger(this);
65 
66  SetVerboseLevel(1);
67 
68  // EM physics
69  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
70 
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76 {
77  delete fMessenger;
78  delete fEmPhysicsList;
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
83 // Bosons
84 #include "G4ChargedGeantino.hh"
85 #include "G4Geantino.hh"
86 #include "G4Gamma.hh"
87 #include "G4OpticalPhoton.hh"
88 
89 // leptons
90 #include "G4MuonPlus.hh"
91 #include "G4MuonMinus.hh"
92 #include "G4NeutrinoMu.hh"
93 #include "G4AntiNeutrinoMu.hh"
94 
95 #include "G4Electron.hh"
96 #include "G4Positron.hh"
97 #include "G4NeutrinoE.hh"
98 #include "G4AntiNeutrinoE.hh"
99 
100 // Mesons
101 #include "G4PionPlus.hh"
102 #include "G4PionMinus.hh"
103 #include "G4PionZero.hh"
104 #include "G4Eta.hh"
105 #include "G4EtaPrime.hh"
106 
107 #include "G4KaonPlus.hh"
108 #include "G4KaonMinus.hh"
109 #include "G4KaonZero.hh"
110 #include "G4AntiKaonZero.hh"
111 #include "G4KaonZeroLong.hh"
112 #include "G4KaonZeroShort.hh"
113 
114 // Baryons
115 #include "G4Proton.hh"
116 #include "G4AntiProton.hh"
117 #include "G4Neutron.hh"
118 #include "G4AntiNeutron.hh"
119 
120 // Nuclei
121 #include "G4Alpha.hh"
122 #include "G4Deuteron.hh"
123 #include "G4Triton.hh"
124 #include "G4He3.hh"
125 #include "G4GenericIon.hh"
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128 
130 {
131 // pseudo-particles
134 
135 // gamma
137 
138 // optical photon
140 
141 // leptons
146 
151 
152 // mesons
164 
165 // barions
170 
171 // ions
177 }
178 
179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180 
181 #include "G4ProcessManager.hh"
182 #include "G4EmProcessOptions.hh"
183 
185 {
186  // transportation
187  //
189 
190  // electromagnetic physics list
191  //
192  fEmPhysicsList->ConstructProcess();
193 
194  // Em options
195  //
196  G4EmProcessOptions emOptions;
197  emOptions.SetBuildCSDARange(true);
198  emOptions.SetDEDXBinningForCSDARange(8*10);
199 
200  // decay process
201  //
202  AddDecay();
203 
204  // step limitation (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 == "standardSS") {
256 
257  fEmName = name;
258  delete fEmPhysicsList;
259  fEmPhysicsList = new PhysListEmStandardSS(name);
260 
261  } else if (name == "emlivermore") {
262  fEmName = name;
263  delete fEmPhysicsList;
264  fEmPhysicsList = new G4EmLivermorePhysics();
265 
266  } else if (name == "empenelope") {
267  fEmName = name;
268  delete fEmPhysicsList;
269  fEmPhysicsList = new G4EmPenelopePhysics();
270 
271  } else {
272 
273  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
274  << " is not defined"
275  << G4endl;
276  }
277 }
278 
279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
280 
281 #include "G4Decay.hh"
282 
284 {
285  // decay process
286  //
287  G4Decay* fDecayProcess = new G4Decay();
288 
290  while( (*theParticleIterator)() ){
292  G4ProcessManager* pmanager = particle->GetProcessManager();
293 
294  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
295 
296  pmanager ->AddProcess(fDecayProcess);
297 
298  // set ordering for PostStepDoIt and AtRestDoIt
299  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
300  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
301 
302  }
303  }
304 }
305 
306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
307 
308 #include "StepMax.hh"
309 
311 {
312  // Step limitation seen as a process
313  fStepMaxProcess = new StepMax();
314 
316  while ((*theParticleIterator)()){
318  G4ProcessManager* pmanager = particle->GetProcessManager();
319 
320  if (fStepMaxProcess->IsApplicable(*particle))
321  {
322  pmanager ->AddDiscreteProcess(fStepMaxProcess);
323  }
324  }
325 }
326 
327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
328 
329 #include "G4Gamma.hh"
330 #include "G4Electron.hh"
331 #include "G4Positron.hh"
332 
334 {
335  if (verboseLevel >0) {
336  G4cout << "PhysicsList::SetCuts:";
337  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
338  }
339 
340  // set cut values for gamma at first and for e- second and next for e+,
341  // because some processes for e+/e- need cut values for gamma
342  SetCutValue(fCutForGamma, "gamma");
343  SetCutValue(fCutForElectron, "e-");
344  SetCutValue(fCutForPositron, "e+");
345 
347 }
348 
349 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
350 
352 {
353  fCutForGamma = cut;
354  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
355 }
356 
357 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
358 
360 {
361  fCutForElectron = cut;
362  SetParticleCuts(fCutForElectron, G4Electron::Electron());
363 }
364 
365 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
366 
368 {
369  fCutForPositron = cut;
370  SetParticleCuts(fCutForPositron, G4Positron::Positron());
371 }
372 
373 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
374