CustomPhysicsTable.hh
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file CustomPhysicsTable.h
3 //
4 ////////////////////////////////////////////////////////////////////////
5 //
6 // The custom physics table keeps track of all compiled physics modules and feeds their
7 // names and constructors to the ConfigurablePhysicsList.
8 //
9 // A CustomPhysicsTable is instantiated in the constructor of each CustomPhysicsFactory<T>
10 // with a pointer to the instantiating factory as an argument. This pointer is passed to
11 // a singleton, static CustomPhysicsTable called TheCustomPhysicsTable. It is this table
12 // which the ConfigurablePhysicsList interacts with.
13 //
14 // At runtime the CustomPhysicsTable contains an array of CustomPhysicsFactories, one
15 // for each available physics module, and can provide the list of their names and
16 // the constructor for each to the physics list.
17 //
18 // This means new physics modules can be enabled via the GArG4.xml file with no change to
19 // the physics list code
20 //
21 // See CustomPhysicsFactory.hh and CustomPhysicsFactory.cxx for more details.
22 
23 
24 
25 #ifndef CUSTOMPHYSICSTABLE_hh
26 #define CUSTOMPHYSICSTABLE_hh 1
27 
28 #ifndef CUSTOMPHYSICSFACTORY_hh
29 namespace gar {
30  namespace garg4 { class CustomPhysicsFactoryBase; }
31 }
32 #endif
33 
34 #include "Geant4/G4VPhysicsConstructor.hh"
35 
36 namespace gar {
37  namespace garg4 {
39  {
40 
41  public:
44  std::vector<std::string> GetAvailablePhysicsList();
45  bool IsPhysicsAvailable(std::string);
46  G4VPhysicsConstructor * GetPhysicsConstructor(std::string);
47  std::map<std::string,CustomPhysicsFactoryBase* > GetFullTable()
48  { return theTable;}
49  void AddPhysics(CustomPhysicsFactoryBase*);
50 
51 
52  protected:
53  std::map<std::string,CustomPhysicsFactoryBase* > theTable;
55  };
56 
57  }
58 } // gar
59 
61 
62 #endif
63 
64 
65 
66 
67 // Sept 2009 - Ben Jones, MIT
std::map< std::string, CustomPhysicsFactoryBase * > theTable
std::string string
Definition: nybbler.cc:12
std::map< std::string, CustomPhysicsFactoryBase * > GetFullTable()
General GArSoft Utilities.