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/G4EmStandardPhysics.hh"
19 #include "Geant4/G4HadronElasticPhysics.hh"
20 #include "Geant4/G4HadronElasticPhysicsHP.hh"
21 #include "Geant4/G4HadronElasticPhysicsPHP.hh"
22 #include "Geant4/G4HadronPhysicsQGSP_BERT.hh"
23 #include "Geant4/G4HadronPhysicsQGSP_BERT_HP.hh"
24 #include "Geant4/G4IonPhysics.hh"
25 #include "Geant4/G4NeutronTrackingCut.hh"
26 #include "Geant4/G4StoppingPhysics.hh"
27 
29 
30 namespace larg4 {
31  template <>
32  G4VPhysicsConstructor*
34  {
35  return new G4EmStandardPhysics(0);
36  }
37 
38  template <>
39  G4VPhysicsConstructor*
41  {
42  return new G4EmExtraPhysics("extra EM");
43  }
44 
45  template <>
46  G4VPhysicsConstructor*
48  {
49  return new G4ChargeExchangePhysics(2);
50  }
51 
52  template <>
53  G4VPhysicsConstructor*
55  {
56  return new G4DecayPhysics("Decay", 0);
57  }
58 
59  //hadron elastic
60  template <>
61  G4VPhysicsConstructor*
63  {
64  return new G4HadronElasticPhysics(0);
65  }
66 
67  //hadron elastic, neutron HP
68  template <>
69  G4VPhysicsConstructor*
71  {
72  return new G4HadronElasticPhysicsHP(0);
73  }
74 
75  //hadron elastic, particle HP
76  template <>
77  G4VPhysicsConstructor*
79  {
80  return new G4HadronElasticPhysicsPHP(0);
81  }
82 
83  //hadron inelastic
84  template <>
85  G4VPhysicsConstructor*
87  {
88  constexpr G4bool quasiElastic{true};
89  return new G4HadronPhysicsQGSP_BERT("hadron", quasiElastic);
90  }
91 
92  //hadron inelastic, neutron HP
93  template <>
94  G4VPhysicsConstructor*
96  {
97  return new G4HadronPhysicsQGSP_BERT_HP("hadronHP", true);
98  }
99 
100  template <>
101  G4VPhysicsConstructor*
103  {
104  return new G4StoppingPhysics("stopping");
105  }
106 
107  template <>
108  G4VPhysicsConstructor*
110  {
111  return new G4IonPhysics("ion");
112  }
113 
114  template <>
115  G4VPhysicsConstructor*
117  {
118  return new G4NeutronTrackingCut("Neutron tracking cut", 0);
119  }
120 }
121 
122 #endif
Geant4 interface.
G4VPhysicsConstructor * Build() const