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 //
30 // $Id$
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "PhysicsList.hh"
36 #include "PhysicsListMessenger.hh"
37 
38 #include "PhysListEmStandard.hh"
39 #include "PhysListEmStandardSS.hh"
40 
41 #include "G4EmStandardPhysics.hh"
46 #include "G4EmLivermorePhysics.hh"
47 #include "G4EmPenelopePhysics.hh"
48 
49 #include "DetectorConstruction.hh"
50 
51 #include "G4LossTableManager.hh"
52 #include "G4UnitsTable.hh"
53 #include "G4SystemOfUnits.hh"
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
59 {
61  fDet = p;
62 
63  fCurrentDefaultCut = 1.0*mm;
64  fCutForGamma = fCurrentDefaultCut;
65  fCutForElectron = fCurrentDefaultCut;
66  fCutForPositron = fCurrentDefaultCut;
67 
68  fMessenger = new PhysicsListMessenger(this);
69 
70  SetVerboseLevel(1);
71 
72  // EM physics
73  fEmName = G4String("local");
74  fEmPhysicsList = new PhysListEmStandard(fEmName);
75 
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81 {
82  delete fMessenger;
83 }
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86 
87 // Bosons
88 #include "G4ChargedGeantino.hh"
89 #include "G4Geantino.hh"
90 #include "G4Gamma.hh"
91 #include "G4OpticalPhoton.hh"
92 
93 // leptons
94 #include "G4MuonPlus.hh"
95 #include "G4MuonMinus.hh"
96 #include "G4NeutrinoMu.hh"
97 #include "G4AntiNeutrinoMu.hh"
98 
99 #include "G4Electron.hh"
100 #include "G4Positron.hh"
101 #include "G4NeutrinoE.hh"
102 #include "G4AntiNeutrinoE.hh"
103 
104 // Mesons
105 #include "G4PionPlus.hh"
106 #include "G4PionMinus.hh"
107 #include "G4PionZero.hh"
108 #include "G4Eta.hh"
109 #include "G4EtaPrime.hh"
110 
111 #include "G4KaonPlus.hh"
112 #include "G4KaonMinus.hh"
113 #include "G4KaonZero.hh"
114 #include "G4AntiKaonZero.hh"
115 #include "G4KaonZeroLong.hh"
116 #include "G4KaonZeroShort.hh"
117 
118 // Baryons
119 #include "G4Proton.hh"
120 #include "G4AntiProton.hh"
121 #include "G4Neutron.hh"
122 #include "G4AntiNeutron.hh"
123 
124 // Nuclei
125 #include "G4Deuteron.hh"
126 #include "G4Triton.hh"
127 #include "G4Alpha.hh"
128 #include "G4GenericIon.hh"
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131 
133 {
134 // pseudo-particles
137 
138 // gamma
140 
141 // optical photon
143 
144 // leptons
149 
154 
155 // mesons
167 
168 // barions
173 
174 // ions
179 }
180 
181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
182 
183 #include "G4EmProcessOptions.hh"
184 
186 {
187  // Transportation
188  //
190 
191  // Electromagnetic physics list
192  //
193  fEmPhysicsList->ConstructProcess();
194 
195  // Em options
196  //
197  G4EmProcessOptions emOptions;
198  emOptions.SetBuildCSDARange(true);
199  emOptions.SetDEDXBinningForCSDARange(10*10);
200 
201  // Decay Process
202  //
203  AddDecay();
204 
205  // Decay Process
206  //
208 
209  // step limitation (as a full process)
210  //
211  AddStepMax();
212 }
213 
214 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
215 
217 {
218  if (verboseLevel>1) {
219  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
220  }
221 
222  if (name == fEmName) return;
223 
224  if (name == "local") {
225 
226  fEmName = name;
227  delete fEmPhysicsList;
228  fEmPhysicsList = new PhysListEmStandard(name);
229 
230  } else if (name == "emstandard_opt0") {
231 
232  fEmName = name;
233  delete fEmPhysicsList;
234  fEmPhysicsList = new G4EmStandardPhysics();
235 
236  } else if (name == "emstandard_opt1") {
237 
238  fEmName = name;
239  delete fEmPhysicsList;
240  fEmPhysicsList = new G4EmStandardPhysics_option1();
241 
242  } else if (name == "emstandard_opt2") {
243 
244  fEmName = name;
245  delete fEmPhysicsList;
246  fEmPhysicsList = new G4EmStandardPhysics_option2();
247 
248  } else if (name == "emstandard_opt3") {
249 
250  fEmName = name;
251  delete fEmPhysicsList;
252  fEmPhysicsList = new G4EmStandardPhysics_option3();
253 
254  } else if (name == "emstandard_opt4") {
255 
256  fEmName = name;
257  delete fEmPhysicsList;
258  fEmPhysicsList = new G4EmStandardPhysics_option4();
259 
260  } else if (name == "standardSS") {
261 
262  fEmName = name;
263  delete fEmPhysicsList;
264  fEmPhysicsList = new PhysListEmStandardSS(name);
265 
266  } else if (name == "emlivermore") {
267  fEmName = name;
268  delete fEmPhysicsList;
269  fEmPhysicsList = new G4EmLivermorePhysics();
270 
271  } else if (name == "empenelope") {
272  fEmName = name;
273  delete fEmPhysicsList;
274  fEmPhysicsList = new G4EmPenelopePhysics();
275 
276  } else {
277 
278  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
279  << " is not defined"
280  << G4endl;
281  }
282 }
283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284 
285 #include "G4ProcessManager.hh"
286 #include "G4Decay.hh"
287 
289 {
290  // Decay Process
291  //
292  G4Decay* fDecayProcess = new G4Decay();
293 
295  while( (*theParticleIterator)() ){
297  G4ProcessManager* pmanager = particle->GetProcessManager();
298 
299  if (fDecayProcess->IsApplicable(*particle)) {
300 
301  pmanager ->AddProcess(fDecayProcess);
302 
303  // set ordering for PostStepDoIt and AtRestDoIt
304  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
305  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
306 
307  }
308  }
309 }
310 
311 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
312 
313 #include "G4PhysicsListHelper.hh"
314 #include "G4RadioactiveDecay.hh"
315 
317 {
318  G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
319  radioactiveDecay->SetHLThreshold(-1.*s);
320  radioactiveDecay->SetICM(true); //Internal Conversion
321  radioactiveDecay->SetARM(true); //Atomic Rearangement
322 
324  ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
325 }
326 
327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
328 
329 #include "StepMax.hh"
330 
332 {
333  // Step limitation seen as a process
334  StepMax* stepMaxProcess = new StepMax();
335 
337  while ((*theParticleIterator)()){
339  G4ProcessManager* pmanager = particle->GetProcessManager();
340 
341  if (stepMaxProcess->IsApplicable(*particle))
342  {
343  pmanager ->AddDiscreteProcess(stepMaxProcess);
344  }
345  }
346 }
347 
348 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
349 
350 #include "G4Gamma.hh"
351 #include "G4Electron.hh"
352 #include "G4Positron.hh"
353 
355 {
356  if (verboseLevel >0) {
357  G4cout << "PhysicsList::SetCuts:";
358  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
359  }
360 
361  // set cut values for gamma at first and for e- second and next for e+,
362  // because some processes for e+/e- need cut values for gamma
363  SetCutValue(fCutForGamma, "gamma");
364  SetCutValue(fCutForElectron, "e-");
365  SetCutValue(fCutForPositron, "e+");
366 
368 }
369 
370 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
371 
373 {
374  fCutForGamma = cut;
375  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
376 }
377 
378 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
379 
381 {
382  fCutForElectron = cut;
383  SetParticleCuts(fCutForElectron, G4Electron::Electron());
384 }
385 
386 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
387 
389 {
390  fCutForPositron = cut;
391  SetParticleCuts(fCutForPositron, G4Positron::Positron());
392 }
393 
394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
395 
396 #include "G4Material.hh"
397 
399 {
400  G4LogicalVolume* lBox = fDet->GetWorld()->GetLogicalVolume();
402  const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple();
403  const G4Material* currMat = lBox->GetMaterial();
404 
406  G4double cut;
407  part = particleTable->FindParticle("e-");
408  cut = G4LossTableManager::Instance()->GetRange(part,val,couple);
409  G4cout << "material : " << currMat->GetName() << G4endl;
410  G4cout << "particle : " << part->GetParticleName() << G4endl;
411  G4cout << "energy : " << G4BestUnit(val,"Energy") << G4endl;
412  G4cout << "range : " << G4BestUnit(cut,"Length") << G4endl;
413 }
414 
415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
416 
417