Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 100254 2016-10-17 07:53:29Z 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");
86  fEmPhysicsList = new G4EmStandardPhysics_option4(1);
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 {
150  fEmPhysicsList->ConstructProcess();
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 
166  particleIterator->reset();
167  while( (*particleIterator)() ){
168  G4ParticleDefinition* particle = particleIterator->value();
169  G4ProcessManager* pmanager = particle->GetProcessManager();
170 
171  if (fDecayProcess->IsApplicable(*particle) &&
172  !particle->IsShortLived()) {
173 
174  pmanager ->AddProcess(fDecayProcess);
175 
176  // set ordering for PostStepDoIt and AtRestDoIt
177  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
178  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
179 
180  }
181  }
182 }
183 
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
185 
186 #include "StepMax.hh"
187 
189 {
190  // Step limitation seen as a process
191  StepMax* stepMaxProcess = new StepMax();
192 
194  particleIterator->reset();
195  while ((*particleIterator)()){
196  G4ParticleDefinition* particle = particleIterator->value();
197  G4ProcessManager* pmanager = particle->GetProcessManager();
198 
199  if (stepMaxProcess->IsApplicable(*particle))
200  {
201  pmanager ->AddDiscreteProcess(stepMaxProcess);
202  }
203  }
204 }
205 
206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
207 
209 {
210  if (verboseLevel>-1) {
211  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
212  }
213 
214  if (name == fEmName) return;
215 
216  if (name == "emstandard_opt0") {
217 
218  fEmName = name;
219  delete fEmPhysicsList;
220  fEmPhysicsList = new G4EmStandardPhysics(1);
221 
222  } else if (name == "emstandard_opt1") {
223 
224  fEmName = name;
225  delete fEmPhysicsList;
226  fEmPhysicsList = new G4EmStandardPhysics_option1(1);
227 
228  } else if (name == "emstandard_opt2") {
229 
230  fEmName = name;
231  delete fEmPhysicsList;
232  fEmPhysicsList = new G4EmStandardPhysics_option2(1);
233 
234  } else if (name == "emstandard_opt3") {
235 
236  fEmName = name;
237  delete fEmPhysicsList;
238  fEmPhysicsList = new G4EmStandardPhysics_option3(1);
239 
240  } else if (name == "emstandard_opt4") {
241 
242  fEmName = name;
243  delete fEmPhysicsList;
244  fEmPhysicsList = new G4EmStandardPhysics_option4(1);
245 
246  } else if (name == "emlowenergy") {
247  fEmName = name;
248  delete fEmPhysicsList;
249  fEmPhysicsList = new G4EmLowEPPhysics(1);
250 
251  } else if (name == "emstandardSS") {
252  fEmName = name;
253  delete fEmPhysicsList;
254  fEmPhysicsList = new G4EmStandardPhysicsSS(1);
255 
256  } else if (name == "emstandardWVI") {
257  fEmName = name;
258  delete fEmPhysicsList;
259  fEmPhysicsList = new G4EmStandardPhysicsWVI(1);
260 
261  } else if (name == "emstandardGS") {
262  fEmName = name;
263  delete fEmPhysicsList;
264  fEmPhysicsList = new G4EmStandardPhysicsGS(1);
265 
266  } else if (name == "emlivermore") {
267  fEmName = name;
268  delete fEmPhysicsList;
269  fEmPhysicsList = new G4EmLivermorePhysics(1);
270 
271  } else if (name == "empenelope") {
272  fEmName = name;
273  delete fEmPhysicsList;
274  fEmPhysicsList = new G4EmPenelopePhysics(1);
275 
276  } else {
277 
278  G4ExceptionDescription description;
279  description
280  << " "
281  << "PhysicsList::AddPhysicsList: <" << name << "> is not defined";
282  G4Exception("PhysicsList::AddPhysicsList",
283  "electronScattering2_F001", FatalException, description);
284  }
285 }
286 
287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
const XML_Char * name
Definition: expat.h:151
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
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
static void ConstructParticle()
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
G4ProcessManager * GetProcessManager() const
void AddDecay()
Definition: PhysicsList.cc:222
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4ChargedGeantino * ChargedGeantinoDefinition()
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
void ConstructProcess()
Definition: PhysicsList.cc:170
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81