Geant4  10.01.p01
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 82280 2014-06-13 14:45:31Z 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"
45 #include "G4EmLivermorePhysics.hh"
46 #include "G4EmPenelopePhysics.hh"
47 #include "G4EmLowEPPhysics.hh"
48 
49 #include "G4DecayPhysics.hh"
50 
54 #include "G4HadronInelasticQBBC.hh"
55 #include "G4IonPhysics.hh"
56 
57 #include "G4LossTableManager.hh"
58 #include "G4EmConfigurator.hh"
59 #include "G4UnitsTable.hh"
60 
61 #include "G4ProcessManager.hh"
62 #include "G4Decay.hh"
63 
64 #include "StepMax.hh"
65 
66 #include "G4IonFluctuations.hh"
69 
70 #include "G4BraggIonGasModel.hh"
72 
73 #include "G4PhysicalConstants.hh"
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79  fEmPhysicsList(0),
80  fDecPhysicsList(0),
81  fHadronPhys(),
82  fStepMaxProcess(0),
83  fMessenger(0)
84 {
86 
87  fHelIsRegisted = false;
88  fBicIsRegisted = false;
89  fBiciIsRegisted = false;
90 
91  fStepMaxProcess = 0;
92 
93  fMessenger = new PhysicsListMessenger(this);
94 
95  SetVerboseLevel(1);
96 
97  // EM physics
98  fEmName = G4String("emstandard_opt0");
100 
101  // Deacy physics and all particles
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 {
109  delete fMessenger;
110  delete fEmPhysicsList;
111  delete fDecPhysicsList;
112  for(size_t i=0; i<fHadronPhys.size(); i++) {delete fHadronPhys[i];}
113 }
114 
115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
116 
118 {
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123 
125 {
126  // transportation
127  //
129 
130  // electromagnetic physics list
131  //
133 
134  // decay physics list
135  //
137 
138  // hadronic physics lists
139  for(size_t i=0; i<fHadronPhys.size(); i++) {
140  fHadronPhys[i]->ConstructProcess();
141  }
142 
143  // step limitation (as a full process)
144  //
145  AddStepMax();
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
151 {
152  if (verboseLevel>1) {
153  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
154  }
155 
156  if (name == fEmName) return;
157 
158  if (name == "local") {
159 
160  fEmName = name;
161  delete fEmPhysicsList;
163 
164  } else if (name == "emstandard_opt0") {
165 
166  fEmName = name;
167  delete fEmPhysicsList;
169 
170  } else if (name == "emstandard_opt1") {
171 
172  fEmName = name;
173  delete fEmPhysicsList;
175 
176  } else if (name == "emstandard_opt2") {
177 
178  fEmName = name;
179  delete fEmPhysicsList;
181 
182  } else if (name == "emstandard_opt3") {
183 
184  fEmName = name;
185  delete fEmPhysicsList;
187 
188  } else if (name == "emstandard_opt4") {
189 
190  fEmName = name;
191  delete fEmPhysicsList;
193 
194  } else if (name == "standardSS") {
195 
196  fEmName = name;
197  delete fEmPhysicsList;
199 
200  } else if (name == "ionGasModels") {
201 
202  AddPhysicsList("emstandard_opt0");
203  fEmName = name;
204  AddIonGasModels();
205 
206  } else if (name == "standardNR") {
207 
208  fEmName = name;
209  delete fEmPhysicsList;
211 
212  } else if (name == "emlivermore") {
213  fEmName = name;
214  delete fEmPhysicsList;
216 
217  } else if (name == "empenelope") {
218  fEmName = name;
219  delete fEmPhysicsList;
221 
222  } else if (name == "emlowenergy") {
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "elastic" && !fHelIsRegisted) {
228  fHadronPhys.push_back( new G4HadronElasticPhysics());
229  fHelIsRegisted = true;
230 
231  } else if (name == "DElastic" && !fHelIsRegisted) {
232  fHadronPhys.push_back( new G4HadronDElasticPhysics());
233  fHelIsRegisted = true;
234 
235  } else if (name == "HElastic" && !fHelIsRegisted) {
236  fHadronPhys.push_back( new G4HadronHElasticPhysics());
237  fHelIsRegisted = true;
238 
239  } else if (name == "binary" && !fBicIsRegisted) {
240  fHadronPhys.push_back(new G4HadronInelasticQBBC());
241  fBicIsRegisted = true;
242 
243  } else if (name == "binary_ion" && !fBiciIsRegisted) {
244  fHadronPhys.push_back(new G4IonPhysics());
245  fBiciIsRegisted = true;
246 
247  } else {
248 
249  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
250  << " is not defined"
251  << G4endl;
252  }
253 }
254 
255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
256 
258 {
259  // Step limitation seen as a process
260  fStepMaxProcess = new StepMax();
261 
262  theParticleIterator->reset();
263  while ((*theParticleIterator)()){
264  G4ParticleDefinition* particle = theParticleIterator->value();
265  G4ProcessManager* pmanager = particle->GetProcessManager();
266 
267  if (fStepMaxProcess->IsApplicable(*particle) && pmanager)
268  {
270  }
271  }
272 }
273 
274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
275 
277 {
280  theParticleIterator->reset();
281  while ((*theParticleIterator)())
282  {
283  G4ParticleDefinition* particle = theParticleIterator->value();
284  G4String partname = particle->GetParticleName();
285  if(partname == "alpha" || partname == "He3" || partname == "GenericIon") {
288  G4double eth = 2.*MeV*particle->GetPDGMass()/proton_mass_c2;
289  em_config->SetExtraEmModel(partname,"ionIoni",mod1,"",0.0,eth,
290  new G4IonFluctuations());
291  em_config->SetExtraEmModel(partname,"ionIoni",mod2,"",eth,100*TeV,
292  new G4UniversalFluctuation());
293 
294  }
295  }
296 }
297 
298 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
299 
G4EmConfigurator * EmConfigurator()
void ConstructParticle()
Definition: PhysicsList.cc:117
static const double MeV
Definition: G4SIunits.hh:193
static G4LossTableManager * Instance()
void AddIonGasModels()
Definition: PhysicsList.cc:276
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:197
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