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