LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
CustomPhysicsBuiltIns.hh
Go to the documentation of this file.
1 //
6 
7 
8 // The parameters of GEANT4 built in physics modules must be supplied to their constructors.
9 // This code initiates CustomPhysicsFactories to pass the default QGSP_BERT parameters
10 // and add built in physics to the CustomPhysicsFactory. Parameters are passed exactly
11 // as they were in QGSP_BERT (hence apparent inconsistencies are not the fault of the current
12 // author!
13 //
14 // For new modules, parameters for new physics should be read from xml files within the modules
15 // themselves rather than passing parameters directly to the constructor. See OpticalPhysics as
16 // an example.
17 //
18 // Therefore no new modules should be initialised as those below (this is a somewhat
19 // hacky patch to reconcile the Geant4 way of declaring physics with the physics table
20 // scheme)
21 
22 
23 #include "Geant4/G4DecayPhysics.hh"
24 #include "Geant4/G4EmExtraPhysics.hh"
25 #include "Geant4/G4IonPhysics.hh"
26 #include "Geant4/G4StoppingPhysics.hh"
27 #include "Geant4/G4HadronElasticPhysics.hh"
28 #include "Geant4/G4NeutronTrackingCut.hh"
29 #include "Geant4/G4HadronPhysicsQGSP_BERT.hh"
30 #include "Geant4/G4EmStandardPhysics.hh"
31 #include "Geant4/G4EmLivermorePhysics.hh"
32 #include "Geant4/G4ChargeExchangePhysics.hh"
33 
35 
36 
37 namespace larg4 {
38 
39  class EmPhysicsFactory : public CustomPhysicsFactory<G4EmStandardPhysics>
40  {
41  public:
42  G4VPhysicsConstructor * Build() {return new G4EmStandardPhysics(0);}
43  EmPhysicsFactory() : CustomPhysicsFactory<G4EmStandardPhysics>("Em") {}
44  virtual ~EmPhysicsFactory() {};
45  };
46 
47  class SynchrotronAndGN : public CustomPhysicsFactory<G4EmExtraPhysics>
48  {
49  public:
50  G4VPhysicsConstructor * Build() {return new G4EmExtraPhysics("extra EM");}
51  SynchrotronAndGN() : CustomPhysicsFactory<G4EmExtraPhysics>("SynchrotronAndGN") {}
52  virtual ~SynchrotronAndGN() {}
53  };
54 
55  class ChargeExchange : public CustomPhysicsFactory<G4ChargeExchangePhysics>
56  {
57  public:
58  G4VPhysicsConstructor * Build() {return new G4ChargeExchangePhysics(2);}
59  ChargeExchange() : CustomPhysicsFactory<G4ChargeExchangePhysics>("ChargeExchange") {}
60  virtual ~ChargeExchange() {}
61  };
62 
63 
64  class DecayPhysicsFactory : public CustomPhysicsFactory<G4DecayPhysics>
65  {
66  public:
67  G4VPhysicsConstructor * Build() {return new G4DecayPhysics("Decay",0);}
68  DecayPhysicsFactory() : CustomPhysicsFactory<G4DecayPhysics>("Decay") {}
69  virtual ~DecayPhysicsFactory() {}
70  };
71 
72  class HadronElasticPhysicsFactory : public CustomPhysicsFactory<G4HadronElasticPhysics>
73  {
74  public:
75  G4VPhysicsConstructor * Build() {return new G4HadronElasticPhysics(0);}
76  HadronElasticPhysicsFactory() : CustomPhysicsFactory<G4HadronElasticPhysics>("HadronElastic") {}
78  };
79 
80  class HadronPhysicsFactory : public CustomPhysicsFactory<G4HadronPhysicsQGSP_BERT>
81  {
82  public:
83  G4bool quasiElastic;
84  G4VPhysicsConstructor * Build() {return new G4HadronPhysicsQGSP_BERT("hadron",quasiElastic=true);}
85  HadronPhysicsFactory() : CustomPhysicsFactory<G4HadronPhysicsQGSP_BERT>("Hadron") {}
86  virtual ~HadronPhysicsFactory() {}
87  };
88 
89  class StoppingPhysicsFactory : public CustomPhysicsFactory<G4StoppingPhysics>
90  {
91  public:
92  G4VPhysicsConstructor * Build() {return new G4StoppingPhysics("stopping");}
93  StoppingPhysicsFactory() : CustomPhysicsFactory<G4StoppingPhysics>("Stopping") {}
95  };
96 
97  class IonPhysicsFactory : public CustomPhysicsFactory<G4IonPhysics>
98  {
99  public:
100  G4VPhysicsConstructor * Build() {return new G4IonPhysics("ion");}
101  IonPhysicsFactory() : CustomPhysicsFactory<G4IonPhysics>("Ion") {}
102  virtual ~IonPhysicsFactory() {};
103  };
104 
105  class NeutronTrackingCutFactory : public CustomPhysicsFactory<G4NeutronTrackingCut>
106  {
107  public:
108  G4VPhysicsConstructor * Build() {return new G4NeutronTrackingCut("Neutron tracking cut",0);}
109  NeutronTrackingCutFactory() : CustomPhysicsFactory<G4NeutronTrackingCut>("NeutronTrackingCut") {}
111  };
112 
113  class LowEnergyEmFactory : public CustomPhysicsFactory<G4EmLivermorePhysics>
114  {
115  public:
116  G4VPhysicsConstructor * Build() {return new G4EmLivermorePhysics();}
117  LowEnergyEmFactory() : CustomPhysicsFactory<G4EmLivermorePhysics>("LowEnergyEm"){}
118  virtual ~LowEnergyEmFactory() {}
119  };
120 
121 
122 }
123 
124 
125 
126 
127 
128 // Sept 2009 - Ben Jones, MIT
G4VPhysicsConstructor * Build()
G4VPhysicsConstructor * Build()
G4VPhysicsConstructor * Build()
Geant4 interface.
G4VPhysicsConstructor * Build()
G4VPhysicsConstructor * Build()
G4VPhysicsConstructor * Build()
G4VPhysicsConstructor * Build()
G4VPhysicsConstructor * Build()