Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/advanced/amsEcal/src/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: PhysicsList.cc 68740 2013-04-05 09:56:39Z gcosmo $
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 
183  theParticleIterator->reset();
184  while( (*theParticleIterator)() ){
185  G4ParticleDefinition* particle = theParticleIterator->value();
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 
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
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
const XML_Char * name
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
static G4AntiNeutron * AntiNeutronDefinition()
static G4PionZero * PionZeroDefinition()
Definition: G4PionZero.cc:99
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
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
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
static G4Eta * EtaDefinition()
Definition: G4Eta.cc:104
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81