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$
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Description: EM physics with a possibility to add PAI model
36 //
37 // Author: V.Ivanchenko 01.09.2010
38 //
39 //----------------------------------------------------------------------------
40 //
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
45 #include "PhysicsList.hh"
46 #include "PhysicsListMessenger.hh"
47 
48 #include "G4EmStandardPhysics.hh"
53 #include "G4EmLivermorePhysics.hh"
54 #include "G4EmPenelopePhysics.hh"
55 #include "G4DecayPhysics.hh"
56 
57 #include "G4PAIModel.hh"
58 #include "G4PAIPhotonModel.hh"
59 
60 #include "G4Gamma.hh"
61 #include "G4Electron.hh"
62 #include "G4Positron.hh"
63 #include "G4Proton.hh"
64 
65 #include "G4UnitsTable.hh"
66 #include "G4SystemOfUnits.hh"
67 #include "G4LossTableManager.hh"
68 #include "G4ProductionCutsTable.hh"
69 
70 #include "StepMax.hh"
71 
72 #include "G4ProcessManager.hh"
73 #include "G4ParticleTypes.hh"
74 #include "G4ParticleTable.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 {
82  defaultCutValue = 1.*mm;
83  fCutForGamma = defaultCutValue;
84  fCutForElectron = defaultCutValue;
85  fCutForPositron = defaultCutValue;
86  fCutForProton = defaultCutValue;
87 
88  fMessenger = new PhysicsListMessenger(this);
89 
90  fStepMaxProcess = new StepMax();
91 
92  // Decay Physics is always defined
93  fDecayPhysicsList = new G4DecayPhysics();
94 
95  // EM physics
96  fEmName = G4String("emstandard");
97  fEmPhysicsList = new G4EmStandardPhysics(1);
98 
99  SetVerboseLevel(1);
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
105 {
106  delete fMessenger;
107  delete fDecayPhysicsList;
108  delete fEmPhysicsList;
109  for(size_t i=0; i<fHadronPhys.size(); ++i) { delete fHadronPhys[i]; }
110  delete fStepMaxProcess;
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
116 {
117  fDecayPhysicsList->ConstructParticle();
118 }
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
123 {
125  fEmPhysicsList->ConstructProcess();
126  fDecayPhysicsList->ConstructProcess();
127  for(size_t i=0; i<fHadronPhys.size(); ++i) { fHadronPhys[i]->ConstructProcess(); }
128  AddStepMax();
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132 
134 {
135  if (verboseLevel>1) {
136  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
137  }
138 
139  if (name == fEmName) {
140  return;
141 
142  } else if (name == "emstandard_opt1") {
143 
144  fEmName = name;
145  delete fEmPhysicsList;
146  fEmPhysicsList = new G4EmStandardPhysics_option1();
147 
148  } else if (name == "emstandard_opt2") {
149 
150  fEmName = name;
151  delete fEmPhysicsList;
152  fEmPhysicsList = new G4EmStandardPhysics_option2();
153 
154  } else if (name == "emstandard_opt3") {
155 
156  fEmName = name;
157  delete fEmPhysicsList;
158  fEmPhysicsList = new G4EmStandardPhysics_option3();
159 
160  } else if (name == "emstandard_opt4") {
161 
162  fEmName = name;
163  delete fEmPhysicsList;
164  fEmPhysicsList = new G4EmStandardPhysics_option4();
165 
166  } else if (name == "emlivermore") {
167 
168  fEmName = name;
169  delete fEmPhysicsList;
170  fEmPhysicsList = new G4EmLivermorePhysics();
171 
172  } else if (name == "empenelope") {
173 
174  fEmName = name;
175  delete fEmPhysicsList;
176  fEmPhysicsList = new G4EmPenelopePhysics();
177 
178  } else if (name == "pai") {
179 
180  fEmName = name;
181  AddPAIModel(name);
182 
183  } else if (name == "pai_photon") {
184 
185  fEmName = name;
186  AddPAIModel(name);
187 
188  } else {
189 
190  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
191  << " is not defined"
192  << G4endl;
193  }
194 }
195 
196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
197 
199 {
200  // Step limitation seen as a process
201 
203  while ((*theParticleIterator)())
204  {
206  G4ProcessManager* pmanager = particle->GetProcessManager();
207 
208  if (fStepMaxProcess->IsApplicable(*particle))
209  {
210  pmanager ->AddDiscreteProcess(fStepMaxProcess);
211  }
212  }
213 }
214 
215 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
216 
218 {
220  if ( verboseLevel > 0 )
221  {
222  G4cout << "PhysicsList::SetCuts:";
223  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
224  }
225 
226  // set cut values for gamma at first and for e- second and next for e+,
227  // because some processes for e+/e- need cut values for gamma
228 
229  SetCutValue(fCutForGamma, "gamma");
230  SetCutValue(fCutForElectron, "e-");
231  SetCutValue(fCutForPositron, "e+");
232  SetCutValue(fCutForProton, "proton");
233 
234  if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
235 }
236 
237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
238 
240 {
241  fCutForGamma = cut;
242  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
243 }
244 
245 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
246 
248 {
249  fCutForElectron = cut;
250  SetParticleCuts(fCutForElectron, G4Electron::Electron());
251 }
252 
253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
254 
256 {
257  fCutForPositron = cut;
258  SetParticleCuts(fCutForPositron, G4Positron::Positron());
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
262 
264 {
265  fCutForPositron = cut;
266  SetParticleCuts(fCutForProton, G4Proton::Proton());
267 }
268 
269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
270 
271 void PhysicsList::AddPAIModel(const G4String& modname)
272 {
274  while ((*theParticleIterator)())
275  {
277  G4String partname = particle->GetParticleName();
278  if(partname == "e-" || partname == "e+") {
279  NewPAIModel(particle, modname, "eIoni");
280 
281  } else if(partname == "mu-" || partname == "mu+") {
282  NewPAIModel(particle, modname, "muIoni");
283 
284  } else if(partname == "proton" ||
285  partname == "pi+" ||
286  partname == "pi-"
287  ) {
288  NewPAIModel(particle, modname, "hIoni");
289  }
290  }
291 }
292 
293 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
294 
295 void PhysicsList::NewPAIModel(const G4ParticleDefinition* part,
296  const G4String& modname,
297  const G4String& procname)
298 {
299  G4String partname = part->GetParticleName();
300  if(modname == "pai") {
301  G4PAIModel* pai = new G4PAIModel(part,"PAIModel");
302  fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
303  0.0,100.*TeV,pai);
304  } else if(modname == "pai_photon") {
305  G4PAIPhotonModel* pai = new G4PAIPhotonModel(part,"PAIPhotModel");
306  fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
307  0.0,100.*TeV,pai);
308  }
309 }
310 
311 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
312