Geant4_10
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: PhysicsList.cc 67268 2013-02-13 11:38:40Z ihrivnac $
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  fEmPhysicsList(0),
55  fStepMaxProcess(0),
56  fMessenger(0)
57 {
58  fCurrentDefaultCut = 1.0*mm;
59  fCutForGamma = fCurrentDefaultCut;
60  fCutForElectron = fCurrentDefaultCut;
61  fCutForPositron = fCurrentDefaultCut;
62 
63  fMessenger = new PhysicsListMessenger(this);
64 
65  SetVerboseLevel(1);
66 
67  // EM physics
68  fEmName = G4String("local");
69  fEmPhysicsList = new PhysListEmStandard(fEmName);
70 
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76 {
77  delete fMessenger;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
82 // Bosons
83 #include "G4ChargedGeantino.hh"
84 #include "G4Geantino.hh"
85 #include "G4Gamma.hh"
86 #include "G4OpticalPhoton.hh"
87 
88 // leptons
89 #include "G4MuonPlus.hh"
90 #include "G4MuonMinus.hh"
91 #include "G4NeutrinoMu.hh"
92 #include "G4AntiNeutrinoMu.hh"
93 
94 #include "G4Electron.hh"
95 #include "G4Positron.hh"
96 #include "G4NeutrinoE.hh"
97 #include "G4AntiNeutrinoE.hh"
98 
99 // Mesons
100 #include "G4PionPlus.hh"
101 #include "G4PionMinus.hh"
102 #include "G4PionZero.hh"
103 #include "G4Eta.hh"
104 #include "G4EtaPrime.hh"
105 
106 #include "G4KaonPlus.hh"
107 #include "G4KaonMinus.hh"
108 #include "G4KaonZero.hh"
109 #include "G4AntiKaonZero.hh"
110 #include "G4KaonZeroLong.hh"
111 #include "G4KaonZeroShort.hh"
112 
113 // Baryons
114 #include "G4Proton.hh"
115 #include "G4AntiProton.hh"
116 #include "G4Neutron.hh"
117 #include "G4AntiNeutron.hh"
118 
119 // Nuclei
120 #include "G4Deuteron.hh"
121 #include "G4Triton.hh"
122 #include "G4Alpha.hh"
123 #include "G4GenericIon.hh"
124 
126 {
127 // pseudo-particles
130 
131 // gamma
133 
134 // optical photon
136 
137 // leptons
142 
147 
148 // mesons
160 
161 // barions
166 
167 // ions
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175 
176 #include "G4ProcessManager.hh"
177 #include "G4Decay.hh"
178 
180 {
182 
183  // electromagnetic Physics List
184  //
185  fEmPhysicsList->ConstructProcess();
186 
187  // Add Decay Process
188  //
189  G4Decay* fDecayProcess = new G4Decay();
190 
191  theParticleIterator->reset();
192  while( (*theParticleIterator)() ){
193  G4ParticleDefinition* particle = theParticleIterator->value();
194  G4ProcessManager* pmanager = particle->GetProcessManager();
195 
196  if (fDecayProcess->IsApplicable(*particle)) {
197 
198  pmanager ->AddProcess(fDecayProcess);
199 
200  // set ordering for PostStepDoIt and AtRestDoIt
201  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
202  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
203 
204  }
205  }
206 
207  // stepLimitation (as a full process)
208  //
209  AddStepMax();
210 }
211 
212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213 
215 {
216  if (verboseLevel>1) {
217  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
218  }
219 
220  if (name == fEmName) return;
221 
222  if (name == "local") {
223 
224  fEmName = name;
225  delete fEmPhysicsList;
226  fEmPhysicsList = new PhysListEmStandard(name);
227 
228  } else if (name == "emstandard_opt0") {
229 
230  fEmName = name;
231  delete fEmPhysicsList;
232  fEmPhysicsList = new G4EmStandardPhysics();
233 
234  } else if (name == "emstandard_opt1") {
235 
236  fEmName = name;
237  delete fEmPhysicsList;
238  fEmPhysicsList = new G4EmStandardPhysics_option1();
239 
240  } else if (name == "emstandard_opt2") {
241 
242  fEmName = name;
243  delete fEmPhysicsList;
244  fEmPhysicsList = new G4EmStandardPhysics_option2();
245 
246  } else if (name == "emstandard_opt3") {
247 
248  fEmName = name;
249  delete fEmPhysicsList;
250  fEmPhysicsList = new G4EmStandardPhysics_option3();
251 
252  } else if (name == "emstandard_opt4") {
253 
254  fEmName = name;
255  delete fEmPhysicsList;
256  fEmPhysicsList = new G4EmStandardPhysics_option4();
257 
258  } else if (name == "standardWVI") {
259 
260  fEmName = name;
261  delete fEmPhysicsList;
262  fEmPhysicsList = new PhysListEmStandardWVI(name);
263 
264  } else if (name == "emlivermore") {
265 
266  fEmName = name;
267  delete fEmPhysicsList;
268  fEmPhysicsList = new G4EmLivermorePhysics();
269 
270  } else if (name == "empenelope") {
271 
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 
284 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
285 
286 #include "StepMax.hh"
287 
289 {
290  // Step limitation seen as a process
291  fStepMaxProcess = new StepMax();
292 
293  theParticleIterator->reset();
294  while ((*theParticleIterator)()){
295  G4ParticleDefinition* particle = theParticleIterator->value();
296  G4ProcessManager* pmanager = particle->GetProcessManager();
297 
298  if (fStepMaxProcess->IsApplicable(*particle))
299  {
300  pmanager ->AddDiscreteProcess(fStepMaxProcess);
301  }
302  }
303 }
304 
305 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
306 
308 {
309  if (verboseLevel >0) {
310  G4cout << "PhysicsList::SetCuts:";
311  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
312  }
313 
314  // set cut values for gamma at first and for e- second and next for e+,
315  // because some processes for e+/e- need cut values for gamma
316  SetCutValue(fCutForGamma, "gamma");
317  SetCutValue(fCutForElectron, "e-");
318  SetCutValue(fCutForPositron, "e+");
319 
320  // Cut for proton not used in EM processes except single scattering
321  // so electron cut is used in this example
322  SetCutValue(fCutForElectron, "proton");
323 
325 }
326 
327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
328 
330 {
331  fCutForGamma = cut;
332  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
333 }
334 
335 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
336 
338 {
339  fCutForElectron = cut;
340  SetParticleCuts(fCutForElectron, G4Electron::Electron());
341 }
342 
343 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
344 
346 {
347  fCutForPositron = cut;
348  SetParticleCuts(fCutForPositron, G4Positron::Positron());
349 }
350 
351 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
352 
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4Triton * TritonDefinition()
Definition: G4Triton.cc:90
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
void SetCutValue(G4double aCut, const G4String &pname)
void SetCutForGamma(G4double)
Definition: PhysicsList.cc:231
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void SetCutForPositron(G4double)
Definition: PhysicsList.cc:247
const XML_Char * name
Definition: expat.h:151
static G4KaonZero * KaonZeroDefinition()
Definition: G4KaonZero.cc:99
static G4AntiKaonZero * AntiKaonZeroDefinition()
static G4KaonZeroShort * KaonZeroShortDefinition()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
G4ProcessManager * GetProcessManager() const
void SetCutForElectron(G4double)
Definition: PhysicsList.cc:239
static G4AntiNeutron * AntiNeutronDefinition()
static G4PionZero * PionZeroDefinition()
Definition: G4PionZero.cc:99
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4KaonZeroLong * KaonZeroLongDefinition()
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4EtaPrime * EtaPrimeDefinition()
Definition: G4EtaPrime.cc:100
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
double G4double
Definition: G4Types.hh:76
void ConstructProcess()
Definition: PhysicsList.cc:170
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static G4Deuteron * DeuteronDefinition()
Definition: G4Deuteron.cc:89
static G4Alpha * AlphaDefinition()
Definition: G4Alpha.cc:84
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
static G4Eta * EtaDefinition()
Definition: G4Eta.cc:104
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81