BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSModularPhysicsList.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSMODULARPHYSICSLIST_H
19#define BDSMODULARPHYSICSLIST_H
20
21#include "G4VModularPhysicsList.hh"
22
23#include <map>
24#include <string>
25#include <vector>
26
30class G4OpticalPhysics;
31class G4VPhysicsConstructor;
32
33namespace GMAD {
34 class PhysicsBiasing;
35 template<typename T> class FastList;
36}
37
53class BDSModularPhysicsList: public G4VModularPhysicsList
54{
55public:
56 BDSModularPhysicsList() = delete;
57 explicit BDSModularPhysicsList(const G4String& physicsList);
58 virtual ~BDSModularPhysicsList();
59
62 virtual void ConstructParticle();
63
66 virtual void ConstructProcess();
67
69 void Print();
70
71 inline G4bool UsingIons() const {return usingIons;}
72
73private:
78
81
83 void ConstructAllMesons();
84
87
89 void ConstructAllIons();
90
98
100 void ParsePhysicsList(const G4String& physListName);
101
104 void ConfigurePhysics();
105
108 void ConfigureOptical();
109
112 void CheckIncompatiblePhysics(const G4String& singlePhysicsIn) const;
113
116
119
121 std::map<std::string, Constructor> physicsConstructors;
122
125 std::vector<G4String> physicsLists;
126
130 std::map<G4String, G4bool> physicsActivated;
131
133 std::map<G4String, std::vector<G4String> > incompatible;
134
136 std::map<G4String, G4String> aliasToOriginal;
137
138 G4OpticalPhysics* opticalPhysics;
139 std::vector<G4VPhysicsConstructor*> constructors;
140
143
146
148 mutable G4bool usingIons;
149
150 G4bool particlesConstructed;
151
154 void AllParticles();
155
157 void AnnihiToMuMu();
158 void ChargeExchange();
159 void Cherenkov();
160 void CutsAndLimits();
161 void Decay();
162 void DecayRadioactive();
163 void Em();
164 void EmExtra();
165 void EmLivermore();
167 void EmLowEP();
168 void EmPenelope();
169 void EmSS();
170 void EmWVI();
171 void Em1();
172 void Em2();
173 void Em3();
174 void Em4();
175 void FTFPBERT();
176 void FTFPBERTHP();
177 void FTFBIC();
178 void GammaToMuMu();
179 void HadronicElastic();
180 void HadronicElasticD();
181 void HadronicElasticH();
182 void HadronicElasticHP();
183 void HadronicElasticLEND();
184 void HadronicElasticXS();
185 void Ion();
186 void IonBinary();
187 void IonElastic();
188 void IonElasticQMD();
189 void IonEMDissociation();
190 void IonINCLXX();
191 void Ionisation();
192 void LaserWire();
197 void LaserIonExcitation();
198 void Muon();
199 void MuonInelastic();
200 void NeutronTrackingCut();
201 void Optical();
202 void QGSPBERT();
203 void QGSPBERTHP();
204 void QGSPBIC();
205 void QGSPBICHP();
206 void Shielding();
207 void Stopping();
208 void SynchRad();
209#if G4VERSION_NUMBER > 1019
210 void EmGS();
211 void DNAChemistry();
212#endif
213#if G4VERSION_NUMBER > 1020
214 void DecaySpin();
215#endif
216#if G4VERSION_NUMBER > 1022
217 void IonPHP();
218#endif
219#if G4VERSION_NUMBER > 1029
220 void DecayMuonicAtom();
221#endif
222#if G4VERSION_NUMBER > 1039
223 void Channelling();
224 void DNA();
225 void Radioactivation();
226 void ShieldingLEND();
227#endif
228#if G4VERSION_NUMBER > 1119
229 void XrayReflection();
230#endif
232};
233
234#endif
A class that holds global options and constants.
Modular physics list based on Geant4 constructors.
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(BDSModularPhysicsList::* Constructor)()
Typedef for function pointers to simplify syntax.
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.
Wrapper for particle definition.
Parser namespace for GMAD language. Combination of Geant4 and MAD.