LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
larg4::CustomPhysicsTable Class Reference

#include "CustomPhysicsTable.hh"

Public Member Functions

 CustomPhysicsTable ()=default
 
 CustomPhysicsTable (CustomPhysicsFactoryBase *)
 
std::vector< std::string > GetAvailablePhysicsList ()
 
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

Referenced by CustomPhysicsTable().

larg4::CustomPhysicsTable::CustomPhysicsTable ( CustomPhysicsFactoryBase Factory)

Definition at line 18 of file CustomPhysicsTable.cxx.

References AddPhysics(), CustomPhysicsTable(), and larg4::TheCustomPhysicsTable.

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

Member Function Documentation

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

Definition at line 62 of file CustomPhysicsTable.cxx.

References larg4::CustomPhysicsFactoryBase::GetName(), IsPhysicsAvailable(), MF_LOG_DEBUG, larg4::TheCustomPhysicsTable, and theTable.

Referenced by CustomPhysicsTable(), and GetFullTable().

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

Definition at line 30 of file CustomPhysicsTable.cxx.

References larg4::TheCustomPhysicsTable, and theTable.

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

Definition at line 42 of file CustomPhysicsTable.hh.

References AddPhysics(), and theTable.

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

Definition at line 52 of file CustomPhysicsTable.cxx.

References IsPhysicsAvailable(), larg4::TheCustomPhysicsTable, and theTable.

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

Definition at line 43 of file CustomPhysicsTable.cxx.

References larg4::TheCustomPhysicsTable, and theTable.

Referenced by AddPhysics(), and GetPhysicsConstructor().

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

Member Data Documentation

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

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