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

, generated on Tue Sep 26 2023.