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 //
28 //
29 // $Id: PhysicsList.cc 82278 2014-06-13 14:42:11Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Author: V.Ivanchenko 14.10.2002
36 //
37 // Modified:
38 // 17.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
39 // 24.10.12 Migrated to new stopping and ion physics (A.Ribon)
40 //
41 //----------------------------------------------------------------------------
42 //
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
47 #include "PhysicsList.hh"
48 #include "PhysicsListMessenger.hh"
49 
50 #include "PhysListEmStandard.hh"
51 #include "G4EmStandardPhysics.hh"
56 #include "G4EmLivermorePhysics.hh"
57 #include "G4EmPenelopePhysics.hh"
58 #include "G4EmLowEPPhysics.hh"
59 #include "G4DecayPhysics.hh"
61 #include "G4HadronInelasticQBBC.hh"
62 #include "G4IonPhysics.hh"
63 #include "G4EmExtraPhysics.hh"
64 #include "G4StoppingPhysics.hh"
65 
66 #include "G4RegionStore.hh"
67 #include "G4ProcessManager.hh"
68 #include "G4ParticleTypes.hh"
69 #include "G4ParticleTable.hh"
70 
71 #include "G4Gamma.hh"
72 #include "G4Electron.hh"
73 #include "G4Positron.hh"
74 #include "G4Proton.hh"
75 
76 #include "G4UnitsTable.hh"
77 #include "G4SystemOfUnits.hh"
78 #include "G4LossTableManager.hh"
79 #include "StepMax.hh"
80 
81 #include "G4EmProcessOptions.hh"
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86  fEmPhysicsList(0),
87  fDecayPhysicsList(0),
88  fStepMaxProcess(0),
89  fMessenger(0)
90 {
93 
94  fMessenger = new PhysicsListMessenger(this);
95  fStepMaxProcess = new StepMax();
96 
97  // Initilise flags
98 
99  SetVerboseLevel(1);
100 
101  fHelIsRegisted = false;
102  fBicIsRegisted = false;
103  fGnucIsRegisted = false;
104  fStopIsRegisted = false;
105 
106  // EM physics
107  fEmName = G4String("emstandard");
109 
110  // Decay Physics is always defined
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
117 {
118  delete fMessenger;
119  delete fDecayPhysicsList;
120  delete fEmPhysicsList;
121  delete fStepMaxProcess;
122  for(size_t i=0; i<fHadronPhys.size(); i++) {
123  delete fHadronPhys[i];
124  }
125 }
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128 
130 {
132 }
133 
134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
135 
137 {
141  for(size_t i=0; i<fHadronPhys.size(); ++i) {
142  fHadronPhys[i]->ConstructProcess();
143  }
144  AddStepMax();
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
150 {
151  if (verboseLevel > 1)
152  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
153 
154  if (name == fEmName) return;
155 
156  if (name == "emstandard") {
157  fEmName = name;
158  delete fEmPhysicsList;
160  if (verboseLevel > 0)
161  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
162 
163  } else if (name == "emstandard_opt1") {
164  fEmName = name;
165  delete fEmPhysicsList;
167  if (verboseLevel > 0)
168  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
169 
170  } else if (name == "emstandard_opt2") {
171  fEmName = name;
172  delete fEmPhysicsList;
174  if (verboseLevel > 0)
175  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
176 
177  } else if (name == "emstandard_opt3") {
178  fEmName = name;
179  delete fEmPhysicsList;
181  if (verboseLevel > 0)
182  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
183 
184  } else if (name == "emstandard_opt4") {
185  fEmName = name;
186  delete fEmPhysicsList;
188  if (verboseLevel > 0)
189  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
190 
191  } else if (name == "emstandard_local") {
192  fEmName = name;
193  delete fEmPhysicsList;
195  if (verboseLevel > 0)
196  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
197 
198  } else if (name == "emlivermore") {
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else if (name == "empenelope") {
204  fEmName = name;
205  delete fEmPhysicsList;
207 
208  } else if (name == "emlowenergy") {
209  fEmName = name;
210  delete fEmPhysicsList;
212 
213  } else if (name == "elastic" && !fHelIsRegisted) {
214  fHadronPhys.push_back( new G4HadronElasticPhysics());
215  fHelIsRegisted = true;
216  if (verboseLevel > 0)
217  G4cout << "PhysicsList::Add hadron elastic physics" << G4endl;
218 
219  } else if (name == "binary" && !fBicIsRegisted) {
220  fHadronPhys.push_back(new G4HadronInelasticQBBC());
221  fHadronPhys.push_back(new G4IonPhysics());
222  fBicIsRegisted = true;
223  if (verboseLevel > 0)
224  G4cout << "PhysicsList::Add hadron inelastic physics from <QBBC>"
225  << G4endl;
226 
227  } else if (name == "gamma_nuc" && !fGnucIsRegisted) {
228  fHadronPhys.push_back(new G4EmExtraPhysics());
229  fGnucIsRegisted = true;
230  if (verboseLevel > 0)
231  G4cout << "PhysicsList::Add gamma- and electro-nuclear physics"
232  << G4endl;
233 
234  } else if (name == "stopping" && !fStopIsRegisted) {
235  fHadronPhys.push_back(new G4StoppingPhysics());
236  fStopIsRegisted = true;
237  if (verboseLevel > 0)
238  G4cout << "PhysicsList::Add stopping physics" << G4endl;
239 
240  } else {
241  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
242  << " is not defined"
243  << G4endl;
244  }
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
248 
250 {
251  // Step limitation seen as a process
252 
253  theParticleIterator->reset();
254  while ((*theParticleIterator)()){
255  G4ParticleDefinition* particle = theParticleIterator->value();
256  G4ProcessManager* pmanager = particle->GetProcessManager();
257 
258  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
259  {
261  }
262  }
263 }
264 
265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
266 
void SetDefaultCutValue(G4double newCutValue)
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
std::vector< G4VPhysicsConstructor * > fHadronPhys
Definition: PhysicsList.hh:76
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
G4bool fStopIsRegisted
Definition: PhysicsList.hh:92
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
G4bool fHelIsRegisted
Definition: PhysicsList.hh:69
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
void AddStepMax()
Definition: PhysicsList.cc:172
G4VPhysicsConstructor * fDecayPhysicsList
Definition: PhysicsList.hh:75
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
#define G4endl
Definition: G4ios.hh:61
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static const double mm
Definition: G4SIunits.hh:102
#define theParticleIterator
G4bool fGnucIsRegisted
Definition: PhysicsList.hh:91
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
G4bool fBicIsRegisted
Definition: PhysicsList.hh:70