Geant4  10.01
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 82042 2014-06-10 08:02:58Z gcosmo $
27 //
30 
31 #include "PhysicsList.hh"
32 #include "PhysicsListMessenger.hh"
33 
34 #include "PhysListEmStandard.hh"
35 #include "PhysListEmStandardSS.hh"
36 #include "PhysListEmStandardGS.hh"
37 #include "PhysListEmStandardWVI.hh"
38 
39 #include "G4EmStandardPhysics.hh"
44 #include "G4EmLowEPPhysics.hh"
45 
46 #include "G4UnitsTable.hh"
47 
48 #include "G4ParticleDefinition.hh"
49 #include "G4ProcessManager.hh"
50 
51 // Bosons
52 #include "G4ChargedGeantino.hh"
53 #include "G4Geantino.hh"
54 #include "G4Gamma.hh"
55 #include "G4OpticalPhoton.hh"
56 
57 // leptons
58 #include "G4MuonPlus.hh"
59 #include "G4MuonMinus.hh"
60 #include "G4NeutrinoMu.hh"
61 #include "G4AntiNeutrinoMu.hh"
62 
63 #include "G4Electron.hh"
64 #include "G4Positron.hh"
65 #include "G4NeutrinoE.hh"
66 #include "G4AntiNeutrinoE.hh"
67 
68 // Hadrons
69 #include "G4MesonConstructor.hh"
70 #include "G4BaryonConstructor.hh"
71 #include "G4IonConstructor.hh"
72 #include "G4GenericIon.hh"
73 
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 : G4VModularPhysicsList(), fMessenger(0), fEmPhysicsList(0)
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  // EM physics
84  fEmName = G4String("local");
86 
87  SetVerboseLevel(1);
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  delete fEmPhysicsList;
95  delete fMessenger;
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
101 {
102  // pseudo-particles
105 
106  // gamma
108 
109  // optical photon
111 
112  // leptons
117 
122 
123  // mesons
124  G4MesonConstructor mConstructor;
125  mConstructor.ConstructParticle();
126 
127  // barions
128  G4BaryonConstructor bConstructor;
129  bConstructor.ConstructParticle();
130 
131  // ions
132  G4IonConstructor iConstructor;
133  iConstructor.ConstructParticle();
134 
135  // Required by MT even if ion physics not used
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
142 {
145  AddDecay();
146  AddStepMax();
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150 
151 #include "G4Decay.hh"
152 
154 {
155  // Add Decay Process
156 
157  G4Decay* fDecayProcess = new G4Decay();
158 
159  theParticleIterator->reset();
160  while( (*theParticleIterator)() ){
161  G4ParticleDefinition* particle = theParticleIterator->value();
162  G4ProcessManager* pmanager = particle->GetProcessManager();
163 
164  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
165 
166  pmanager ->AddProcess(fDecayProcess);
167 
168  // set ordering for PostStepDoIt and AtRestDoIt
169  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
170  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
171 
172  }
173  }
174 }
175 
176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
177 
178 #include "StepMax.hh"
179 
181 {
182  // Step limitation seen as a process
183  StepMax* stepMaxProcess = new StepMax();
184 
185  theParticleIterator->reset();
186  while ((*theParticleIterator)()){
187  G4ParticleDefinition* particle = theParticleIterator->value();
188  G4ProcessManager* pmanager = particle->GetProcessManager();
189 
190  if (stepMaxProcess->IsApplicable(*particle))
191  {
192  pmanager ->AddDiscreteProcess(stepMaxProcess);
193  }
194  }
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
200 {
201  if (verboseLevel>-1) {
202  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
203  }
204 
205  if (name == fEmName) return;
206 
207  if (name == "local") {
208 
209  fEmName = name;
210  delete fEmPhysicsList;
212 
213  } else if (name == "emstandard_opt0") {
214 
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else if (name == "emstandard_opt1") {
220 
221  fEmName = name;
222  delete fEmPhysicsList;
224 
225  } else if (name == "emstandard_opt2") {
226 
227  fEmName = name;
228  delete fEmPhysicsList;
230 
231  } else if (name == "emstandard_opt3") {
232 
233  fEmName = name;
234  delete fEmPhysicsList;
236 
237  } else if (name == "emstandard_opt4") {
238 
239  fEmName = name;
240  delete fEmPhysicsList;
242 
243  } else if (name == "emlowenergy") {
244  fEmName = name;
245  delete fEmPhysicsList;
247 
248  } else if (name == "standardSS") {
249 
250  fEmName = name;
251  delete fEmPhysicsList;
253 
254  } else if (name == "standardGS") {
255 
256  fEmName = name;
257  delete fEmPhysicsList;
259 
260  } else if (name == "standardWVI") {
261 
262  fEmName = name;
263  delete fEmPhysicsList;
265 
266  } else {
267 
268  G4ExceptionDescription description;
269  description
270  << " "
271  << "PhysicsList::AddPhysicsList: <" << name << "> is not defined";
272  G4Exception("PhysicsList::AddPhysicsList",
273  "electronScattering2_F001", FatalException, description);
274  }
275 }
276 
277 //....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
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:226
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