Public Member Functions | Private Attributes | List of all members
larg4::CustomPhysicsTable Class Reference

#include <CustomPhysicsTable.hh>

Public Member Functions

 CustomPhysicsTable ()=default
 
 CustomPhysicsTable (CustomPhysicsFactoryBase *)
 
std::vector< std::stringGetAvailablePhysicsList ()
 
bool IsPhysicsAvailable (std::string const &)
 
G4VPhysicsConstructor * GetPhysicsConstructor (std::string const &physicsName)
 
std::map< std::string, CustomPhysicsFactoryBase * > const & GetFullTable ()
 
void AddPhysics (CustomPhysicsFactoryBase *)
 

Private Attributes

std::map< std::string, CustomPhysicsFactoryBase * > theTable
 

Detailed Description

Definition at line 35 of file CustomPhysicsTable.hh.

Constructor & Destructor Documentation

larg4::CustomPhysicsTable::CustomPhysicsTable ( )
default
larg4::CustomPhysicsTable::CustomPhysicsTable ( CustomPhysicsFactoryBase Factory)

Definition at line 18 of file CustomPhysicsTable.cxx.

19  {
20  if (!TheCustomPhysicsTable) {
23  }
24  else {
26  }
27  }
void AddPhysics(CustomPhysicsFactoryBase *)
static CustomPhysicsTable * TheCustomPhysicsTable

Member Function Documentation

void larg4::CustomPhysicsTable::AddPhysics ( CustomPhysicsFactoryBase Factory)

Definition at line 66 of file CustomPhysicsTable.cxx.

67  {
68 
69  if (IsPhysicsAvailable(Factory->GetName()))
70  mf::LogWarning("CustomPhysicsTable") << "Physics constructor being overwritten"
71  << " in CustomPhysicsTable";
72  TheCustomPhysicsTable->theTable[Factory->GetName()] = Factory;
73  MF_LOG_DEBUG("CustomPhysicsTable")
74  << "CustomPhysicsTable : Physics Table registering new physics " << Factory->GetName();
75  }
std::map< std::string, CustomPhysicsFactoryBase * > theTable
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define MF_LOG_DEBUG(id)
bool IsPhysicsAvailable(std::string const &)
static CustomPhysicsTable * TheCustomPhysicsTable
std::vector< std::string > larg4::CustomPhysicsTable::GetAvailablePhysicsList ( )

Definition at line 31 of file CustomPhysicsTable.cxx.

32  {
33  std::vector<std::string> ReturnVector;
36  i != TheCustomPhysicsTable->theTable.end();
37  i++) {
38  ReturnVector.push_back((*i).first);
39  }
40  return ReturnVector;
41  }
intermediate_table::const_iterator const_iterator
std::map< std::string, CustomPhysicsFactoryBase * > theTable
static CustomPhysicsTable * TheCustomPhysicsTable
std::map<std::string, CustomPhysicsFactoryBase*> const& larg4::CustomPhysicsTable::GetFullTable ( )
inline

Definition at line 43 of file CustomPhysicsTable.hh.

44  {
45  return theTable;
46  }
std::map< std::string, CustomPhysicsFactoryBase * > theTable
G4VPhysicsConstructor * larg4::CustomPhysicsTable::GetPhysicsConstructor ( std::string const &  physicsName)

Definition at line 55 of file CustomPhysicsTable.cxx.

56  {
57  if (IsPhysicsAvailable(PhysicsName)) {
58  return TheCustomPhysicsTable->theTable[PhysicsName]->Build();
59  }
60 
61  return nullptr;
62  }
std::map< std::string, CustomPhysicsFactoryBase * > theTable
bool IsPhysicsAvailable(std::string const &)
static CustomPhysicsTable * TheCustomPhysicsTable
bool larg4::CustomPhysicsTable::IsPhysicsAvailable ( std::string const &  PhysicsName)

Definition at line 45 of file CustomPhysicsTable.cxx.

46  {
47  if (!TheCustomPhysicsTable->theTable[PhysicsName])
48  return false;
49  else
50  return true;
51  }
std::map< std::string, CustomPhysicsFactoryBase * > theTable
static CustomPhysicsTable * TheCustomPhysicsTable

Member Data Documentation

std::map<std::string, CustomPhysicsFactoryBase*> larg4::CustomPhysicsTable::theTable
private

Definition at line 50 of file CustomPhysicsTable.hh.


The documentation for this class was generated from the following files: