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 //
26 // $Id$
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
31 #include "PhysicsList.hh"
32 #include "PhysicsListMessenger.hh"
33 
34 #include "PhysListEmStandard.hh"
35 
36 #include "G4SystemOfUnits.hh"
37 #include "G4EmStandardPhysics.hh"
41 
42 #include "G4LossTableManager.hh"
43 #include "G4UnitsTable.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 {
50  currentDefaultCut = 1.0*mm;
51  cutForGamma = currentDefaultCut;
52  cutForElectron = currentDefaultCut;
53  cutForPositron = currentDefaultCut;
54 
55  pMessenger = new PhysicsListMessenger(this);
56 
57  SetVerboseLevel(1);
58 
59  // EM physics
60  emName = G4String("emstandard_local");
61  emPhysicsList = new PhysListEmStandard(emName);
62 
63 }
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68 {
69  delete pMessenger;
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
74 // Bosons
75 #include "G4ChargedGeantino.hh"
76 #include "G4Geantino.hh"
77 #include "G4Gamma.hh"
78 #include "G4OpticalPhoton.hh"
79 
80 // leptons
81 #include "G4MuonPlus.hh"
82 #include "G4MuonMinus.hh"
83 #include "G4NeutrinoMu.hh"
84 #include "G4AntiNeutrinoMu.hh"
85 
86 #include "G4Electron.hh"
87 #include "G4Positron.hh"
88 #include "G4NeutrinoE.hh"
89 #include "G4AntiNeutrinoE.hh"
90 
91 // Mesons
92 #include "G4PionPlus.hh"
93 #include "G4PionMinus.hh"
94 #include "G4PionZero.hh"
95 #include "G4Eta.hh"
96 #include "G4EtaPrime.hh"
97 
98 #include "G4KaonPlus.hh"
99 #include "G4KaonMinus.hh"
100 #include "G4KaonZero.hh"
101 #include "G4AntiKaonZero.hh"
102 #include "G4KaonZeroLong.hh"
103 #include "G4KaonZeroShort.hh"
104 
105 // Baryons
106 #include "G4Proton.hh"
107 #include "G4AntiProton.hh"
108 #include "G4Neutron.hh"
109 #include "G4AntiNeutron.hh"
110 
111 // Nuclei
112 #include "G4Deuteron.hh"
113 #include "G4Triton.hh"
114 #include "G4Alpha.hh"
115 #include "G4GenericIon.hh"
116 
118 {
119 // pseudo-particles
122 
123 // gamma
125 
126 // optical photon
128 
129 // leptons
134 
139 
140 // mesons
152 
153 // barions
158 
159 // ions
164 }
165 
166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
167 
168 #include "G4ProcessManager.hh"
169 #include "G4Decay.hh"
170 
172 {
174 
175  // electromagnetic Physics List
176  //
177  emPhysicsList->ConstructProcess();
178 
179  // Add Decay Process
180  //
181  G4Decay* fDecayProcess = new G4Decay();
182 
184  while( (*theParticleIterator)() ){
186  G4ProcessManager* pmanager = particle->GetProcessManager();
187 
188  if (fDecayProcess->IsApplicable(*particle)) {
189 
190  pmanager ->AddProcess(fDecayProcess);
191 
192  // set ordering for PostStepDoIt and AtRestDoIt
193  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
194  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
195 
196  }
197  }
198 }
199 
200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
201 
203 {
204  if (verboseLevel>1) {
205  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
206  }
207 
208  if (name == emName) return;
209 
210  if (name == "emstandard_local") {
211 
212  emName = name;
213  delete emPhysicsList;
214  emPhysicsList = new PhysListEmStandard(name);
215 
216  } else if (name == "emstandard_opt0") {
217 
218  emName = name;
219  delete emPhysicsList;
220  emPhysicsList = new G4EmStandardPhysics();
221 
222  } else if (name == "emstandard_opt1") {
223 
224  emName = name;
225  delete emPhysicsList;
226  emPhysicsList = new G4EmStandardPhysics_option1();
227 
228  } else if (name == "emstandard_opt2") {
229 
230  emName = name;
231  delete emPhysicsList;
232  emPhysicsList = new G4EmStandardPhysics_option2();
233 
234  } else if (name == "emstandard_opt3") {
235 
236  emName = name;
237  delete emPhysicsList;
238  emPhysicsList = new G4EmStandardPhysics_option3();
239 
240  } else {
241 
242  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
243  << " is not defined"
244  << G4endl;
245  }
246 }
247 
248 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
249 
251 {
252 
253  if (verboseLevel >0){
254  G4cout << "PhysicsList::SetCuts:";
255  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
256  }
257 
258  // set cut values for gamma at first and for e- second and next for e+,
259  // because some processes for e+/e- need cut values for gamma
260  SetCutValue(cutForGamma, "gamma");
261  SetCutValue(cutForElectron, "e-");
262  SetCutValue(cutForPositron, "e+");
263 
265 }
266 
267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
268 
269 #include "G4Gamma.hh"
270 #include "G4Electron.hh"
271 #include "G4Positron.hh"
272 
274 {
275  cutForGamma = cut;
276  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
277 }
278 
279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
280 
282 {
283  cutForElectron = cut;
284  SetParticleCuts(cutForElectron, G4Electron::Electron());
285 }
286 
287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
288 
290 {
291  cutForPositron = cut;
292  SetParticleCuts(cutForPositron, G4Positron::Positron());
293 }
294 
295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
296