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 68585 2013-04-01 23:35:07Z adotti $
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 #include "PhysListEmStandardSSM.hh"
40 #include "PhysListEmStandardGS.hh"
41 #include "PhysListEmStandardWVI.hh"
42 
43 #include "G4EmStandardPhysics.hh"
48 #include "G4EmLivermorePhysics.hh"
49 #include "G4EmPenelopePhysics.hh"
50 #include "G4EmDNAPhysics.hh"
51 
52 #include "G4LossTableManager.hh"
53 #include "G4UnitsTable.hh"
54 #include "G4SystemOfUnits.hh"
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59  fEmPhysicsList(0),
60  fStepMaxProcess(0),
61  fMessenger(0)
62 {
64  defaultCutValue = 1.*mm;
65  fCutForGamma = defaultCutValue;
66  fCutForElectron = defaultCutValue;
67  fCutForPositron = defaultCutValue;
68 
69  fStepMaxProcess = 0;
70 
71  fMessenger = new PhysicsListMessenger(this);
72 
73  SetVerboseLevel(1);
74 
75  // EM physics
76  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
77 
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  delete fMessenger;
85  delete fEmPhysicsList;
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
90 // Bosons
91 #include "G4ChargedGeantino.hh"
92 #include "G4Geantino.hh"
93 #include "G4Gamma.hh"
94 #include "G4OpticalPhoton.hh"
95 
96 // leptons
97 #include "G4MuonPlus.hh"
98 #include "G4MuonMinus.hh"
99 #include "G4NeutrinoMu.hh"
100 #include "G4AntiNeutrinoMu.hh"
101 
102 #include "G4Electron.hh"
103 #include "G4Positron.hh"
104 #include "G4NeutrinoE.hh"
105 #include "G4AntiNeutrinoE.hh"
106 
107 // Mesons
108 #include "G4PionPlus.hh"
109 #include "G4PionMinus.hh"
110 #include "G4PionZero.hh"
111 #include "G4Eta.hh"
112 #include "G4EtaPrime.hh"
113 
114 #include "G4KaonPlus.hh"
115 #include "G4KaonMinus.hh"
116 #include "G4KaonZero.hh"
117 #include "G4AntiKaonZero.hh"
118 #include "G4KaonZeroLong.hh"
119 #include "G4KaonZeroShort.hh"
120 
121 // Baryons
122 #include "G4Proton.hh"
123 #include "G4AntiProton.hh"
124 #include "G4Neutron.hh"
125 #include "G4AntiNeutron.hh"
126 
127 // Nuclei
128 #include "G4Alpha.hh"
129 #include "G4Deuteron.hh"
130 #include "G4Triton.hh"
131 #include "G4He3.hh"
132 #include "G4GenericIon.hh"
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
138 {
139 // pseudo-particles
142 
143 // gamma
145 
146 // optical photon
148 
149 // leptons
154 
159 
160 // mesons
172 
173 // barions
178 
179 // ions
185 
186 // DNA
187  G4DNAGenericIonsManager* genericIonsManager;
188  genericIonsManager=G4DNAGenericIonsManager::Instance();
189  genericIonsManager->GetIon("alpha++");
190  genericIonsManager->GetIon("alpha+");
191  genericIonsManager->GetIon("helium");
192  genericIonsManager->GetIon("hydrogen");
193 }
194 
195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
196 
197 #include "G4ProcessManager.hh"
198 #include "G4EmProcessOptions.hh"
199 
201 {
202  // transportation
203  //
205 
206  // electromagnetic physics list
207  //
208  fEmPhysicsList->ConstructProcess();
209 
210  // Em options
211  //
212  G4EmProcessOptions emOptions;
213  emOptions.SetBuildCSDARange(true);
214  emOptions.SetDEDXBinningForCSDARange(8*10);
215 
216  // decay process
217  //
218  AddDecay();
219 
220  // step limitation (as a full process)
221  //
222  AddStepMax();
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226 
228 {
229  if (verboseLevel>-1) {
230  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
231  }
232 
233  if (name == fEmName) return;
234 
235  if (name == "local") {
236 
237  fEmName = name;
238  delete fEmPhysicsList;
239  fEmPhysicsList = new PhysListEmStandard(name);
240 
241  } else if (name == "emstandard_opt0") {
242 
243  fEmName = name;
244  delete fEmPhysicsList;
245  fEmPhysicsList = new G4EmStandardPhysics();
246 
247  } else if (name == "emstandard_opt1") {
248 
249  fEmName = name;
250  delete fEmPhysicsList;
251  fEmPhysicsList = new G4EmStandardPhysics_option1();
252 
253  } else if (name == "emstandard_opt2") {
254 
255  fEmName = name;
256  delete fEmPhysicsList;
257  fEmPhysicsList = new G4EmStandardPhysics_option2();
258 
259  } else if (name == "emstandard_opt3") {
260 
261  fEmName = name;
262  delete fEmPhysicsList;
263  fEmPhysicsList = new G4EmStandardPhysics_option3();
264 
265  } else if (name == "emstandard_opt4") {
266 
267  fEmName = name;
268  delete fEmPhysicsList;
269  fEmPhysicsList = new G4EmStandardPhysics_option4();
270 
271  } else if (name == "standardSS") {
272 
273  fEmName = name;
274  delete fEmPhysicsList;
275  fEmPhysicsList = new PhysListEmStandardSS(name);
276 
277  } else if (name == "standardSSM") {
278 
279  fEmName = name;
280  delete fEmPhysicsList;
281  fEmPhysicsList = new PhysListEmStandardSSM(name);
282 
283  } else if (name == "standardWVI") {
284 
285  fEmName = name;
286  delete fEmPhysicsList;
287  fEmPhysicsList = new PhysListEmStandardWVI(name);
288 
289  } else if (name == "standardGS") {
290 
291  fEmName = name;
292  delete fEmPhysicsList;
293  fEmPhysicsList = new PhysListEmStandardGS(name);
294 
295  } else if (name == "emlivermore") {
296  fEmName = name;
297  delete fEmPhysicsList;
298  fEmPhysicsList = new G4EmLivermorePhysics();
299 
300  } else if (name == "empenelope") {
301  fEmName = name;
302  delete fEmPhysicsList;
303  fEmPhysicsList = new G4EmPenelopePhysics();
304 
305  } else if (name == "dna") {
306  fEmName = name;
307  delete fEmPhysicsList;
308  fEmPhysicsList = new G4EmDNAPhysics();
309 
310  } else {
311 
312  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
313  << " is not defined"
314  << G4endl;
315  }
316 }
317 
318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319 
320 #include "G4Decay.hh"
321 
323 {
324  // decay process
325  //
326  G4Decay* fDecayProcess = new G4Decay();
327 
328  theParticleIterator->reset();
329  while( (*theParticleIterator)() ){
330  G4ParticleDefinition* particle = theParticleIterator->value();
331  G4ProcessManager* pmanager = particle->GetProcessManager();
332 
333  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
334 
335  pmanager ->AddProcess(fDecayProcess);
336 
337  // set ordering for PostStepDoIt and AtRestDoIt
338  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
339  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
340 
341  }
342  }
343 }
344 
345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
346 
347 #include "StepMax.hh"
348 
350 {
351  // Step limitation seen as a process
352  fStepMaxProcess = new StepMax();
353 
354  theParticleIterator->reset();
355  while ((*theParticleIterator)()){
356  G4ParticleDefinition* particle = theParticleIterator->value();
357  G4ProcessManager* pmanager = particle->GetProcessManager();
358 
359  if (fStepMaxProcess->IsApplicable(*particle))
360  {
361  pmanager ->AddDiscreteProcess(fStepMaxProcess);
362  }
363  }
364 }
365 
366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
367 
368 #include "G4Gamma.hh"
369 #include "G4Electron.hh"
370 #include "G4Positron.hh"
371 
373 {
374  if (verboseLevel >0) {
375  G4cout << "PhysicsList::SetCuts:";
376  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
377  }
378 
379  // set cut values for gamma at first and for e- second and next for e+,
380  // because some processes for e+/e- need cut values for gamma
381  SetCutValue(fCutForGamma, "gamma");
382  SetCutValue(fCutForElectron, "e-");
383  SetCutValue(fCutForPositron, "e+");
384 
386 }
387 
388 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
389 
391 {
392  fCutForGamma = cut;
393  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
394 }
395 
396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
397 
399 {
400  fCutForElectron = cut;
401  SetParticleCuts(fCutForElectron, G4Electron::Electron());
402 }
403 
404 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
405 
407 {
408  fCutForPositron = cut;
409  SetParticleCuts(fCutForPositron, G4Positron::Positron());
410 }
411 
412 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
413 
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 G4He3 * He3Definition()
Definition: G4He3.cc:89
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4LossTableManager * Instance()
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
void SetDEDXBinningForCSDARange(G4int val)
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
static G4DNAGenericIonsManager * Instance(void)
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
void AddDecay()
Definition: PhysicsList.cc:290
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
void SetBuildCSDARange(G4bool val)
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
G4ParticleDefinition * GetIon(const G4String &name)
static G4Eta * EtaDefinition()
Definition: G4Eta.cc:104
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81