Geant4  9.6.p02
 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 //
28 //
29 // $Id: PhysicsList.cc 66995 2013-01-29 14:46:45Z 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 
48 #include "G4DecayPhysics.hh"
49 
53 #include "G4HadronInelasticQBBC.hh"
54 #include "G4IonPhysics.hh"
55 
56 #include "G4LossTableManager.hh"
57 #include "G4EmConfigurator.hh"
58 #include "G4UnitsTable.hh"
59 
60 #include "G4ProcessManager.hh"
61 #include "G4Decay.hh"
62 
63 #include "StepMax.hh"
64 
65 #include "G4IonFluctuations.hh"
68 
69 #include "G4BraggIonGasModel.hh"
71 
72 #include "G4PhysicalConstants.hh"
73 #include "G4SystemOfUnits.hh"
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
78 {
80  defaultCutValue = 1.*mm;
81  fCutForGamma = defaultCutValue;
82  fCutForElectron = defaultCutValue;
83  fCutForPositron = defaultCutValue;
84 
85  fHelIsRegisted = false;
86  fBicIsRegisted = false;
87  fBiciIsRegisted = false;
88 
89  fStepMaxProcess = 0;
90 
91  fMessenger = new PhysicsListMessenger(this);
92 
93  SetVerboseLevel(1);
94 
95  // EM physics
96  fEmName = G4String("emstandard_opt0");
97  fEmPhysicsList = new G4EmStandardPhysics(1);
98 
99  // Deacy physics and all particles
100  fDecPhysicsList = new G4DecayPhysics();
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104 
106 {
107  delete fMessenger;
108  delete fEmPhysicsList;
109  delete fDecPhysicsList;
110  for(size_t i=0; i<fHadronPhys.size(); i++) {delete fHadronPhys[i];}
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
116 {
117  fDecPhysicsList->ConstructParticle();
118 }
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
123 {
124  // transportation
125  //
127 
128  // electromagnetic physics list
129  //
130  fEmPhysicsList->ConstructProcess();
131 
132  // decay physics list
133  //
134  fDecPhysicsList->ConstructProcess();
135 
136  // hadronic physics lists
137  for(size_t i=0; i<fHadronPhys.size(); i++) {
138  fHadronPhys[i]->ConstructProcess();
139  }
140 
141  // step limitation (as a full process)
142  //
143  AddStepMax();
144 }
145 
146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147 
149 {
150  if (verboseLevel>1) {
151  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
152  }
153 
154  if (name == fEmName) return;
155 
156  if (name == "local") {
157 
158  fEmName = name;
159  delete fEmPhysicsList;
160  fEmPhysicsList = new PhysListEmStandard(name);
161 
162  } else if (name == "emstandard_opt0") {
163 
164  fEmName = name;
165  delete fEmPhysicsList;
166  fEmPhysicsList = new G4EmStandardPhysics(1);
167 
168  } else if (name == "emstandard_opt1") {
169 
170  fEmName = name;
171  delete fEmPhysicsList;
172  fEmPhysicsList = new G4EmStandardPhysics_option1();
173 
174  } else if (name == "emstandard_opt2") {
175 
176  fEmName = name;
177  delete fEmPhysicsList;
178  fEmPhysicsList = new G4EmStandardPhysics_option2();
179 
180  } else if (name == "emstandard_opt3") {
181 
182  fEmName = name;
183  delete fEmPhysicsList;
184  fEmPhysicsList = new G4EmStandardPhysics_option3();
185 
186  } else if (name == "emstandard_opt4") {
187 
188  fEmName = name;
189  delete fEmPhysicsList;
190  fEmPhysicsList = new G4EmStandardPhysics_option4();
191 
192  } else if (name == "standardSS") {
193 
194  fEmName = name;
195  delete fEmPhysicsList;
196  fEmPhysicsList = new PhysListEmStandardSS(name);
197 
198  } else if (name == "ionGasModels") {
199 
200  AddPhysicsList("emstandard_opt0");
201  fEmName = name;
202  AddIonGasModels();
203 
204  } else if (name == "standardNR") {
205 
206  fEmName = name;
207  delete fEmPhysicsList;
208  fEmPhysicsList = new PhysListEmStandardNR(name);
209 
210  } else if (name == "emlivermore") {
211  fEmName = name;
212  delete fEmPhysicsList;
213  fEmPhysicsList = new G4EmLivermorePhysics();
214 
215  } else if (name == "empenelope") {
216  fEmName = name;
217  delete fEmPhysicsList;
218  fEmPhysicsList = new G4EmPenelopePhysics();
219 
220  } else if (name == "elastic" && !fHelIsRegisted) {
221  fHadronPhys.push_back( new G4HadronElasticPhysics());
222  fHelIsRegisted = true;
223 
224  } else if (name == "DElastic" && !fHelIsRegisted) {
225  fHadronPhys.push_back( new G4HadronDElasticPhysics());
226  fHelIsRegisted = true;
227 
228  } else if (name == "HElastic" && !fHelIsRegisted) {
229  fHadronPhys.push_back( new G4HadronHElasticPhysics());
230  fHelIsRegisted = true;
231 
232  } else if (name == "binary" && !fBicIsRegisted) {
233  fHadronPhys.push_back(new G4HadronInelasticQBBC());
234  fBicIsRegisted = true;
235 
236  } else if (name == "binary_ion" && !fBiciIsRegisted) {
237  fHadronPhys.push_back(new G4IonPhysics());
238  fBiciIsRegisted = true;
239 
240  } else {
241 
242  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
243  << " is not defined"
244  << G4endl;
245  }
246 }
247 
248 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
249 
251 {
252  // Step limitation seen as a process
253  fStepMaxProcess = new StepMax();
254 
256  while ((*theParticleIterator)()){
258  G4ProcessManager* pmanager = particle->GetProcessManager();
259 
260  if (fStepMaxProcess->IsApplicable(*particle) && pmanager)
261  {
262  pmanager ->AddDiscreteProcess(fStepMaxProcess);
263  }
264  }
265 }
266 
267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
268 
270 {
271  if (verboseLevel >0) {
272  G4cout << "PhysicsList::SetCuts:";
273  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
274  }
275 
276  // set cut values for gamma at first and for e- second and next for e+,
277  // because some processes for e+/e- need cut values for gamma
278  SetCutValue(fCutForGamma, "gamma");
279  SetCutValue(fCutForElectron, "e-");
280  SetCutValue(fCutForPositron, "e+");
281 
283 }
284 
285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
286 
288 {
289  fCutForGamma = cut;
290  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
291 }
292 
293 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
294 
296 {
297  fCutForElectron = cut;
298  SetParticleCuts(fCutForElectron, G4Electron::Electron());
299 }
300 
301 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
302 
304 {
305  fCutForPositron = cut;
306  SetParticleCuts(fCutForPositron, G4Positron::Positron());
307 }
308 
309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
310 
311 void PhysicsList::AddIonGasModels()
312 {
315  while ((*theParticleIterator)())
316  {
318  G4String partname = particle->GetParticleName();
319  if(partname == "alpha" || partname == "He3" || partname == "GenericIon") {
322  G4double eth = 2.*MeV*particle->GetPDGMass()/proton_mass_c2;
323  em_config->SetExtraEmModel(partname,"ionIoni",mod1,"",0.0,eth,
324  new G4IonFluctuations());
325  em_config->SetExtraEmModel(partname,"ionIoni",mod2,"",eth,100*TeV,
326  new G4UniversalFluctuation());
327 
328  }
329  }
330 }
331 
332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
333