BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSModularPhysicsList.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "BDSDebug.hh"
20#include "BDSException.hh"
21#include "BDSGlobalConstants.hh"
22#include "BDSIonDefinition.hh"
23#include "BDSModularPhysicsList.hh"
24#include "BDSParticleDefinition.hh"
25#include "BDSPhysicalConstants.hh"
26#include "BDSPhysicsAnnihiToMuMu.hh"
27#include "BDSPhysicsCherenkov.hh"
28#include "BDSPhysicsCutsAndLimits.hh"
29#include "BDSPhysicsEMDissociation.hh"
30#include "BDSPhysicsGammaToMuMu.hh"
31#include "BDSPhysicsIonisation.hh"
32#include "BDSPhysicsLaserWire.hh"
33#include "BDSPhysicsMuon.hh"
34#include "BDSPhysicsMuonInelastic.hh"
35#include "BDSPhysicsSynchRad.hh"
36#include "BDSPhysicsUtilities.hh"
37#include "BDSUtilities.hh"
38#include "BDSPhysicsLaserPhotoDetachment.hh"
39#include "BDSPhysicsLaserIonExcitation.hh"
40#include "BDSPhysicsLaserComptonScattering.hh"
41#include "BDSPhysicsLaserCumulativePhotodetachment.hh"
42#include "BDSPhysicsLaserCumulativeCompton.hh"
43#include "BDSPhysicsLaserWire.hh"
44#include "BDSPhysicsMuon.hh"
45#include "BDSPhysicsSynchRad.hh"
46#include "BDSPhysicsUtilities.hh"
47#include "BDSUtilities.hh"
48
49#include "parser/fastlist.h"
50#include "parser/physicsbiasing.h"
51
52// general geant4
53#include "globals.hh"
54#include "G4GenericBiasingPhysics.hh"
55#include "G4ParticleTable.hh"
56#include "G4ProcessManager.hh"
57#include "G4ProcessVector.hh"
58#include "G4String.hh"
59#include "G4Version.hh"
60
61// physics processes / builders (assumed Geant4.10.0 and upwards)
62#include "G4ChargeExchangePhysics.hh"
63#include "G4DecayPhysics.hh"
64#include "G4EmExtraPhysics.hh"
65#include "G4EmLivermorePhysics.hh"
66#include "G4EmLivermorePolarizedPhysics.hh"
67#include "G4EmLowEPPhysics.hh"
68#include "G4EmPenelopePhysics.hh"
69#include "G4EmStandardPhysics.hh"
70#include "G4EmStandardPhysicsSS.hh"
71#include "G4EmStandardPhysicsWVI.hh"
72#include "G4EmStandardPhysics_option1.hh"
73#include "G4EmStandardPhysics_option2.hh"
74#include "G4EmStandardPhysics_option3.hh"
75#include "G4EmStandardPhysics_option4.hh"
76#include "G4HadronDElasticPhysics.hh"
77#include "G4HadronElasticPhysics.hh"
78#include "G4HadronElasticPhysicsHP.hh"
79#include "G4HadronElasticPhysicsLEND.hh"
80#include "G4HadronElasticPhysicsXS.hh"
81#include "G4HadronHElasticPhysics.hh"
82#include "G4HadronPhysicsFTFP_BERT.hh"
83#include "G4HadronPhysicsFTFP_BERT_HP.hh"
84#include "G4HadronPhysicsFTF_BIC.hh"
85#include "G4HadronPhysicsQGSP_BERT.hh"
86#include "G4HadronPhysicsQGSP_BERT_HP.hh"
87#include "G4HadronPhysicsQGSP_BIC.hh"
88#include "G4HadronPhysicsQGSP_BIC_HP.hh"
89#include "G4HadronPhysicsShielding.hh"
90#include "G4IonBinaryCascadePhysics.hh"
91#include "G4IonElasticPhysics.hh"
92#include "G4IonINCLXXPhysics.hh"
93#include "G4IonPhysics.hh"
94#include "G4IonQMDPhysics.hh"
95#include "G4NeutronTrackingCut.hh"
96#include "G4OpticalPhysics.hh"
97#include "G4RadioactiveDecayPhysics.hh"
98#include "G4StoppingPhysics.hh"
99#include "G4SynchrotronRadiation.hh"
100
101// version specific physics lists
102#if G4VERSION_NUMBER > 1009
103#include "G4HadronElasticPhysicsPHP.hh"
104#endif
105
106#if G4VERSION_NUMBER > 1019
107#include "G4EmStandardPhysicsGS.hh"
108#include "G4EmDNAChemistry.hh"
109#endif
110
111#if G4VERSION_NUMBER > 1020
112#include "G4SpinDecayPhysics.hh"
113#endif
114
115#if G4VERSION_NUMBER > 1022
116#include "G4IonPhysicsPHP.hh"
117#endif
118
119#if G4VERSION_NUMBER > 1029
120#include "G4MuonicAtomDecayPhysics.hh"
121#endif
122
123#if G4VERSION_NUMBER > 1039
124#include "BDSPhysicsChannelling.hh"
125#include "BDSPhysicsRadioactivation.hh"
126#include "G4EmDNAPhysics.hh"
127#include "G4EmDNAPhysics_option1.hh"
128#include "G4EmDNAPhysics_option2.hh"
129#include "G4EmDNAPhysics_option3.hh"
130#include "G4EmDNAPhysics_option4.hh"
131#include "G4EmDNAPhysics_option5.hh"
132#include "G4EmDNAPhysics_option6.hh"
133#include "G4EmDNAPhysics_option7.hh"
134#include "G4HadronPhysicsShieldingLEND.hh"
135#endif
136
137#if G4VERSION_NUMBER < 1070
138#include "G4OpticalProcessIndex.hh"
139#else
140#include "G4OpticalParameters.hh"
141#endif
142
143#if G4VERSION_NUMBER > 1069
144#include "G4EmDNAChemistry_option1.hh"
145#include "G4EmDNAChemistry_option2.hh"
146#include "G4EmDNAChemistry_option3.hh"
147#endif
148
149#if G4VERSION_NUMBER > 1119
150#include "BDSPhysicsXrayReflection.hh"
151#endif
152
153// particles
154#include "G4AntiNeutrinoE.hh"
155#include "G4AntiNeutron.hh"
156#include "G4AntiProton.hh"
157#include "G4BaryonConstructor.hh"
158#include "G4Electron.hh"
159#include "G4Gamma.hh"
160#include "G4IonConstructor.hh"
161#include "G4LeptonConstructor.hh"
162#include "G4MesonConstructor.hh"
163#include "G4NeutrinoE.hh"
164#include "G4Neutron.hh"
165#include "G4Positron.hh"
166#include "G4Proton.hh"
167#include "G4ShortLivedConstructor.hh"
168
169#include <iomanip>
170#include <iterator>
171#include <limits>
172#include <map>
173#include <ostream>
174#include <string>
175#include <sstream>
176#include <utility>
177#include <vector>
178
179BDSModularPhysicsList::BDSModularPhysicsList(const G4String& physicsList):
180 constructedAllLeptons(false),
181 constructedAllShortLived(false),
182 constructedAllMesons(false),
183 constructedAllBaryons(false),
184 constructedAllIons(false),
185 temporaryName(""),
186 opticalPhysics(nullptr),
187 emWillBeUsed(false),
188 usingIons(false),
189 particlesConstructed(false)
190{
192
193 SetVerboseLevel(1);
194
195 physicsConstructors.insert(std::make_pair("all_particles", &BDSModularPhysicsList::AllParticles));
196 physicsConstructors.insert(std::make_pair("annihi_to_mumu", &BDSModularPhysicsList::AnnihiToMuMu));
197 physicsConstructors.insert(std::make_pair("charge_exchange", &BDSModularPhysicsList::ChargeExchange));
198 physicsConstructors.insert(std::make_pair("cherenkov", &BDSModularPhysicsList::Cherenkov));
199 physicsConstructors.insert(std::make_pair("cuts_and_limits", &BDSModularPhysicsList::CutsAndLimits));
200 physicsConstructors.insert(std::make_pair("decay", &BDSModularPhysicsList::Decay));
201 physicsConstructors.insert(std::make_pair("decay_radioactive", &BDSModularPhysicsList::DecayRadioactive));
202 physicsConstructors.insert(std::make_pair("em", &BDSModularPhysicsList::Em));
203 physicsConstructors.insert(std::make_pair("em_extra", &BDSModularPhysicsList::EmExtra));
204 physicsConstructors.insert(std::make_pair("em_livermore", &BDSModularPhysicsList::EmLivermore));
205 physicsConstructors.insert(std::make_pair("em_livermore_polarised", &BDSModularPhysicsList::EmLivermorePolarised));
206 physicsConstructors.insert(std::make_pair("em_low_ep", &BDSModularPhysicsList::EmLowEP));
207 physicsConstructors.insert(std::make_pair("em_penelope", &BDSModularPhysicsList::EmPenelope));
208 physicsConstructors.insert(std::make_pair("em_ss", &BDSModularPhysicsList::EmSS));
209 physicsConstructors.insert(std::make_pair("em_wvi", &BDSModularPhysicsList::EmWVI));
210 physicsConstructors.insert(std::make_pair("em_1", &BDSModularPhysicsList::Em1));
211 physicsConstructors.insert(std::make_pair("em_2", &BDSModularPhysicsList::Em2));
212 physicsConstructors.insert(std::make_pair("em_3", &BDSModularPhysicsList::Em3));
213 physicsConstructors.insert(std::make_pair("em_4", &BDSModularPhysicsList::Em4));
214 physicsConstructors.insert(std::make_pair("ftfp_bert", &BDSModularPhysicsList::FTFPBERT));
215 physicsConstructors.insert(std::make_pair("ftfp_bert_hp", &BDSModularPhysicsList::FTFPBERTHP));
216 physicsConstructors.insert(std::make_pair("ftf_bic", &BDSModularPhysicsList::FTFBIC));
217 physicsConstructors.insert(std::make_pair("gamma_to_mumu", &BDSModularPhysicsList::GammaToMuMu));
218 physicsConstructors.insert(std::make_pair("hadronic_elastic", &BDSModularPhysicsList::HadronicElastic));
219 physicsConstructors.insert(std::make_pair("hadronic_elastic_d", &BDSModularPhysicsList::HadronicElasticD));
220 physicsConstructors.insert(std::make_pair("hadronic_elastic_h", &BDSModularPhysicsList::HadronicElasticH));
221 physicsConstructors.insert(std::make_pair("hadronic_elastic_hp", &BDSModularPhysicsList::HadronicElasticHP));
222 physicsConstructors.insert(std::make_pair("hadronic_elastic_lend", &BDSModularPhysicsList::HadronicElasticLEND));
223 physicsConstructors.insert(std::make_pair("hadronic_elastic_xs", &BDSModularPhysicsList::HadronicElasticXS));
224 physicsConstructors.insert(std::make_pair("ion", &BDSModularPhysicsList::Ion));
225 physicsConstructors.insert(std::make_pair("ion_binary", &BDSModularPhysicsList::IonBinary));
226 physicsConstructors.insert(std::make_pair("ion_elastic", &BDSModularPhysicsList::IonElastic));
227 physicsConstructors.insert(std::make_pair("ion_elastic_qmd", &BDSModularPhysicsList::IonElasticQMD));
228 physicsConstructors.insert(std::make_pair("ion_em_dissociation", &BDSModularPhysicsList::IonEMDissociation));
229 physicsConstructors.insert(std::make_pair("ion_inclxx", &BDSModularPhysicsList::IonINCLXX));
230 physicsConstructors.insert(std::make_pair("ionisation", &BDSModularPhysicsList::Ionisation));
231 physicsConstructors.insert(std::make_pair("lw", &BDSModularPhysicsList::LaserWire));
232 physicsConstructors.insert(std::make_pair("laser_photo_detachment", &BDSModularPhysicsList::LaserPhotoDetachment));
233 physicsConstructors.insert(std::make_pair("laser_compton_scattering", &BDSModularPhysicsList::LaserComptonScattering));
234 physicsConstructors.insert(std::make_pair("laser_cumulative_photo_detachment", &BDSModularPhysicsList::LaserCumulativePhotoDetachment));
235 physicsConstructors.insert(std::make_pair("laser_cumulative_compton_scattering", &BDSModularPhysicsList::LaserCumulativeCompton));
236 physicsConstructors.insert(std::make_pair("laser_ion_excitation", &BDSModularPhysicsList::LaserIonExcitation));
237 physicsConstructors.insert(std::make_pair("muon", &BDSModularPhysicsList::Muon));
238 physicsConstructors.insert(std::make_pair("muon_inelastic", &BDSModularPhysicsList::MuonInelastic));
239 physicsConstructors.insert(std::make_pair("neutron_tracking_cut", &BDSModularPhysicsList::NeutronTrackingCut));
240 physicsConstructors.insert(std::make_pair("optical", &BDSModularPhysicsList::Optical));
241 physicsConstructors.insert(std::make_pair("qgsp_bert", &BDSModularPhysicsList::QGSPBERT));
242 physicsConstructors.insert(std::make_pair("qgsp_bert_hp", &BDSModularPhysicsList::QGSPBERTHP));
243 physicsConstructors.insert(std::make_pair("qgsp_bic", &BDSModularPhysicsList::QGSPBIC));
244 physicsConstructors.insert(std::make_pair("qgsp_bic_hp", &BDSModularPhysicsList::QGSPBICHP));
245 physicsConstructors.insert(std::make_pair("shielding", &BDSModularPhysicsList::Shielding));
246 physicsConstructors.insert(std::make_pair("stopping", &BDSModularPhysicsList::Stopping));
247 physicsConstructors.insert(std::make_pair("synch_rad", &BDSModularPhysicsList::SynchRad));
248#if G4VERSION_NUMBER > 1019
249 physicsConstructors.insert(std::make_pair("em_gs", &BDSModularPhysicsList::EmGS));
250 physicsConstructors.insert(std::make_pair("dna_chemistry", &BDSModularPhysicsList::DNAChemistry));
251#endif
252#if G4VERSION_NUMBER > 1020
253 physicsConstructors.insert(std::make_pair("decay_spin", &BDSModularPhysicsList::DecaySpin));
254#endif
255#if G4VERSION_NUMBER > 1022
256 physicsConstructors.insert(std::make_pair("ion_php", &BDSModularPhysicsList::IonPHP));
257#endif
258#if G4VERSION_NUMBER > 1029
259 physicsConstructors.insert(std::make_pair("decay_muonic_atom", &BDSModularPhysicsList::DecayMuonicAtom));
260#endif
261#if G4VERSION_NUMBER > 1039
262 physicsConstructors.insert(std::make_pair("channelling", &BDSModularPhysicsList::Channelling));
263 physicsConstructors.insert(std::make_pair("dna", &BDSModularPhysicsList::DNA));
264 physicsConstructors.insert(std::make_pair("dna_1", &BDSModularPhysicsList::DNA));
265 physicsConstructors.insert(std::make_pair("dna_2", &BDSModularPhysicsList::DNA));
266 physicsConstructors.insert(std::make_pair("dna_3", &BDSModularPhysicsList::DNA));
267 physicsConstructors.insert(std::make_pair("dna_4", &BDSModularPhysicsList::DNA));
268 physicsConstructors.insert(std::make_pair("dna_5", &BDSModularPhysicsList::DNA));
269 physicsConstructors.insert(std::make_pair("dna_6", &BDSModularPhysicsList::DNA));
270 physicsConstructors.insert(std::make_pair("dna_7", &BDSModularPhysicsList::DNA));
271 physicsConstructors.insert(std::make_pair("radioactivation", &BDSModularPhysicsList::Radioactivation));
272 physicsConstructors.insert(std::make_pair("shielding_lend", &BDSModularPhysicsList::ShieldingLEND));
273#endif
274#if G4VERSION_NUMBER > 1069
275 physicsConstructors.insert(std::make_pair("dna_chemistry_1", &BDSModularPhysicsList::DNAChemistry));
276 physicsConstructors.insert(std::make_pair("dna_chemistry_2", &BDSModularPhysicsList::DNAChemistry));
277 physicsConstructors.insert(std::make_pair("dna_chemistry_3", &BDSModularPhysicsList::DNAChemistry));
278#endif
279#if G4VERSION_NUMBER > 1119
280 physicsConstructors.insert(std::make_pair("xray_reflection", &BDSModularPhysicsList::XrayReflection));
281#endif
282
283 // old names and aliases
284 aliasToOriginal["cerenkov"] = "cherenkov";
285 aliasToOriginal["cutsandlimits"] = "cuts_and_limits";
286 aliasToOriginal["em_low"] = "em_penelope";
287 aliasToOriginal["hadronic"] = "ftfp_bert";
288 aliasToOriginal["hadronic_hp"] = "ftfp_bert_hp";
289 aliasToOriginal["ionbinary"] = "ion_binary";
290 aliasToOriginal["ioninclxx"] = "ion_inclxx";
291 aliasToOriginal["ionphp"] = "ion_php";
292 aliasToOriginal["spindecay"] = "decay_spin";
293 aliasToOriginal["synchrad"] = "synch_rad";
294#if G4VERSION_NUMBER > 1039
295 aliasToOriginal["channeling"] = "channelling";
296#endif
297
298 // prepare vector of valid names for searching when parsing physics list string
299 for (const auto& constructor : physicsConstructors)
300 {
301 physicsLists.emplace_back(constructor.first);
302 physicsActivated[constructor.first] = false;
303 }
304
305 // setup a list of incompatible physics lists for each one - mostly based on experience
306 // initialise all to empty vectors and specify only ones that have some incompatible physics lists
307 for (const auto& kv : physicsConstructors)
308 {incompatible.insert(std::make_pair(kv.first, std::vector<G4String>()));}
309 incompatible["annihi_to_mumu"] = {"em_extra"};
310 incompatible["muon"] = {"em_extra"};
311 incompatible["muon_inelastic"] = {"em_extra", "muon"};
312 incompatible["dna"] = {"dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
313 incompatible["dna_1"] = {"dna", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
314 incompatible["dna_2"] = {"dna_1", "dna", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
315 incompatible["dna_3"] = {"dna_1", "dna_2", "dna", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
316 incompatible["dna_4"] = {"dna_1", "dna_2", "dna_3", "dna", "dna_5", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
317 incompatible["dna_5"] = {"dna_1", "dna_2", "dna_3", "dna_4", "dna", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
318 incompatible["dna_6"] = {"dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna", "dna_7", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
319 incompatible["dna_7"] = {"dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna", "dna_chemistry", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
320 incompatible["dna_chemistry"] = {"dna", "dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry_3"};
321 incompatible["dna_chemistry_1"] = {"dna", "dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry", "dna_chemistry_2", "dna_chemistry_3"};
322 incompatible["dna_chemistry_2"] = {"dna", "dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry_1", "dna_chemistry", "dna_chemistry_3"};
323 incompatible["dna_chemistry_3"] = {"dna", "dna_1", "dna_2", "dna_3", "dna_4", "dna_5", "dna_6", "dna_7", "dna_chemistry_1", "dna_chemistry_2", "dna_chemistry"};
324 incompatible["em"] = {"em_ss", "em_wvi", "em_1", "em_2", "em_3", "em_4"};
325 incompatible["em_ss"] = {"em", "em_wvi", "em_1", "em_2", "em_3", "em_4"};
326 incompatible["em_wvi"] = {"em", "em_ss", "em_1", "em_2", "em_3", "em_4"};
327 incompatible["em_1"] = {"em", "em_ss", "em_wvi", "em_2", "em_3", "em_4"};
328 incompatible["em_2"] = {"em", "em_ss", "em_wvi", "em_1", "em_3", "em_4"};
329 incompatible["em_3"] = {"em", "em_ss", "em_wvi", "em_1", "em_2", "em_4"};
330 incompatible["em_4"] = {"em", "em_ss", "em_wvi", "em_1", "em_2", "em_3"};
331 incompatible["em_livermore"] = {"em_livermore_polarised"};
332 incompatible["em_extra"] = {"muon", "muon_inelastic"};
333 incompatible["ftfp_bert"] = {"ftfp_bert_hp", "ftf_bic", "qgsp_bert", "qgsp_bert_hp", "qgsp_bic", "qgsp_bic_hp"};
334 incompatible["ftfp_bert_hp"] = {"ftfp_bert", "ftf_bic", "qgsp_bert", "qgsp_bert_hp", "qgsp_bic", "qgsp_bic_hp"};
335 incompatible["ftf_bic"] = {"ftfp_bert", "ftfp_bert_hp", "qgsp_bert", "qgsp_bert_hp", "qgsp_bic", "qgsp_bic_hp"};
336 incompatible["gamma_to_mumu"] = {"em_extra"};
337 incompatible["hadronic_elastic"] = {"hadronic_elastic_d", "hadronic_elastic_h", "hadronic_elastic_hp", "hadronic_elastic_lend", "hadronic_elastic_xs"};
338 incompatible["hadronic_elastic_d"] = {"hadronic_elastic", "hadronic_elastic_h", "hadronic_elastic_hp", "hadronic_elastic_lend", "hadronic_elastic_xs"};
339 incompatible["hadronic_elastic_h"] = {"hadronic_elastic", "hadronic_elastic_d", "hadronic_elastic_hp", "hadronic_elastic_lend", "hadronic_elastic_xs"};
340 incompatible["hadronic_elastic_hp"] = {"hadronic_elastic", "hadronic_elastic_d", "hadronic_elastic_h", "hadronic_elastic_lend", "hadronic_elastic_xs"};
341 incompatible["hadronic_elastic_lend"] = {"hadronic_elastic", "hadronic_elastic_d", "hadronic_elastic_h", "hadronic_elastic_hp", "hadronic_elastic_xs"};
342 incompatible["hadronic_elastic_xs"] = {"hadronic_elastic", "hadronic_elastic_d", "hadronic_elastic_h", "hadronic_elastic_hp", "hadronic_elastic_lend"};
343 incompatible["ion_elastic"] = {"ion_elastic_qmd"};
344 incompatible["ionisation"] = {"em", "em_ss", "em_1", "em_2", "em_3", "em_4", "em_livermore"};
345 incompatible["qgsp_bert"] = {"ftfp_bert", "ftfp_bert_hp", "ftf_bic", "qgsp_bert_hp", "qgsp_bic", "qgsp_bic_hp"};
346 incompatible["qgsp_bert_hp"] = {"ftfp_bert", "ftfp_bert_hp", "ftf_bic", "qgsp_bert", "qgsp_bic", "qgsp_bic_hp"};
347 incompatible["qgsp_bic"] = {"ftfp_bert", "ftfp_bert_hp", "ftf_bic", "qgsp_bert", "qgsp_bert_hp", "qgsp_bic_hp"};
348 incompatible["qgsp_bic_hp"] = {"ftfp_bert", "ftfp_bert_hp", "ftf_bic", "qgsp_bert", "qgsp_bert_hp", "qgsp_bic"};
349
350#if G4VERSION_NUMBER > 1019
351 for (const auto& name : {"em", "em_ss", "em_wvi", "em_1", "em_2", "em_3", "em_4"})
352 {incompatible[name].emplace_back("em_gs");}
353 incompatible["em_gs"] = {"em", "em_ss", "em_wvi", "em_1", "em_2", "em_3", "em_4"};
354#endif
355#if G4VERSION_NUMBER > 1020
356 incompatible["decay"].emplace_back("decay_spin"); // append for safety in future
357 incompatible["decay_spin"] = {"decay"};
358#endif
359#if G4VERSION_NUMBER > 1039
360 incompatible["shielding"].emplace_back("shielding_lend");
361 incompatible["shielding_lend"] = {"shielding"};
362#endif
363
364 ParsePhysicsList(physicsList);
365 ConfigurePhysics();
366
367 // register the physics constructors with base class mechanics.
368 for (auto physics : constructors)
369 {RegisterPhysics(physics);}
370
371#ifdef BDSDEBUG
372 if (true)
373#else
374 if (globals->Verbose())
375#endif
376 {Print();}
377}
378
379BDSModularPhysicsList::~BDSModularPhysicsList()
380{;}
381
383{
384 if (particlesConstructed)
385 {return;}
387 G4VModularPhysicsList::ConstructParticle();
388 particlesConstructed = true;
389}
390
392{
393 G4VModularPhysicsList::ConstructProcess();
394 DumpCutValuesTable(100);
395}
396
398{
399 for (const auto& physics : physicsActivated)
400 {
401 G4String result = (physics.second ? "active" : "inactive");
402 G4cout << std::setw(27) << ("\"" + physics.first + "\": ") << result << G4endl;
403 }
404}
405
406void BDSModularPhysicsList::ParsePhysicsList(const G4String& physListName)
407{
408#ifdef BDSDEBUG
409 G4cout << __METHOD_NAME__ << "Physics list string: \"" << physListName << "\"" << G4endl;
410#endif
411 // string stream to vector will take a single string that contains words
412 // delimited by whitespace and split them on the whitespace
413 std::stringstream ss(physListName);
414 std::istream_iterator<std::string> begin(ss);
415 std::istream_iterator<std::string> end;
416 std::vector<std::string> physicsListNamesS(begin, end);
417
418 // convert to G4String for lower case convenience
419 std::vector<G4String> physicsListNames;
420 for (const auto& physicsListName : physicsListNamesS)
421 {
422 G4String name = G4String(physicsListName); // convert string to G4String.
423 name = BDS::LowerCase(name);
424 temporaryName = name; // copy to temporary variable
425
426 // search aliases
427 auto result = aliasToOriginal.find(name);
428 if (result != aliasToOriginal.end())
429 {
430 G4cout << __METHOD_NAME__ << "alias \"" << name << "\" forwarding to \""
431 << result->second << "\"" << G4endl;
432 name = result->second; // overwrite name with the correct one
433 }
434 physicsListNames.push_back(name);
435 }
436
437 // search for em physics (could be any order) - needed for different construction of muon phyiscs
438 if (std::find(physicsListNames.begin(), physicsListNames.end(), "em") != physicsListNames.end())
439 {emWillBeUsed = true;}
440
441 for (const auto& name : physicsListNames)
442 {
443 auto result = physicsConstructors.find(name);
444 if (result != physicsConstructors.end())
445 {
446 G4cout << __METHOD_NAME__ << "Constructing \"" << result->first << "\" physics list" << G4endl;
448 auto mem = result->second;
449 (this->*mem)(); // call the function pointer in this instance of the class
450 }
451 else
452 {
453 G4cout << "\"" << name << "\" is not a valid physics list. Available ones are: " << G4endl;
454 for (const auto& listName : physicsLists)
455 {G4cout << "\"" << listName << "\"" << G4endl;}
456 throw BDSException(__METHOD_NAME__, "Invalid physics list.");
457 }
458 }
459
460 //Always load cuts and limits.
462}
463
465{
467 {return;}
468 G4LeptonConstructor::ConstructParticle();
470}
471
473{
475 {return;}
476 G4ShortLivedConstructor::ConstructParticle();
478}
479
481{
483 {return;}
484 G4MesonConstructor::ConstructParticle();
486}
487
489{
491 {return;}
492 G4BaryonConstructor::ConstructParticle();
494}
495
497{
499 {return;}
500 usingIons = true; // all physics lists that use ions call this function so put this here
501 G4GenericIon::GenericIonDefinition();
502 G4IonConstructor::ConstructParticle();
503 constructedAllIons = true;
504}
505
507{
508 if (opticalPhysics)
510}
511
513{
514 G4long maxPhotonsPerStep = globals->MaximumPhotonsPerStep();
515#if G4VERSION_NUMBER < 1079
516 // cherenkov turned on with optical even if it's not on as separate list
517 opticalPhysics->Configure(G4OpticalProcessIndex::kCerenkov, true);
518 opticalPhysics->Configure(G4OpticalProcessIndex::kScintillation, true);
519 opticalPhysics->Configure(G4OpticalProcessIndex::kAbsorption, globals->TurnOnOpticalAbsorption());
520 opticalPhysics->Configure(G4OpticalProcessIndex::kRayleigh, globals->TurnOnRayleighScattering());
521 opticalPhysics->Configure(G4OpticalProcessIndex::kMieHG, globals->TurnOnMieScattering());
522 opticalPhysics->Configure(G4OpticalProcessIndex::kBoundary, globals->TurnOnOpticalSurface());
523 opticalPhysics->Configure(G4OpticalProcessIndex::kWLS, true);
524 opticalPhysics->SetScintillationYieldFactor(globals->ScintYieldFactor());
525 if (maxPhotonsPerStep >= 0)
526 {opticalPhysics->SetMaxNumPhotonsPerStep(maxPhotonsPerStep);}
527#else
528 G4OpticalParameters* opticalParameters = G4OpticalParameters::Instance();
529 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kCerenkov), true);
530 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kScintillation), true);
531 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kAbsorption), globals->TurnOnOpticalAbsorption());
532 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kRayleigh), globals->TurnOnRayleighScattering());
533 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kMieHG), globals->TurnOnMieScattering());
534 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kBoundary), globals->TurnOnOpticalSurface());
535 opticalParameters->SetProcessActivation(G4OpticalProcessName(G4OpticalProcessIndex::kWLS), true);
536 if (maxPhotonsPerStep >= 0)
537 {opticalParameters->SetCerenkovMaxPhotonsPerStep((G4int)maxPhotonsPerStep);}
538#endif
539}
540
541void BDSModularPhysicsList::CheckIncompatiblePhysics(const G4String& singlePhysicsIn) const
542{
543 // no need to check if key is present as we control both maps in the constructor
544 const std::vector<G4String>& forbidden = incompatible.at(singlePhysicsIn);
545
546 for (const auto& key : forbidden)
547 {// for each forbidden physics list, check if it's activated
548 if (physicsActivated.at(key))
549 {
550 G4cerr << __METHOD_NAME__ << "Incompatible physics list \"" << singlePhysicsIn
551 << "\" being used with already used \"" << key << "\"" << G4endl;
552 G4cout << "\"" << singlePhysicsIn << "\" cannot be used with the following:" << G4endl;
553 for (const auto& v : forbidden)
554 {G4cout << "\"" << v << "\"" << G4endl;}
555 throw BDSException(__METHOD_NAME__, "Incompatible physics list.");
556 }
557 }
558}
559
568
570{
571 if (!physicsActivated["annihi_to_mumu"])
572 {
573 constructors.push_back(new BDSPhysicsAnnihiToMuMu());
574 physicsActivated["annihi_to_mumu"] = true;
575 }
576}
577
579{
581 if (!physicsActivated["charge_exchange"])
582 {
583 constructors.push_back(new G4ChargeExchangePhysics());
584 physicsActivated["charge_exchange"] = true;
585 }
586}
587
589{
590 if (!physicsActivated["cherenkov"])
591 {
592 constructors.push_back(new BDSPhysicsCherenkov(BDSGlobalConstants::Instance()->MaximumPhotonsPerStep(),
593 BDSGlobalConstants::Instance()->MaximumBetaChangePerStep()));
594 physicsActivated["cherenkov"] = true;
595 if (!physicsActivated["em"])
596 {Em();} // requires em physics to work (found empirically)
597 }
598}
599
601{
602 if (!physicsActivated["cuts_and_limits"])
603 {
604 constructors.push_back(new BDSPhysicsCutsAndLimits(BDSGlobalConstants::Instance()->ParticlesToExcludeFromCutsAsSet()));
605 physicsActivated["cuts_and_limits"] = true;
606 }
607}
608
610{
611 if (!physicsActivated["decay"])
612 {
613 constructors.push_back(new G4DecayPhysics());
614 physicsActivated["decay"] = true;
615 }
616}
617
619{
620 if (!physicsActivated["decay_radioactive"])
621 {
622 constructors.push_back(new G4RadioactiveDecayPhysics());
623 physicsActivated["decay_radioactive"] = true;
624 }
625}
626
628{
630 if (!physicsActivated["em"])
631 {
632 constructors.push_back(new G4EmStandardPhysics());
633 physicsActivated["em"] = true;
634 }
635}
636
638{
640
641 // These are required by GammaNuclear and MuonNuclear which
642 // are activated by default in G4EmExtraPhysics.
647
648 if (!physicsActivated["em_extra"])
649 {
650 auto constructor = new G4EmExtraPhysics();
651#if G4VERSION_NUMBER > 1019
652 G4bool useMuonNuclear = BDSGlobalConstants::Instance()->UseMuonNuclear();
653 constructor->MuonNuclear(useMuonNuclear);
654 G4cout << __METHOD_NAME__ << "G4EmExtraPhysics> muon nuclear processes : " << BDS::BoolToString(useMuonNuclear) << G4endl;
655#endif
656#if G4VERSION_NUMBER > 1029
657 G4bool useGammaToMuMu = BDSGlobalConstants::Instance()->UseGammaToMuMu();
658 constructor->GammaToMuMu(useGammaToMuMu);
659 G4cout << __METHOD_NAME__ << "G4EmExtraPhysics> gamma to mu mu : " << BDS::BoolToString(useGammaToMuMu) << G4endl;
660 G4bool usePositronToMuMu = BDSGlobalConstants::Instance()->UsePositronToMuMu();
661 constructor->PositronToMuMu(usePositronToMuMu);
662 G4cout << __METHOD_NAME__ << "G4EmExtraPhysics> e+ to mu mu : " << BDS::BoolToString(usePositronToMuMu) << G4endl;
663 G4bool usePositronToHadrons = BDSGlobalConstants::Instance()->UsePositronToHadrons();
664 constructor->PositronToHadrons(usePositronToHadrons);
665 G4cout << __METHOD_NAME__ << "G4EmExtraPhysics> e+ to hadrons : " << BDS::BoolToString(usePositronToHadrons) << G4endl;
666#endif
667#if G4VERSION_NUMBER > 1039
668 G4bool useLENDGammaNuclear = BDSGlobalConstants::Instance()->UseLENDGammaNuclear();
669 if (useLENDGammaNuclear)
670 {
672 constructor->LENDGammaNuclear(true);
673 G4cout << __METHOD_NAME__ << "G4EmExtraPhysics> LEND gamma nuclear : " << BDS::BoolToString(useMuonNuclear) << G4endl;
674 }
675 G4bool useElectroNuclear = BDSGlobalConstants::Instance()->UseElectroNuclear();
676 constructor->ElectroNuclear(useElectroNuclear);
677#endif
678 constructors.push_back(constructor);
679 physicsActivated["em_extra"] = true;
680 }
681}
682
684{
686 if (!physicsActivated["em_livermore"])
687 {
688 constructors.push_back(new G4EmLivermorePhysics());
689 physicsActivated["em_livermore"] = true;
690 }
691}
692
694{
696 if (!physicsActivated["em_livermore_polarised"])
697 {
698 constructors.push_back(new G4EmLivermorePolarizedPhysics());
699 physicsActivated["em_livermore_polarised"] = true;
700 }
701}
702
704{
706 if (!physicsActivated["em_low_ep"])
707 {
708 constructors.push_back(new G4EmLowEPPhysics());
709 physicsActivated["em_low_ep"] = true;
710 }
711}
712
714{
716 if (!physicsActivated["em_penelope"])
717 {
718 constructors.push_back(new G4EmPenelopePhysics());
719 physicsActivated["em_penelope"] = true;
720 }
721}
722
724{
726 if (!physicsActivated["em_ss"])
727 {
728 constructors.push_back(new G4EmStandardPhysicsSS());
729 physicsActivated["em_ss"] = true;
730 }
731}
732
734{
736 if (!physicsActivated["em_wvi"])
737 {
738 constructors.push_back(new G4EmStandardPhysicsWVI());
739 physicsActivated["em_wvi"] = true;
740 }
741}
742
744{
746 if (!physicsActivated["em_1"])
747 {
748 constructors.push_back(new G4EmStandardPhysics_option1());
749 physicsActivated["em_1"] = true;
750 }
751}
752
754{
756 if (!physicsActivated["em_2"])
757 {
758 constructors.push_back(new G4EmStandardPhysics_option2());
759 physicsActivated["em_2"] = true;
760 }
761}
762
764{
766 if (!physicsActivated["em_3"])
767 {
768 constructors.push_back(new G4EmStandardPhysics_option3());
769 physicsActivated["em_3"] = true;
770 }
771}
772
774{
776 if (!physicsActivated["em_4"])
777 {
778 constructors.push_back(new G4EmStandardPhysics_option4());
779 physicsActivated["em_4"] = true;
780 }
781}
782
784{
786 HadronicElastic(); // has to be here to prevent G4 segfault
787 if (!physicsActivated["ftfp_bert"])
788 {
789 constructors.push_back(new G4HadronPhysicsFTFP_BERT());
790 physicsActivated["ftfp_bert"] = true;
791 }
792}
793
795{
797 HadronicElastic(); // has to be here to prevent G4 segfault
798 if (!physicsActivated["ftfp_bert_hp"])
799 {
800 constructors.push_back(new G4HadronPhysicsFTFP_BERT_HP());
801 physicsActivated["ftfp_bert_hp"] = true;
802 }
803}
804
806{
808 if (!physicsActivated["ftf_bic"])
809 {
810 constructors.push_back(new G4HadronPhysicsFTF_BIC());
811 physicsActivated["ftf_bic"] = true;
812 }
813}
814
816{
817 if (!physicsActivated["gamma_to_mumu"])
818 {
819 constructors.push_back(new BDSPhysicsGammaToMuMu());
820 physicsActivated["gamma_to_mumu"] = true;
821 }
822}
823
825{
827 if (!physicsActivated["hadronic_elastic"])
828 {
829 constructors.push_back(new G4HadronElasticPhysics());
830 physicsActivated["hadronic_elastic"] = true;
831 }
832}
833
835{
837 if (!physicsActivated["hadronic_elastic_d"])
838 {
839 constructors.push_back(new G4HadronDElasticPhysics());
840 physicsActivated["hadronic_elastic_d"] = true;
841 }
842}
843
845{
847 if (!physicsActivated["hadronic_elastic_h"])
848 {
849 constructors.push_back(new G4HadronHElasticPhysics());
850 physicsActivated["hadronic_elastic_h"] = true;
851 }
852}
853
855{
857 if (!physicsActivated["hadronic_elastic_hp"])
858 {
859 constructors.push_back(new G4HadronElasticPhysicsHP());
860 physicsActivated["hadronic_elastic_hp"] = true;
861 }
862}
863
865{
866 BDS::CheckLowEnergyNeutronDataExists("hadronic_elastic_lend");
868 if (!physicsActivated["hadronic_elastic_lend"])
869 {
870 constructors.push_back(new G4HadronElasticPhysicsLEND());
871 physicsActivated["hadronic_elastic_lend"] = true;
872 }
873}
874
876{
878 if (!physicsActivated["hadronic_elastic_xs"])
879 {
880 constructors.push_back(new G4HadronElasticPhysicsXS());
881 physicsActivated["hadronic_elastic_xs"] = true;
882 }
883}
884
886{
892
893 if (!physicsActivated["ion"])
894 {
895 constructors.push_back(new G4IonPhysics());
896 physicsActivated["ion"] = true;
897 }
898}
899
901{
908
909 if (!physicsActivated["ion_binary"])
910 {
911 constructors.push_back(new G4IonBinaryCascadePhysics());
912 physicsActivated["ion_binary"] = true;
913 }
914}
915
916
918{
924
925 if (!physicsActivated["ion_elastic"])
926 {
927 constructors.push_back(new G4IonElasticPhysics());
928 physicsActivated["ion_elastic"] = true;
929 }
930}
931
932
934{
940
941 if (!physicsActivated["ion_elastic_qmd"])
942 {
943 constructors.push_back(new G4IonQMDPhysics());
944 physicsActivated["ion_elastic_qmd"] = true;
945 }
946}
947
949{
955 if (!physicsActivated["ion_em_dissociation"])
956 {
957 constructors.push_back(new BDSPhysicsEMDissociation());
958 physicsActivated["ion_em_dissociation"] = true;
959 }
960}
961
963{
970
971 if (!physicsActivated["ion_inclxx"])
972 {
973 constructors.push_back(new G4IonINCLXXPhysics());
974 physicsActivated["ion_inclxx"] = true;
975 }
976}
977
979{
980 if (!physicsActivated["ionisation"])
981 {
982 constructors.push_back(new BDSPhysicsIonisation());
983 physicsActivated["ionisation"] = true;
984 }
985}
986
988{
989 if (!physicsActivated["lw"])
990 {
991 constructors.push_back(new BDSPhysicsLaserWire());
992 physicsActivated["lw"] = true;
993 }
994}
995
997{
998 if(!physicsActivated["laser_photo_detachment"])
999 {
1000 constructors.push_back(new BDSPhysicsLaserPhotoDetachment());
1001 physicsActivated["laser_photo_detachment"] = true;
1002 }
1003}
1004
1006{
1007 if(!physicsActivated["laser_compton_scattering"])
1008 {
1009 constructors.push_back(new BDSPhysicsLaserComptonScattering());
1010 physicsActivated["laser_compton_scattering"] = true;
1011 }
1012}
1013
1015{
1016 if(!physicsActivated["laser_cumulative_photo_detachment"])
1017 {
1018 constructors.push_back(new BDSPhysicsLaserCumulativePhotodetachment());
1019 physicsActivated["laser_cumulative_photo_detachment"] = true;
1020 }
1021}
1022
1024{
1025 if(!physicsActivated["laser_cumulative_compton_scattering"])
1026 {
1027 constructors.push_back(new BDSPhysicsLaserCumulativeCompton());
1028 physicsActivated["laser_cumulative_compton_scattering"] = true;
1029 }
1030}
1031
1033{
1034 if(!physicsActivated["laser_ion_excitation"])
1035 {
1036 constructors.push_back(new BDSPhysicsLaserIonExcitation());
1037 physicsActivated["laser_ion_excitation"] = true;
1038 }
1039}
1040
1042{
1043 if (!physicsActivated["muon"])
1044 {
1045 constructors.push_back(new BDSPhysicsMuon(emWillBeUsed));
1046 physicsActivated["muon"] = true;
1047 }
1048}
1049
1051{
1052 if (!physicsActivated["muon_inelastic"])
1053 {
1054 constructors.push_back(new BDSPhysicsMuonInelastic());
1055 physicsActivated["muon_inelastic"] = true;
1056 }
1057}
1058
1060{
1061 if (!physicsActivated["neutron_tracking_cut"])
1062 {
1063 auto ntc = new G4NeutronTrackingCut();
1064 G4double timeLimit = BDSGlobalConstants::Instance()->NeutronTimeLimit();
1065 G4double eKinLimit = BDSGlobalConstants::Instance()->NeutronKineticEnergyLimit();
1066 G4cout << __METHOD_NAME__ << "Neutron time limit: " << timeLimit / CLHEP::s << " s" << G4endl;
1067 G4cout << __METHOD_NAME__ << "Neutron kinetic energy limit: " << eKinLimit / CLHEP::MeV << G4endl;
1068 ntc->SetTimeLimit(timeLimit);
1069 ntc->SetKineticEnergyLimit(eKinLimit);
1070 constructors.push_back(ntc);
1071 physicsActivated["neutron_tracking_cut"] = true;
1072 }
1073}
1074
1076{
1077 if (!physicsActivated["optical"])
1078 {
1079 opticalPhysics = new G4OpticalPhysics();
1080 constructors.push_back(opticalPhysics);
1081 physicsActivated["optical"] = true;
1082 }
1083}
1084
1086{
1088 if (!physicsActivated["qgsp_bert"])
1089 {
1090 constructors.push_back(new G4HadronPhysicsQGSP_BERT());
1091 physicsActivated["qgsp_bert"] = true;
1092 }
1093}
1094
1096{
1098 if (!physicsActivated["qgsp_bert_hp"])
1099 {
1100 constructors.push_back(new G4HadronPhysicsQGSP_BERT_HP());
1101 physicsActivated["qgsp_bert_hp"] = true;
1102 }
1103}
1104
1106{
1108 if (!physicsActivated["qgsp_bic"])
1109 {
1110 constructors.push_back(new G4HadronPhysicsQGSP_BIC());
1111 physicsActivated["qgsp_bic"] = true;
1112 }
1113}
1114
1116{
1118 if (!physicsActivated["qgsp_bic_hp"])
1119 {
1120 constructors.push_back(new G4HadronPhysicsQGSP_BIC_HP());
1121 physicsActivated["qgsp_bic_hp"] = true;
1122 }
1123}
1124
1126{
1127#if G4VERSION_NUMBER > 1059
1128 AllParticles();
1129#endif
1130 if (!physicsActivated["shielding"])
1131 {
1132 constructors.push_back(new G4HadronPhysicsShielding());
1133 physicsActivated["shielding"] = true;
1134 }
1135}
1136
1138{
1141 if (!physicsActivated["stopping"])
1142 {
1143 constructors.push_back(new G4StoppingPhysics());
1144 physicsActivated["stopping"] = true;
1145 }
1146}
1147
1149{
1151 if (!physicsActivated["synch_rad"])
1152 {
1153 constructors.push_back(new BDSPhysicsSynchRad());
1154 physicsActivated["synch_rad"] = true;
1155 }
1156}
1157
1158#if G4VERSION_NUMBER > 1019
1160{
1162 if (!physicsActivated["em_gs"])
1163 {
1164 constructors.push_back(new G4EmStandardPhysicsGS());
1165 physicsActivated["em_gs"] = true;
1166 }
1167}
1168
1170{
1171 if (!physicsActivated["dna_chemistry"])
1172 {
1173 // only one DNA chemistry physics list possible
1174 if (temporaryName == "dna_chemistry")
1175 {constructors.push_back(new G4EmDNAChemistry());}
1176#if G4VERSION_NUMBER > 1069
1177 else if (temporaryName == "dna_chemistry_1")
1178 {constructors.push_back(new G4EmDNAChemistry_option1());}
1179 else if (temporaryName == "dna_chemistry_2")
1180 {constructors.push_back(new G4EmDNAChemistry_option2());}
1181 else if (temporaryName == "dna_chemistry_3")
1182 {constructors.push_back(new G4EmDNAChemistry_option3());}
1183#endif
1184 physicsActivated["dna_chemistry"] = true;
1185 }
1186}
1187#endif
1188
1189#if G4VERSION_NUMBER > 1020
1191{
1192 if (!physicsActivated["decay_spin"])
1193 {// this will replace regular decay for various processes
1194 constructors.push_back(new G4SpinDecayPhysics());
1195 physicsActivated["decay_spin"] = true;
1196 }
1197}
1198#endif
1199
1200#if G4VERSION_NUMBER > 1022
1202{
1209
1210 if (!physicsActivated["ion_php"])
1211 {
1212 constructors.push_back(new G4IonPhysicsPHP());
1213 physicsActivated["ion_php"] = true;
1214 }
1215}
1216#endif
1217
1218#if G4VERSION_NUMBER > 1029
1220{
1224#if G4VERSION_NUMBER > 1059
1226#endif
1227 if (!physicsActivated["decay_muonic_atom"])
1228 {
1229 constructors.push_back(new G4MuonicAtomDecayPhysics());
1230 physicsActivated["decay_muonic_atom"] = true;
1231 }
1232}
1233#endif
1234
1235#if G4VERSION_NUMBER > 1039
1237{
1238 if (!physicsActivated["dna"])
1239 {
1240 if (temporaryName == "dna")
1241 {constructors.push_back(new G4EmDNAPhysics());}
1242 else if (temporaryName == "dna_1")
1243 {constructors.push_back(new G4EmDNAPhysics_option1());}
1244 else if (temporaryName == "dna_2")
1245 {constructors.push_back(new G4EmDNAPhysics_option2());}
1246 else if (temporaryName == "dna_3")
1247 {constructors.push_back(new G4EmDNAPhysics_option3());}
1248 else if (temporaryName == "dna_4")
1249 {constructors.push_back(new G4EmDNAPhysics_option4());}
1250 else if (temporaryName == "dna_5")
1251 {constructors.push_back(new G4EmDNAPhysics_option5());}
1252 else if (temporaryName == "dna_6")
1253 {constructors.push_back(new G4EmDNAPhysics_option6());}
1254 else if (temporaryName == "dna_7")
1255 {constructors.push_back(new G4EmDNAPhysics_option7());}
1256 physicsActivated["dna"] = true;
1257 }
1258}
1259
1260
1262{
1263 if (!physicsActivated["channelling"])
1264 {
1265 G4GenericBiasingPhysics* biasingPhysics = new G4GenericBiasingPhysics();
1266 biasingPhysics->PhysicsBiasAllCharged();
1267 RegisterPhysics(biasingPhysics);
1268 constructors.push_back(new BDSPhysicsChannelling());
1269 physicsActivated["channelling"] = true;
1270 }
1271}
1272
1274{
1275 if (!physicsActivated["radioactivation"])
1276 {
1277 constructors.push_back(new BDSPhysicsRadioactivation());
1278 physicsActivated["radioactivation"] = true;
1279 }
1280}
1281
1283{
1284 BDS::CheckLowEnergyNeutronDataExists("shielding_lend");
1285 if (!physicsActivated["shielding_lend"])
1286 {
1287 constructors.push_back(new G4HadronPhysicsShieldingLEND());
1288 physicsActivated["shielding_lend"] = true;
1289 }
1290}
1291#endif
1292
1293#if G4VERSION_NUMBER > 1119
1295{
1296 if (!physicsActivated["xray_relfection"])
1297 {
1298 G4double sr = BDSGlobalConstants::Instance()->XrayAllSurfaceRoughness();
1299 constructors.push_back(new BDSPhysicsXrayReflection(sr));
1300 physicsActivated["xray_relfection"] = true;
1301 }
1302}
1303#endif
General exception with possible name of object and message.
static BDSGlobalConstants * Instance()
Access method.
void ConstructAllShortLived()
Construct resonances and quarks - sometimes required explicitly.
void ShieldingLEND()
Physics constructor loader.
void MuonInelastic()
Physics constructor loader.
G4bool constructedAllBaryons
Cached flag to avoid repeated construction.
void Em1()
Physics constructor loader.
void EmLivermorePolarised()
Physics constructor loader.
void Optical()
Physics constructor loader.
void HadronicElasticHP()
Physics constructor loader.
void Em2()
Physics constructor loader.
void IonBinary()
Physics constructor loader.
void ConstructAllIons()
Construct ions.
void HadronicElasticXS()
Physics constructor loader.
void IonINCLXX()
Physics constructor loader.
void LaserComptonScattering()
Physics constructor loader.
void ParsePhysicsList(const G4String &physListName)
Interpret the string of physics lists given from the user through the parser.
void Em3()
Physics constructor loader.
void Stopping()
Physics constructor loader.
void LaserWire()
Physics constructor loader.
void EmLowEP()
Physics constructor loader.
G4bool constructedAllIons
Cached flag to avoid repeated construction.
void EmWVI()
Physics constructor loader.
void DNAChemistry()
Physics constructor loader.
BDSGlobalConstants * globals
Keep a local reference to global constants to avoid getting it all the time.
G4bool usingIons
Flag telling whether ions are being used either in physics list or in beam particle.
void CheckIncompatiblePhysics(const G4String &singlePhysicsIn) const
void Ion()
Physics constructor loader.
void Cherenkov()
Physics constructor loader.
void ChargeExchange()
Physics constructor loader.
std::map< G4String, std::vector< G4String > > incompatible
Map of incompatible physics lists by our name for each individual list.
void DecayMuonicAtom()
Physics constructor loader.
void DecayRadioactive()
Physics constructor loader.
void DNA()
Physics constructor loader.
void HadronicElasticH()
Physics constructor loader.
G4String temporaryName
Temporary string used to pass name to constructor functions.
void IonEMDissociation()
Physics constructor loader.
std::map< G4String, G4bool > physicsActivated
void Em4()
Physics constructor loader.
void EmExtra()
Physics constructor loader.
void HadronicElasticLEND()
Physics constructor loader.
void Radioactivation()
Physics constructor loader.
void QGSPBICHP()
Physics constructor loader.
void IonElastic()
Physics constructor loader.
void Muon()
Physics constructor loader.
void LaserPhotoDetachment()
Physics constructor loader.
void NeutronTrackingCut()
Physics constructor loader.
void Ionisation()
Physics constructor loader.
void LaserCumulativePhotoDetachment()
Physics constructor loader.
void ConstructAllBaryons()
Construct baryons.
void QGSPBERTHP()
Physics constructor loader.
void IonPHP()
Physics constructor loader.
G4bool constructedAllLeptons
Cached flag to avoid repeated construction.
void Decay()
Physics constructor loader.
void FTFBIC()
Physics constructor loader.
void EmSS()
Physics constructor loader.
void FTFPBERT()
Physics constructor loader.
void XrayReflection()
Physics constructor loader.
void AnnihiToMuMu()
Physics constructor loader.
void QGSPBIC()
Physics constructor loader.
void LaserIonExcitation()
Physics constructor loader.
void GammaToMuMu()
Physics constructor loader.
void CutsAndLimits()
Physics constructor loader.
void Em()
Physics constructor loader.
void EmPenelope()
Physics constructor loader.
void HadronicElastic()
Physics constructor loader.
G4bool emWillBeUsed
Flag as to whether em will be used - avoids duplicate processes being registered.
void HadronicElasticD()
Physics constructor loader.
G4bool constructedAllShortLived
Cached flag to avoid repeated construction.
void DecaySpin()
Physics constructor loader.
void FTFPBERTHP()
Physics constructor loader.
void EmLivermore()
Physics constructor loader.
void IonElasticQMD()
Physics constructor loader.
std::map< std::string, Constructor > physicsConstructors
A map of physics list names to their constructors.
std::vector< G4String > physicsLists
void Channelling()
Physics constructor loader.
G4bool constructedAllMesons
Cached flag to avoid repeated construction.
void QGSPBERT()
Physics constructor loader.
void Shielding()
Physics constructor loader.
void EmGS()
Physics constructor loader.
void ConstructAllMesons()
Construct mesons.
void LaserCumulativeCompton()
Physics constructor loader.
void Print()
Print out which physics lists are activated.
std::map< G4String, G4String > aliasToOriginal
Map of possible aliases for a given physics list.
void SynchRad()
Physics constructor loader.
High energy muon processes.
Channelling physics process.
Cherenkov physics process constructor.
Physics processes required for user tracking limits.
Electromagnetic dissociation for high energy ions.
High energy muon processes.
Only ionisation from G4EmStandardPhysics.
Constructor for BDSLaserCompton process.
Only nuclear interactions for mu+-.
High energy muon processes.
A physics constructor that only constructs Synchrotron Radiation.
G4String LowerCase(const G4String &str)
Utility function to simplify lots of syntax changes for pedantic g4 changes.
void CheckHighPrecisionDataExists(const G4String &physicsListName)
void CheckLowEnergyNeutronDataExists(const G4String &phhysicsListName)
void ConstructMinimumParticleSet()