All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CustomPhysicsTable.hh
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file CustomPhysicsTable.h
3 //
4 /// \author bjpjones@mit.edu
5 ////////////////////////////////////////////////////////////////////////
6 //
7 // The custom physics table keeps track of all compiled physics modules and feeds their
8 // names and constructors to the ConfigurablePhysicsList.
9 //
10 // A CustomPhysicsTable is instantiated in the constructor of each CustomPhysicsFactory<T>
11 // with a pointer to the instantiating factory as an argument. This pointer is passed to
12 // a singleton, static CustomPhysicsTable called TheCustomPhysicsTable. It is this table
13 // which the ConfigurablePhysicsList interacts with.
14 //
15 // At runtime the CustomPhysicsTable contains an array of CustomPhysicsFactories, one
16 // for each available physics module, and can provide the list of their names and
17 // the constructor for each to the physics list.
18 //
19 // This means new physics modules can be enabled via the LArG4.xml file with no change to
20 // the physics list code
21 //
22 // See CustomPhysicsFactory.hh and CustomPhysicsFactory.cxx for more details.
23 
24 #ifndef CUSTOMPHYSICSTABLE_hh
25 #define CUSTOMPHYSICSTABLE_hh 1
26 
27 #include <map>
28 #include <vector>
29 
30 class G4VPhysicsConstructor;
31 
32 namespace larg4 {
33  class CustomPhysicsFactoryBase;
34 
36  public:
37  CustomPhysicsTable() = default;
39  std::vector<std::string> GetAvailablePhysicsList();
40  bool IsPhysicsAvailable(std::string const&);
41  G4VPhysicsConstructor* GetPhysicsConstructor(std::string const& physicsName);
42  std::map<std::string, CustomPhysicsFactoryBase*> const&
44  {
45  return theTable;
46  }
48 
49  private:
50  std::map<std::string, CustomPhysicsFactoryBase*> theTable;
51  };
52 
53 }
54 
55 #endif
G4VPhysicsConstructor * GetPhysicsConstructor(std::string const &physicsName)
std::map< std::string, CustomPhysicsFactoryBase * > const & GetFullTable()
std::vector< std::string > GetAvailablePhysicsList()
void AddPhysics(CustomPhysicsFactoryBase *)
std::map< std::string, CustomPhysicsFactoryBase * > theTable
bool IsPhysicsAvailable(std::string const &)