Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/hadronic/Hadr01/src/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 //
26 /// \file hadronic/Hadr01/src/PhysicsList.cc
27 /// \brief Implementation of the PhysicsList class
28 //
29 //
30 // $Id: PhysicsList.cc 70761 2013-06-05 12:30:51Z gcosmo $
31 //
32 /////////////////////////////////////////////////////////////////////////
33 //
34 // PhysicsList
35 //
36 // Created: 31.04.2006 V.Ivanchenko
37 //
38 // Modified:
39 // 04.06.2006 Adoptation of Hadr01 (V.Ivanchenko)
40 // 26.04.2007 Physics according to 8.3 Physics List (V.Ivanchenko)
41 // 16.10.2012 Renamed used classes (A.Ribon)
42 //
43 ////////////////////////////////////////////////////////////////////////
44 //
45 
46 #include "PhysicsList.hh"
47 #include "PhysicsListMessenger.hh"
48 
49 #include "G4DecayPhysics.hh"
50 #include "G4EmStandardPhysics.hh"
55 #include "G4EmLivermorePhysics.hh"
56 #include "G4EmPenelopePhysics.hh"
61 #include "G4NeutronTrackingCut.hh"
63 #include "G4StoppingPhysics.hh"
65 #include "G4IonPhysics.hh"
66 #include "G4EmExtraPhysics.hh"
67 #include "G4EmProcessOptions.hh"
68 
72 #include "G4HadronInelasticQBBC.hh"
79 
80 #include "G4LossTableManager.hh"
81 
82 #include "G4ProcessManager.hh"
83 #include "G4ParticleTypes.hh"
84 #include "G4ParticleTable.hh"
85 #include "G4Gamma.hh"
86 #include "G4Electron.hh"
87 #include "G4Positron.hh"
88 #include "G4Proton.hh"
89 
90 #include "G4SystemOfUnits.hh"
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
93 
96  fEmPhysicsList(0), fParticleList(0), fMessenger(0)
97 {
99  defaultCutValue = 0.7*mm;
100  fCutForGamma = defaultCutValue;
101  fCutForElectron = defaultCutValue;
102  fCutForPositron = defaultCutValue;
103  fCutForProton = defaultCutValue;
104  verboseLevel = 1;
105 
106  fMessenger = new PhysicsListMessenger(this);
107 
108  // Particles
109  fParticleList = new G4DecayPhysics("decays");
110 
111  // EM physics
112  fEmPhysicsList = new G4EmStandardPhysics();
113 }
114 
115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
116 
118 {
119  delete fMessenger;
120  delete fParticleList;
121  delete fEmPhysicsList;
122  for(size_t i=0; i<fHadronPhys.size(); i++) {
123  delete fHadronPhys[i];
124  }
125 }
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
128 
130 {
131  fParticleList->ConstructParticle();
132 }
133 
134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
135 
137 {
139  fEmPhysicsList->ConstructProcess();
140  fParticleList->ConstructProcess();
141  for(size_t i=0; i<fHadronPhys.size(); i++) {
142  fHadronPhys[i]->ConstructProcess();
143  }
144 }
145 
146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
147 
149 {
150  if (verboseLevel>0) {
151  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
152  }
153  if (name == "emstandard_opt0") {
154 
155  delete fEmPhysicsList;
156  fEmPhysicsList = new G4EmStandardPhysics();
157 
158  } else if (name == "emstandard_opt1") {
159 
160  delete fEmPhysicsList;
161  fEmPhysicsList = new G4EmStandardPhysics_option1();
162 
163  } else if (name == "emstandard_opt2") {
164 
165  delete fEmPhysicsList;
166  fEmPhysicsList = new G4EmStandardPhysics_option2();
167 
168  } else if (name == "emstandard_opt3") {
169 
170  delete fEmPhysicsList;
171  fEmPhysicsList = new G4EmStandardPhysics_option3();
172 
173  } else if (name == "emstandard_opt4") {
174 
175  delete fEmPhysicsList;
176  fEmPhysicsList = new G4EmStandardPhysics_option4();
177 
178  } else if (name == "FTFP_BERT_EMV") {
179 
180  AddPhysicsList("emstandard_opt1");
181  AddPhysicsList("FTFP_BERT");
182 
183  } else if (name == "FTFP_BERT_EMX") {
184 
185  AddPhysicsList("emstandard_opt2");
186  AddPhysicsList("FTFP_BERT");
187 
188  } else if (name == "FTFP_BERT_EMZ") {
189 
190  AddPhysicsList("emstandard_opt4");
191  AddPhysicsList("FTFP_BERT");
192 
193  } else if (name == "FTFP_BERT") {
194 
195  SetBuilderList1();
196  fHadronPhys.push_back( new G4HadronPhysicsFTFP_BERT());
197 
198  } else if (name == "FTF_BIC") {
199 
200  SetBuilderList0();
201  fHadronPhys.push_back( new G4HadronPhysicsFTF_BIC());
202  fHadronPhys.push_back( new G4NeutronCrossSectionXS(verboseLevel));
203 
204  } else if (name == "QBBC") {
205 
206  AddPhysicsList("emstandard_opt0");
207  SetBuilderList2();
208  fHadronPhys.push_back( new G4HadronInelasticQBBC());
209 
210  } else if (name == "QGSP_BERT") {
211 
212  SetBuilderList1();
213  fHadronPhys.push_back( new G4HadronPhysicsQGSP_BERT());
214 
215  } else if (name == "QGSP_FTFP_BERT") {
216 
217  SetBuilderList1();
218  fHadronPhys.push_back( new G4HadronPhysicsQGSP_FTFP_BERT());
219 
220  } else if (name == "QGSP_FTFP_BERT_EMV") {
221 
222  AddPhysicsList("emstandard_opt1");
223  AddPhysicsList("QGSP_FTFP_BERT");
224 
225  } else if (name == "QGSP_BERT_EMV") {
226 
227  AddPhysicsList("emstandard_opt1");
228  AddPhysicsList("QGSP_BERT");
229 
230  } else if (name == "QGSP_BERT_EMX") {
231 
232  AddPhysicsList("emstandard_opt2");
233  AddPhysicsList("QGSP_BERT");
234 
235  } else if (name == "QGSP_BERT_HP") {
236 
237  SetBuilderList1(true);
238  fHadronPhys.push_back( new G4HadronPhysicsQGSP_BERT_HP());
239 
240  } else if (name == "QGSP_BIC") {
241 
242  SetBuilderList0();
243  fHadronPhys.push_back( new G4HadronPhysicsQGSP_BIC());
244 
245  } else if (name == "QGSP_BIC_EMY") {
246 
247  AddPhysicsList("emstandard_opt3");
248  SetBuilderList0();
249  fHadronPhys.push_back( new G4HadronPhysicsQGSP_BIC());
250 
251  } else if (name == "QGS_BIC") {
252 
253  SetBuilderList0();
254  fHadronPhys.push_back( new G4HadronPhysicsQGS_BIC());
255  fHadronPhys.push_back( new G4NeutronCrossSectionXS(verboseLevel));
256 
257  } else if (name == "QGSP_BIC_HP") {
258 
259  SetBuilderList0(true);
260  fHadronPhys.push_back( new G4HadronPhysicsQGSP_BIC_HP());
261 
262  } else {
263 
264  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
265  << " is not defined"
266  << G4endl;
267  }
268 }
269 
270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
271 
272 void PhysicsList::SetBuilderList0(G4bool flagHP)
273 {
274  fHadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
275  if(flagHP) {
276  fHadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel) );
277  } else {
278  fHadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel) );
279  }
280  fHadronPhys.push_back( new G4StoppingPhysics(verboseLevel));
281  fHadronPhys.push_back( new G4IonBinaryCascadePhysics(verboseLevel));
282  fHadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
283 }
284 
285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
286 
287 void PhysicsList::SetBuilderList1(G4bool flagHP)
288 {
289  fHadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
290  if(flagHP) {
291  fHadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel) );
292  } else {
293  fHadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel) );
294  }
295  fHadronPhys.push_back( new G4StoppingPhysics(verboseLevel));
296  fHadronPhys.push_back( new G4IonPhysics(verboseLevel));
297  fHadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
298 }
299 
300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
301 
302 void PhysicsList::SetBuilderList2()
303 {
304  fHadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
305  fHadronPhys.push_back( new G4HadronElasticPhysicsXS(verboseLevel) );
306  fHadronPhys.push_back( new G4StoppingPhysics(verboseLevel));
307  fHadronPhys.push_back( new G4IonPhysics(verboseLevel));
308  fHadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
309 }
310 
311 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
312 
314 {
315 
316  if (verboseLevel >0){
317  G4cout << "PhysicsList::SetCuts:";
318  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
319  }
320 
321  // set cut values for gamma at first and for e- second and next for e+,
322  // because some processes for e+/e- need cut values for gamma
323  SetCutValue(fCutForGamma, "gamma");
324  SetCutValue(fCutForElectron, "e-");
325  SetCutValue(fCutForPositron, "e+");
326  SetCutValue(fCutForProton, "proton");
327 
328  if (verboseLevel>0) { DumpCutValuesTable(); }
329 }
330 
331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
332 
334 {
335  fCutForGamma = cut;
336  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
337 }
338 
339 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
340 
342 {
343  fCutForElectron = cut;
344  SetParticleCuts(fCutForElectron, G4Electron::Electron());
345 }
346 
347 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
348 
350 {
351  fCutForPositron = cut;
352  SetParticleCuts(fCutForPositron, G4Positron::Positron());
353 }
354 
355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
356 
358 {
359  fCutForProton = cut;
360  SetParticleCuts(fCutForProton, G4Proton::Proton());
361 }
362 
364 {
365  G4cout << "### PhysicsLists available: FTFP_BERT FTFP_BERT_EMV "
366  << "FTFP_BERT_EMX FTFP_BERT_EMZ"
367  << G4endl;
368  G4cout << " FTF_BIC QBBC QGSP_BERT "
369  << "QGSP_BERT_EMV QGSP_BERT_EMX"
370  << G4endl;
371  G4cout << " QGSP_BERT_HP QGSP_FTFP_BERT "
372  << "QGSP_FTFP_BERT_EMV"
373  << G4endl;
374  G4cout << " QGS_BIC QGSP_BIC QGSP_BIC_EMY "
375  << "QGSP_BIC_HP"
376  << G4endl;
377 }
378 
379 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
380 
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
const XML_Char * name
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4Positron * Positron()
Definition: G4Positron.cc:94
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76