LArSoft  v09_93_00
Liquid Argon Software toolkit - https://larsoft.org/
CustomPhysicsBuiltIns.hh
Go to the documentation of this file.
1 #ifndef larsim_LegacyLArG4_CustomPhysicsBuiltIns_hh
2 #define larsim_LegacyLArG4_CustomPhysicsBuiltIns_hh
3 
4 // The parameters of GEANT4 built in physics modules must be supplied
5 // to their constructors. This code initiates CustomPhysicsFactories
6 // to pass the default QGSP_BERT parameters and add built in physics
7 // to the CustomPhysicsFactory. Parameters are passed exactly as they
8 // were in QGSP_BERT (hence apparent inconsistencies are not the fault
9 // of the current author!
10 //
11 // Any LArSoft-specific lists should be added in CustomPhysicsLArSoft
12 // (e.g. OpticalPhysics).
13 
14 #include "Geant4/G4ChargeExchangePhysics.hh"
15 #include "Geant4/G4DecayPhysics.hh"
16 #include "Geant4/G4EmExtraPhysics.hh"
17 #include "Geant4/G4EmLivermorePhysics.hh"
18 #include "Geant4/G4EmPenelopePhysics.hh"
19 #include "Geant4/G4EmStandardPhysics.hh"
20 #include "Geant4/G4HadronElasticPhysics.hh"
21 #include "Geant4/G4HadronElasticPhysicsHP.hh"
22 #include "Geant4/G4HadronElasticPhysicsPHP.hh"
23 #include "Geant4/G4HadronPhysicsQGSP_BERT.hh"
24 #include "Geant4/G4HadronPhysicsQGSP_BERT_HP.hh"
25 #include "Geant4/G4IonPhysics.hh"
26 #include "Geant4/G4NeutronTrackingCut.hh"
27 #include "Geant4/G4StoppingPhysics.hh"
28 
30 
31 namespace larg4 {
32  template <>
33  G4VPhysicsConstructor* CustomPhysicsFactory<G4EmStandardPhysics>::Build() const
34  {
35  return new G4EmStandardPhysics(0);
36  }
37 
38  template <>
39  G4VPhysicsConstructor* CustomPhysicsFactory<G4EmExtraPhysics>::Build() const
40  {
41  return new G4EmExtraPhysics("extra EM");
42  }
43 
44  template <>
46  {
47  return new G4ChargeExchangePhysics(2);
48  }
49 
50  template <>
51  G4VPhysicsConstructor* CustomPhysicsFactory<G4DecayPhysics>::Build() const
52  {
53  return new G4DecayPhysics("Decay", 0);
54  }
55 
56  //hadron elastic
57  template <>
59  {
60  return new G4HadronElasticPhysics(0);
61  }
62 
63  //hadron elastic, neutron HP
64  template <>
66  {
67  return new G4HadronElasticPhysicsHP(0);
68  }
69 
70  //hadron elastic, particle HP
71  template <>
73  {
74  return new G4HadronElasticPhysicsPHP(0);
75  }
76 
77  //hadron inelastic
78  template <>
80  {
81  constexpr G4bool quasiElastic{true};
82  return new G4HadronPhysicsQGSP_BERT("hadron", quasiElastic);
83  }
84 
85  //hadron inelastic, neutron HP
86  template <>
88  {
89  return new G4HadronPhysicsQGSP_BERT_HP("hadronHP", true);
90  }
91 
92  template <>
93  G4VPhysicsConstructor* CustomPhysicsFactory<G4StoppingPhysics>::Build() const
94  {
95  return new G4StoppingPhysics("stopping");
96  }
97 
98  template <>
99  G4VPhysicsConstructor* CustomPhysicsFactory<G4IonPhysics>::Build() const
100  {
101  return new G4IonPhysics("ion");
102  }
103 
104  template <>
106  {
107  return new G4NeutronTrackingCut("Neutron tracking cut", 0);
108  }
109 }
110 
111 #endif
Geant4 interface.
G4VPhysicsConstructor * Build() const