LArSoft  v09_90_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/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* CustomPhysicsFactory<G4EmStandardPhysics>::Build() const
33  {
34  return new G4EmStandardPhysics(0);
35  }
36 
37  template <>
38  G4VPhysicsConstructor* CustomPhysicsFactory<G4EmExtraPhysics>::Build() const
39  {
40  return new G4EmExtraPhysics("extra EM");
41  }
42 
43  template <>
45  {
46  return new G4ChargeExchangePhysics(2);
47  }
48 
49  template <>
50  G4VPhysicsConstructor* CustomPhysicsFactory<G4DecayPhysics>::Build() const
51  {
52  return new G4DecayPhysics("Decay", 0);
53  }
54 
55  //hadron elastic
56  template <>
58  {
59  return new G4HadronElasticPhysics(0);
60  }
61 
62  //hadron elastic, neutron HP
63  template <>
65  {
66  return new G4HadronElasticPhysicsHP(0);
67  }
68 
69  //hadron elastic, particle HP
70  template <>
72  {
73  return new G4HadronElasticPhysicsPHP(0);
74  }
75 
76  //hadron inelastic
77  template <>
79  {
80  constexpr G4bool quasiElastic{true};
81  return new G4HadronPhysicsQGSP_BERT("hadron", quasiElastic);
82  }
83 
84  //hadron inelastic, neutron HP
85  template <>
87  {
88  return new G4HadronPhysicsQGSP_BERT_HP("hadronHP", true);
89  }
90 
91  template <>
92  G4VPhysicsConstructor* CustomPhysicsFactory<G4StoppingPhysics>::Build() const
93  {
94  return new G4StoppingPhysics("stopping");
95  }
96 
97  template <>
98  G4VPhysicsConstructor* CustomPhysicsFactory<G4IonPhysics>::Build() const
99  {
100  return new G4IonPhysics("ion");
101  }
102 
103  template <>
105  {
106  return new G4NeutronTrackingCut("Neutron tracking cut", 0);
107  }
108 }
109 
110 #endif
Geant4 interface.
G4VPhysicsConstructor * Build() const