Geant4  10.02
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 93734 2015-10-30 10:59:21Z gcosmo $
27 //
30 
31 #include "PhysicsList.hh"
32 #include "PhysicsListMessenger.hh"
33 
34 #include "G4EmStandardPhysics.hh"
39 #include "G4EmStandardPhysicsSS.hh"
41 #include "G4EmStandardPhysicsGS.hh"
42 #include "G4EmLivermorePhysics.hh"
43 #include "G4EmPenelopePhysics.hh"
44 #include "G4EmLowEPPhysics.hh"
45 
46 #include "G4LossTableManager.hh"
47 #include "G4UnitsTable.hh"
48 
49 #include "G4ParticleDefinition.hh"
50 #include "G4ProcessManager.hh"
51 
52 // Bosons
53 #include "G4ChargedGeantino.hh"
54 #include "G4Geantino.hh"
55 #include "G4Gamma.hh"
56 #include "G4OpticalPhoton.hh"
57 
58 // leptons
59 #include "G4MuonPlus.hh"
60 #include "G4MuonMinus.hh"
61 #include "G4NeutrinoMu.hh"
62 #include "G4AntiNeutrinoMu.hh"
63 
64 #include "G4Electron.hh"
65 #include "G4Positron.hh"
66 #include "G4NeutrinoE.hh"
67 #include "G4AntiNeutrinoE.hh"
68 
69 // Hadrons
70 #include "G4MesonConstructor.hh"
71 #include "G4BaryonConstructor.hh"
72 #include "G4IonConstructor.hh"
73 #include "G4GenericIon.hh"
74 
75 #include "G4SystemOfUnits.hh"
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80 : G4VModularPhysicsList(), fMessenger(0), fEmPhysicsList(0)
81 {
82  fMessenger = new PhysicsListMessenger(this);
83 
84  // EM physics
85  fEmName = G4String("emstandard_opt4");
87  if (verboseLevel>-1) {
88  G4cout << "PhysicsList::Constructor with default list: <"
89  << fEmName << ">" << G4endl;
90  }
91 
93  SetVerboseLevel(1);
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
99 {
100  delete fEmPhysicsList;
101  delete fMessenger;
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107 {
108  // pseudo-particles
111 
112  // gamma
114 
115  // optical photon
117 
118  // leptons
123 
128 
129  // mesons
130  G4MesonConstructor mConstructor;
131  mConstructor.ConstructParticle();
132 
133  // barions
134  G4BaryonConstructor bConstructor;
135  bConstructor.ConstructParticle();
136 
137  // ions
138  G4IonConstructor iConstructor;
139  iConstructor.ConstructParticle();
140 
141  // Required by MT even if ion physics not used
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {
151  AddDecay();
152  AddStepMax();
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
156 
157 #include "G4Decay.hh"
158 
160 {
161  // Add Decay Process
162 
163  G4Decay* fDecayProcess = new G4Decay();
164 
165  theParticleIterator->reset();
166  while( (*theParticleIterator)() ){
167  G4ParticleDefinition* particle = theParticleIterator->value();
168  G4ProcessManager* pmanager = particle->GetProcessManager();
169 
170  if (fDecayProcess->IsApplicable(*particle) &&
171  !particle->IsShortLived()) {
172 
173  pmanager ->AddProcess(fDecayProcess);
174 
175  // set ordering for PostStepDoIt and AtRestDoIt
176  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
177  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
178 
179  }
180  }
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184 
185 #include "StepMax.hh"
186 
188 {
189  // Step limitation seen as a process
190  StepMax* stepMaxProcess = new StepMax();
191 
192  theParticleIterator->reset();
193  while ((*theParticleIterator)()){
194  G4ParticleDefinition* particle = theParticleIterator->value();
195  G4ProcessManager* pmanager = particle->GetProcessManager();
196 
197  if (stepMaxProcess->IsApplicable(*particle))
198  {
199  pmanager ->AddDiscreteProcess(stepMaxProcess);
200  }
201  }
202 }
203 
204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
205 
207 {
208  if (verboseLevel>-1) {
209  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
210  }
211 
212  if (name == fEmName) return;
213 
214  if (name == "emstandard_opt0") {
215 
216  fEmName = name;
217  delete fEmPhysicsList;
219 
220  } else if (name == "emstandard_opt1") {
221 
222  fEmName = name;
223  delete fEmPhysicsList;
225 
226  } else if (name == "emstandard_opt2") {
227 
228  fEmName = name;
229  delete fEmPhysicsList;
231 
232  } else if (name == "emstandard_opt3") {
233 
234  fEmName = name;
235  delete fEmPhysicsList;
237 
238  } else if (name == "emstandard_opt4") {
239 
240  fEmName = name;
241  delete fEmPhysicsList;
243 
244  } else if (name == "emlowenergy") {
245  fEmName = name;
246  delete fEmPhysicsList;
248 
249  } else if (name == "emstandardSS") {
250  fEmName = name;
251  delete fEmPhysicsList;
253 
254  } else if (name == "emstandardWVI") {
255  fEmName = name;
256  delete fEmPhysicsList;
258 
259  } else if (name == "emstandardGS") {
260  fEmName = name;
261  delete fEmPhysicsList;
263 
264  } else if (name == "emlivermore") {
265  fEmName = name;
266  delete fEmPhysicsList;
268 
269  } else if (name == "empenelope") {
270  fEmName = name;
271  delete fEmPhysicsList;
273 
274  } else {
275 
276  G4ExceptionDescription description;
277  description
278  << " "
279  << "PhysicsList::AddPhysicsList: <" << name << "> is not defined";
280  G4Exception("PhysicsList::AddPhysicsList",
281  "electronScattering2_F001", FatalException, description);
282  }
283 }
284 
285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4LossTableManager * Instance()
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
G4GLOB_DLL std::ostream G4cout
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
void AddDecay()
Definition: PhysicsList.cc:231
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
static G4ChargedGeantino * ChargedGeantinoDefinition()
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81