BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSModularPhysicsList.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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#ifndef BDSMODULARPHYSICSLIST_H
20#define BDSMODULARPHYSICSLIST_H
21
22#include "G4VModularPhysicsList.hh"
23
24#include <map>
25#include <string>
26#include <vector>
27
31class G4OpticalPhysics;
32class G4VPhysicsConstructor;
33
34namespace GMAD {
35 class PhysicsBiasing;
36 template<typename T> class FastList;
37}
38
54class BDSModularPhysicsList: public G4VModularPhysicsList
55{
56public:
57 BDSModularPhysicsList() = delete;
58 explicit BDSModularPhysicsList(const G4String& physicsList);
59 virtual ~BDSModularPhysicsList();
60
63 virtual void ConstructParticle();
64
67 virtual void ConstructProcess();
68
70 void Print();
71
72 inline G4bool UsingIons() const {return usingIons;}
73
74private:
79
82
84 void ConstructAllMesons();
85
88
90 void ConstructAllIons();
91
93 void ParsePhysicsList(const G4String& physListName);
94
97 void ConfigurePhysics();
98
101 void ConfigureOptical();
102
105 void CheckIncompatiblePhysics(const G4String& singlePhysicsIn) const;
106
109
112
114 std::map<std::string, Constructor> physicsConstructors;
115
118 std::vector<G4String> physicsLists;
119
123 std::map<G4String, G4bool> physicsActivated;
124
126 std::map<G4String, std::vector<G4String> > incompatible;
127
129 std::map<G4String, G4String> aliasToOriginal;
130
131 G4OpticalPhysics* opticalPhysics;
132 std::vector<G4VPhysicsConstructor*> constructors;
133
136
139
141 mutable G4bool usingIons;
142
145 void AllParticles();
146
148 void AnnihiToMuMu();
149 void ChargeExchange();
150 void Cherenkov();
151 void CutsAndLimits();
152 void Decay();
153 void DecayRadioactive();
154 void Em();
155 void EmExtra();
156 void EmLivermore();
158 void EmLowEP();
159 void EmPenelope();
160 void EmSS();
161 void EmWVI();
162 void Em1();
163 void Em2();
164 void Em3();
165 void Em4();
166 void FTFPBERT();
167 void FTFPBERTHP();
168 void GammaToMuMu();
169 void HadronicElastic();
170 void HadronicElasticD();
171 void HadronicElasticH();
172 void HadronicElasticHP();
173 void HadronicElasticLEND();
174 void HadronicElasticXS();
175 void Ion();
176 void IonBinary();
177 void IonElastic();
178 void IonElasticQMD();
179 void IonEMDissociation();
180 void IonINCLXX();
181 void LaserWire();
182 void Muon();
183 void NeutronTrackingCut();
184 void Optical();
185 void QGSPBERT();
186 void QGSPBERTHP();
187 void QGSPBIC();
188 void QGSPBICHP();
189 void Shielding();
190 void Stopping();
191 void SynchRad();
192#if G4VERSION_NUMBER > 1019
193 void EmGS();
194#endif
195#if G4VERSION_NUMBER > 1020
196 void DecaySpin();
197#endif
198#if G4VERSION_NUMBER > 1022
199 void IonPHP();
200#endif
201#if G4VERSION_NUMBER > 1029
202 void DecayMuonicAtom();
203#endif
204#if G4VERSION_NUMBER > 1039
205 void Channelling();
206 void DNA();
207 void Radioactivation();
208 void ShieldingLEND();
209#endif
211};
212
213#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 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 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.
void EmWVI()
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 NeutronTrackingCut()
Physics constructor loader.
void ConstructAllBaryons()
Construct baryons.
void QGSPBERTHP()
Physics constructor loader.
void IonPHP()
Physics constructor loader.
void Decay()
Physics constructor loader.
void EmSS()
Physics constructor loader.
void FTFPBERT()
Physics constructor loader.
void AnnihiToMuMu()
Physics constructor loader.
void QGSPBIC()
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.
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.
void QGSPBERT()
Physics constructor loader.
void Shielding()
Physics constructor loader.
void EmGS()
Physics constructor loader.
void ConstructAllMesons()
Construct mesons.
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.