Geant4  10.01.p03
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 86064 2014-11-07 08:49:32Z gcosmo $
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 "PhysListEmStandardGS.hh"
40 #include "PhysListEmStandardWVI.hh"
41 
42 #include "G4EmStandardPhysics.hh"
46 
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 
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79  fMessenger(0), fEmName("local"), fEmPhysicsList(0)
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  // EM physics
84  fEmName = G4String("local");
86 
88  SetVerboseLevel(1);
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  delete fEmPhysicsList;
96  delete fMessenger;
97 }
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100 
102 {
103 // pseudo-particles
106 
107 // gamma
109 
110 // optical photon
112 
113 // leptons
118 
123 
124 // mesons
125  G4MesonConstructor mConstructor;
126  mConstructor.ConstructParticle();
127 
128 // barions
129  G4BaryonConstructor bConstructor;
130  bConstructor.ConstructParticle();
131 
132 // ions
133  G4IonConstructor iConstructor;
134  iConstructor.ConstructParticle();
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
143  AddDecay();
144  AddStepMax();
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
149 #include "G4Decay.hh"
150 
152 {
153  // Add Decay Process
154 
155  G4Decay* fDecayProcess = new G4Decay();
156 
157  theParticleIterator->reset();
158  while( (*theParticleIterator)() ){
159  G4ParticleDefinition* particle = theParticleIterator->value();
160  G4ProcessManager* pmanager = particle->GetProcessManager();
161 
162  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
163 
164  pmanager ->AddProcess(fDecayProcess);
165 
166  // set ordering for PostStepDoIt and AtRestDoIt
167  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
168  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
169 
170  }
171  }
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175 
176 #include "StepMax.hh"
177 
179 {
180  // Step limitation seen as a process
181  StepMax* stepMaxProcess = new StepMax();
182 
183  theParticleIterator->reset();
184  while ((*theParticleIterator)()){
185  G4ParticleDefinition* particle = theParticleIterator->value();
186  G4ProcessManager* pmanager = particle->GetProcessManager();
187 
188  if (stepMaxProcess->IsApplicable(*particle))
189  {
190  pmanager ->AddDiscreteProcess(stepMaxProcess);
191  }
192  }
193 }
194 
195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
196 
198 {
199  if (verboseLevel>-1) {
200  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
201  }
202 
203  if (name == fEmName) return;
204 
205  if (name == "local") {
206 
207  fEmName = name;
208  delete fEmPhysicsList;
210 
211  } else if (name == "emstandard_opt0") {
212 
213  fEmName = name;
214  delete fEmPhysicsList;
216 
217  } else if (name == "emstandard_opt1") {
218 
219  fEmName = name;
220  delete fEmPhysicsList;
222 
223  } else if (name == "emstandard_opt2") {
224 
225  fEmName = name;
226  delete fEmPhysicsList;
228 
229  } else if (name == "emstandard_opt3") {
230 
231  fEmName = name;
232  delete fEmPhysicsList;
234 
235  } else if (name == "standardSS") {
236 
237  fEmName = name;
238  delete fEmPhysicsList;
240 
241  } else if (name == "standardGS") {
242 
243  fEmName = name;
244  delete fEmPhysicsList;
246 
247  } else if (name == "standardWVI") {
248 
249  fEmName = name;
250  delete fEmPhysicsList;
252 
253  } else {
254 
255  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
256  << " is not defined"
257  << G4endl;
258  }
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void SetDefaultCutValue(G4double newCutValue)
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
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 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
static const double mm
Definition: G4SIunits.hh:102
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81