Geant4  10.02.p02
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 93675 2015-10-28 09:59:23Z 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 "PhysListEmStandardNR.hh"
40 #include "G4EmStandardPhysics.hh"
46 #include "G4EmStandardPhysicsGS.hh"
47 #include "G4EmStandardPhysicsSS.hh"
48 
49 #include "G4EmLivermorePhysics.hh"
50 #include "G4EmPenelopePhysics.hh"
51 #include "G4EmLowEPPhysics.hh"
52 
53 #include "G4DecayPhysics.hh"
54 
58 #include "G4HadronInelasticQBBC.hh"
59 #include "G4IonPhysics.hh"
60 
61 #include "G4LossTableManager.hh"
62 #include "G4EmConfigurator.hh"
63 #include "G4UnitsTable.hh"
64 
65 #include "G4ProcessManager.hh"
66 #include "G4Decay.hh"
67 
68 #include "StepMax.hh"
69 
70 #include "G4IonFluctuations.hh"
73 
74 #include "G4BraggIonGasModel.hh"
76 
77 #include "G4PhysicalConstants.hh"
78 #include "G4SystemOfUnits.hh"
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83  fEmPhysicsList(0),
84  fDecPhysicsList(0),
85  fHadronPhys(),
86  fStepMaxProcess(0),
87  fMessenger(0)
88 {
90 
91  fHelIsRegisted = false;
92  fBicIsRegisted = false;
93  fBiciIsRegisted = false;
94 
95  fStepMaxProcess = 0;
96 
97  fMessenger = new PhysicsListMessenger(this);
98 
99  SetVerboseLevel(1);
100 
101  // EM physics
102  fEmName = G4String("emstandard_opt0");
104 
105  // Deacy physics and all particles
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112 {
113  delete fMessenger;
114  delete fEmPhysicsList;
115  delete fDecPhysicsList;
116  for(size_t i=0; i<fHadronPhys.size(); i++) {delete fHadronPhys[i];}
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
122 {
124 }
125 
126 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
127 
129 {
130  // transportation
131  //
133 
134  // electromagnetic physics list
135  //
137 
138  // decay physics list
139  //
141 
142  // hadronic physics lists
143  for(size_t i=0; i<fHadronPhys.size(); i++) {
144  fHadronPhys[i]->ConstructProcess();
145  }
146 
147  // step limitation (as a full process)
148  //
149  AddStepMax();
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
155 {
156  if (verboseLevel>1) {
157  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
158  }
159 
160  if (name == fEmName) return;
161 
162  if (name == "local") {
163 
164  fEmName = name;
165  delete fEmPhysicsList;
167 
168  } else if (name == "emstandard_opt0") {
169 
170  fEmName = name;
171  delete fEmPhysicsList;
173 
174  } else if (name == "emstandard_opt1") {
175 
176  fEmName = name;
177  delete fEmPhysicsList;
179 
180  } else if (name == "emstandard_opt2") {
181 
182  fEmName = name;
183  delete fEmPhysicsList;
185 
186  } else if (name == "emstandard_opt3") {
187 
188  fEmName = name;
189  delete fEmPhysicsList;
191 
192  } else if (name == "emstandard_opt4") {
193 
194  fEmName = name;
195  delete fEmPhysicsList;
197 
198  } else if (name == "standardSS") {
199 
200  fEmName = name;
201  delete fEmPhysicsList;
203 
204  } else if (name == "ionGasModels") {
205 
206  AddPhysicsList("emstandard_opt0");
207  fEmName = name;
208  AddIonGasModels();
209 
210  } else if (name == "standardNR") {
211 
212  fEmName = name;
213  delete fEmPhysicsList;
215 
216  } else if (name == "emlivermore") {
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "empenelope") {
222  fEmName = name;
223  delete fEmPhysicsList;
225 
226  } else if (name == "emlowenergy") {
227  fEmName = name;
228  delete fEmPhysicsList;
230 
231  } else if (name == "emstandardSS") {
232 
233  fEmName = name;
234  delete fEmPhysicsList;
236 
237  } else if (name == "emstandardWVI") {
238 
239  fEmName = name;
240  delete fEmPhysicsList;
242 
243  } else if (name == "emstandardGS") {
244 
245  fEmName = name;
246  delete fEmPhysicsList;
248 
249 
250  } else if (name == "elastic" && !fHelIsRegisted) {
251  fHadronPhys.push_back( new G4HadronElasticPhysics());
252  fHelIsRegisted = true;
253 
254  } else if (name == "DElastic" && !fHelIsRegisted) {
255  fHadronPhys.push_back( new G4HadronDElasticPhysics());
256  fHelIsRegisted = true;
257 
258  } else if (name == "HElastic" && !fHelIsRegisted) {
259  fHadronPhys.push_back( new G4HadronHElasticPhysics());
260  fHelIsRegisted = true;
261 
262  } else if (name == "binary" && !fBicIsRegisted) {
263  fHadronPhys.push_back(new G4HadronInelasticQBBC());
264  fBicIsRegisted = true;
265 
266  } else if (name == "binary_ion" && !fBiciIsRegisted) {
267  fHadronPhys.push_back(new G4IonPhysics());
268  fBiciIsRegisted = true;
269 
270  } else {
271 
272  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
273  << " is not defined"
274  << G4endl;
275  }
276 }
277 
278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
279 
281 {
282  // Step limitation seen as a process
283  fStepMaxProcess = new StepMax();
284 
285  theParticleIterator->reset();
286  while ((*theParticleIterator)()){
287  G4ParticleDefinition* particle = theParticleIterator->value();
288  G4ProcessManager* pmanager = particle->GetProcessManager();
289 
290  if (fStepMaxProcess->IsApplicable(*particle) && pmanager)
291  {
293  }
294  }
295 }
296 
297 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
298 
300 {
303  theParticleIterator->reset();
304  while ((*theParticleIterator)())
305  {
306  G4ParticleDefinition* particle = theParticleIterator->value();
307  G4String partname = particle->GetParticleName();
308  if(partname == "alpha" || partname == "He3" || partname == "GenericIon") {
311  G4double eth = 2.*MeV*particle->GetPDGMass()/proton_mass_c2;
312  em_config->SetExtraEmModel(partname,"ionIoni",mod1,"",0.0,eth,
313  new G4IonFluctuations());
314  em_config->SetExtraEmModel(partname,"ionIoni",mod2,"",eth,100*TeV,
315  new G4UniversalFluctuation());
316 
317  }
318  }
319 }
320 
321 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
322 
G4EmConfigurator * EmConfigurator()
void ConstructParticle()
Definition: PhysicsList.cc:117
static const double MeV
Definition: G4SIunits.hh:211
static G4LossTableManager * Instance()
void AddIonGasModels()
Definition: PhysicsList.cc:299
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
std::vector< G4VPhysicsConstructor * > fHadronPhys
Definition: PhysicsList.hh:76
G4ProcessManager * GetProcessManager() const
G4EmConfigurator em_config
Definition: PhysicsList.hh:65
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
const G4String & GetParticleName() const
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
G4double GetPDGMass() const
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4bool fBiciIsRegisted
Definition: PhysicsList.hh:71
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
#define G4endl
Definition: G4ios.hh:61
G4VPhysicsConstructor * fDecPhysicsList
Definition: PhysicsList.hh:74
static const double TeV
Definition: G4SIunits.hh:215
Definition of the PhysListEmStandardNR class.
double G4double
Definition: G4Types.hh:76
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
void SetExtraEmModel(const G4String &particleName, const G4String &processName, G4VEmModel *, const G4String &regionName="", G4double emin=0.0, G4double emax=DBL_MAX, G4VEmFluctuationModel *fm=0)
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
G4bool fBicIsRegisted
Definition: PhysicsList.hh:70