MdGroundPropagatorAG/PhysicsList.cc
Go to the documentation of this file.
1 // Taken directly from G4 sources //
3 #include "PhysicsList.h"
4 #include "PhysicsListMessenger.h"
6 #include <G4DecayPhysics.hh>
7 #include <G4EmStandardPhysics.hh>
8 #include <G4EmStandardPhysics_option1.hh>
9 #include <G4EmStandardPhysics_option2.hh>
10 #include <G4EmStandardPhysics_option3.hh>
11 #include <G4EmLivermorePhysics.hh>
12 #include <G4EmPenelopePhysics.hh>
13 #include <G4HadronElasticPhysics.hh>
14 #include <G4HadronElasticPhysicsXS.hh>
15 #include <G4HadronElasticPhysicsHP.hh>
16 #include <G4HadronElasticPhysicsLHEP.hh>
17 #include <G4HadronQElasticPhysics.hh>
18 #include <G4ChargeExchangePhysics.hh>
19 #include <G4NeutronTrackingCut.hh>
20 #include <G4NeutronCrossSectionXS.hh>
21 #include <G4QStoppingPhysics.hh>
22 #include <G4LHEPStoppingPhysics.hh>
23 #include <G4IonBinaryCascadePhysics.hh>
24 #include <G4IonPhysics.hh>
25 #include <G4EmExtraPhysics.hh>
26 #include <G4EmProcessOptions.hh>
27 
28 #include <HadronPhysicsFTFP_BERT.hh>
29 #include <HadronPhysicsFTF_BIC.hh>
30 #include <HadronPhysicsLHEP.hh>
31 #include <HadronPhysicsLHEP_EMV.hh>
32 #include <G4HadronInelasticQBBC.hh>
33 #include <HadronPhysicsQGSC_BERT.hh>
34 #include <HadronPhysicsQGSP.hh>
35 #include <HadronPhysicsQGSP_BERT.hh>
36 #include <HadronPhysicsQGSP_BERT_HP.hh>
37 #include <HadronPhysicsQGSP_BIC.hh>
38 #include <HadronPhysicsQGSP_BIC_HP.hh>
39 #include <HadronPhysicsQGSP_FTFP_BERT.hh>
40 #include <HadronPhysicsQGS_BIC.hh>
41 
42 #include <G4IonPhysics.hh>
43 
44 #include <G4LossTableManager.hh>
45 
46 #include <G4ProcessManager.hh>
47 #include <G4ParticleTypes.hh>
48 #include <G4ParticleTable.hh>
49 #include <G4Gamma.hh>
50 #include <G4Electron.hh>
51 #include <G4Positron.hh>
52 #include <G4Proton.hh>
53 
54 
55 using namespace GroundPropagatorAG;
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
58 PhysicsList::PhysicsList() : G4VModularPhysicsList()
59 {
60  G4LossTableManager::Instance();
61  defaultCutValue = 0.7*mm;
62  cutForGamma = defaultCutValue;
63  cutForElectron = defaultCutValue;
64  cutForPositron = defaultCutValue;
65  cutForProton = defaultCutValue;
66  verboseLevel = 1;
67 
68  pMessenger = new PhysicsListMessenger(this);
69 
70  // Particles
71  particleList = new G4DecayPhysics("decays");
72 
73  // EM physics
74  emPhysicsList = new G4EmStandardPhysics();
75 }
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
78 
80 {
81  delete pMessenger;
82  delete particleList;
83  delete emPhysicsList;
84  for(size_t i=0; i<hadronPhys.size(); ++i) {
85  delete hadronPhys[i];
86  }
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
90 
92 {
93  particleList->ConstructParticle();
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
97 
99 {
100  AddTransportation();
101  emPhysicsList->ConstructProcess();
102  particleList->ConstructProcess();
103  for(size_t i=0; i<hadronPhys.size(); ++i) {
104  hadronPhys[i]->ConstructProcess();
105  }
106 }
107 
108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
109 
110 void PhysicsList::AddPhysicsList(const G4String& name)
111 {
112  if (verboseLevel>0) {
113  G4cerr << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
114  }
115  if (name == "emstandard_opt2") {
116 
117  delete emPhysicsList;
118  emPhysicsList = new G4EmStandardPhysics_option2();
119 
120  } else if (name == "emstandard_opt3") {
121 
122  delete emPhysicsList;
123  emPhysicsList = new G4EmStandardPhysics_option3();
124 
125  } else if (name == "emstandard_opt1") {
126 
127  delete emPhysicsList;
128  emPhysicsList = new G4EmStandardPhysics_option1();
129 
130  } else if (name == "emstandard_opt0") {
131 
132  delete emPhysicsList;
133  emPhysicsList = new G4EmStandardPhysics();
134 
135  } else if (name == "FTFP_BERT_EMV") {
136 
137  AddPhysicsList("emstandard_opt1");
138  AddPhysicsList("FTFP_BERT");
139 
140  } else if (name == "FTFP_BERT_EMX") {
141 
142  AddPhysicsList("emstandard_opt2");
143  AddPhysicsList("FTFP_BERT");
144 
145  } else if (name == "FTFP_BERT") {
146 
147  SetBuilderList1();
148  hadronPhys.push_back( new HadronPhysicsFTFP_BERT());
149 
150  } else if (name == "FTF_BIC") {
151 
152  SetBuilderList0();
153  hadronPhys.push_back( new HadronPhysicsFTF_BIC());
154  hadronPhys.push_back( new G4NeutronCrossSectionXS(verboseLevel));
155 
156  } else if (name == "LHEP") {
157 
158  SetBuilderList2();
159  hadronPhys.push_back( new HadronPhysicsLHEP());
160 
161  } else if (name == "LHEP_EMV") {
162 
163  AddPhysicsList("emstandard_opt1");
164  SetBuilderList2(true);
165  hadronPhys.push_back( new HadronPhysicsLHEP_EMV());
166 
167  } else if (name == "QBBC") {
168 
169  AddPhysicsList("emstandard_opt2");
170  SetBuilderList3();
171  hadronPhys.push_back( new G4HadronInelasticQBBC());
172 
173  } else if (name == "QGSC_BERT") {
174 
175  SetBuilderList4();
176  hadronPhys.push_back( new HadronPhysicsQGSC_BERT());
177 
178  } else if (name == "QGSP") {
179 
180  SetBuilderList1();
181  hadronPhys.push_back( new HadronPhysicsQGSP());
182 
183  } else if (name == "QGSP_BERT") {
184 
185  SetBuilderList1();
186  hadronPhys.push_back( new HadronPhysicsQGSP_BERT());
187 
188  } else if (name == "QGSP_FTFP_BERT") {
189 
190  SetBuilderList1();
191  hadronPhys.push_back( new HadronPhysicsQGSP_FTFP_BERT());
192 
193  } else if (name == "QGSP_BERT_EMV") {
194 
195  AddPhysicsList("emstandard_opt1");
196  AddPhysicsList("QGSP_BERT");
197 
198  } else if (name == "QGSP_BERT_EMX") {
199 
200  AddPhysicsList("emstandard_opt2");
201  AddPhysicsList("QGSP_BERT");
202 
203  } else if (name == "QGSP_BERT_HP") {
204 
205  SetBuilderList1(true);
206  hadronPhys.push_back( new HadronPhysicsQGSP_BERT_HP());
207 
208  } else if (name == "QGSP_BIC") {
209 
210  SetBuilderList0();
211  hadronPhys.push_back( new HadronPhysicsQGSP_BIC());
212 
213  } else if (name == "QGSP_BIC_EMY") {
214 
215  AddPhysicsList("emstandard_opt3");
216  SetBuilderList0();
217  hadronPhys.push_back( new HadronPhysicsQGSP_BIC());
218 
219  } else if (name == "QGS_BIC") {
220 
221  SetBuilderList0();
222  hadronPhys.push_back( new HadronPhysicsQGS_BIC());
223  hadronPhys.push_back( new G4NeutronCrossSectionXS(verboseLevel));
224 
225  } else if (name == "QGSP_BIC_HP") {
226 
227  SetBuilderList0(true);
228  hadronPhys.push_back( new HadronPhysicsQGSP_BIC_HP());
229 
230  } else {
231 
232  G4cerr << "PhysicsList::AddPhysicsList: <" << name << ">"
233  << " is not defined"
234  << G4endl;
235  }
236 }
237 
238 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
239 
240 void PhysicsList::SetBuilderList0(G4bool flagHP)
241 {
242  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
243  if(flagHP) {
244  hadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel) );
245  } else {
246  hadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel) );
247  }
248  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
249  hadronPhys.push_back( new G4IonBinaryCascadePhysics(verboseLevel));
250  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
251 }
252 
253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
254 
255 void PhysicsList::SetBuilderList1(G4bool flagHP)
256 {
257  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
258  if(flagHP) {
259  hadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel) );
260  } else {
261  hadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel) );
262  }
263  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
264  hadronPhys.push_back( new G4IonPhysics(verboseLevel));
265  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
266 }
267 
268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
269 
270 void PhysicsList::SetBuilderList2(G4bool addStopping)
271 {
272  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
273  hadronPhys.push_back( new G4HadronElasticPhysicsLHEP(verboseLevel));
274  if(addStopping) { hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel)); }
275  hadronPhys.push_back( new G4IonPhysics(verboseLevel));
276 }
277 
278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
279 
281 {
282  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
283  RegisterPhysics( new G4HadronElasticPhysicsXS(verboseLevel) );
284  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
285  hadronPhys.push_back( new G4IonBinaryCascadePhysics(verboseLevel));
286  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
287 }
288 
289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
290 
292 {
293  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
294  hadronPhys.push_back( new G4HadronQElasticPhysics(verboseLevel));
295  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
296  hadronPhys.push_back( new G4IonPhysics(verboseLevel));
297  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
298 }
299 
300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
301 
303 {
304 
305  if (verboseLevel >0) {
306  G4cerr << "PhysicsList::SetCuts:";
307  G4cerr << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
308  }
309 
310  // set cut values for gamma at first and for e- second and next for e+,
311  // because some processes for e+/e- need cut values for gamma
312  SetCutValue(cutForGamma, "gamma");
313  SetCutValue(cutForElectron, "e-");
314  SetCutValue(cutForPositron, "e+");
315  SetCutValue(cutForProton, "proton");
316 
317  if (verboseLevel>0)
318  DumpCutValuesTable();
319 }
320 
321 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
322 
323 void PhysicsList::SetCutForGamma(G4double cut)
324 {
325  cutForGamma = cut;
326  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
327 }
328 
329 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
330 
332 {
333  cutForElectron = cut;
334  SetParticleCuts(cutForElectron, G4Electron::Electron());
335 }
336 
337 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
338 
340 {
341  cutForPositron = cut;
342  SetParticleCuts(cutForPositron, G4Positron::Positron());
343 }
344 
345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
346 
348 {
349  cutForProton = cut;
350  SetParticleCuts(cutForProton, G4Proton::Proton());
351 }
352 
354 {
355  G4cerr << "### PhysicsLists available: FTFP_BERT FTFP_BERT_EMV FTFP_BERT_EMX FTF_BIC"
356  << G4endl;
357  G4cerr << " LHEP LHEP_EMV QBBC QGS_BIC QGSP"
358  << G4endl;
359  G4cerr << " QGSC_BERT QGSP_BERT QGSP_BERT_EMV QGSP_BIC_EMY"
360  << G4endl;
361  G4cerr << " QGSP_BERT_EMX QGSP_BERT_HP QGSP_BIC QGSP_BIC_HP"
362  << G4endl;
363 }
364 
365 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
366 
constexpr double mm
Definition: AugerUnits.h:113
void SetBuilderList2(G4bool addStopping=false)
std::vector< G4VPhysicsConstructor * > hadronPhys

, generated on Tue Sep 26 2023.