ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
LArGeo::RAL Class Reference

#include <RAL.h>

Inheritance diagram for LArGeo::RAL:
Collaboration diagram for LArGeo::RAL:

Public Member Functions

 RAL ()
 
virtual ~RAL ()
 
virtual double GetValue (const std::string &, const int i0=INT_MIN, const int i1=INT_MIN, const int i2=INT_MIN, const int i3=INT_MIN, const int i4=INT_MIN) const override
 

Static Public Member Functions

static void SetInstance (std::unique_ptr< VDetectorParameters >)
 
static const VDetectorParametersGetInstance ()
 

Private Attributes

boost::scoped_ptr< RALExperimentalHallm_ExpHall
 
boost::scoped_ptr< RALEmecm_Emec
 
boost::scoped_ptr< RALEmbm_Emb
 
boost::scoped_ptr< RALHecm_Hec
 

Static Private Attributes

static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 27 of file RAL.h.

Constructor & Destructor Documentation

◆ RAL()

LArGeo::RAL::RAL ( )

Definition at line 20 of file RAL.cxx.

21  : m_ExpHall(new RALExperimentalHall())
22  , m_Emec(new RALEmec())
23  , m_Emb(new RALEmb())
24  , m_Hec(new RALHec())
25  {
26  }

◆ ~RAL()

LArGeo::RAL::~RAL ( )
virtualdefault

Member Function Documentation

◆ GetInstance()

const LArGeo::VDetectorParameters * LArGeo::VDetectorParameters::GetInstance ( )
staticinherited

Definition at line 29 of file VDetectorParameters.cxx.

30 {
31  const VDetectorParameters* p = s_instance.get();
32  if(p==nullptr)
33  std::cerr << "LArGeo::VDetectorParameters::GetInstance was called, but "
34  << "the pointer to the detector-parameter access object is 0."
35  << std::endl;
36 
37  return p;
38 }

◆ GetValue()

double LArGeo::RAL::GetValue ( const std::string &  a_name,
const int  i0 = INT_MIN,
const int  i1 = INT_MIN,
const int  i2 = INT_MIN,
const int  i3 = INT_MIN,
const int  i4 = INT_MIN 
) const
overridevirtual

Implements LArGeo::VDetectorParameters.

Definition at line 32 of file RAL.cxx.

38  {
39 
40  // Call the appropriate GetValue() based on the contents of the
41  // string in a_name.
42 
43  // Note: "npos" is defined in the <string> header. If it's the
44  // result of a find() method, then the sub-string was not found.
45 
46  if ( a_name.find("ExpHall") != std::string::npos )
47  return m_ExpHall->GetValue(a_name,a0,a1,a2,a3,a4);
48 
49  if ( a_name.find("EMEC") != std::string::npos )
50  return m_Emec->GetValue(a_name,a0,a1,a2,a3,a4);
51 
52  if ( a_name.find("EMB") != std::string::npos )
53  return m_Emb->GetValue(a_name,a0,a1,a2,a3,a4);
54 
55  if ( a_name.find("HEC") != std::string::npos )
56  return m_Hec->GetValue(a_name,a0,a1,a2,a3,a4);
57 
58 
59  // We didn't find a match. Throw an exception
60  std::string errMessage = "RAL::GetValue: could not find a match for the key '" + a_name;
61  std::cerr << errMessage << std::endl;
62  throw std::runtime_error(errMessage.c_str());
63 
64  // Unreached.
65  }

◆ SetInstance()

void LArGeo::VDetectorParameters::SetInstance ( std::unique_ptr< VDetectorParameters p)
staticinherited

Definition at line 24 of file VDetectorParameters.cxx.

25 {
26  s_instance.set (std::move (p));
27 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

CxxUtils::CachedUniquePtr<VDetectorParameters> s_instance LArGeo::VDetectorParameters::ATLAS_THREAD_SAFE
staticprivateinherited

Definition at line 64 of file VDetectorParameters.h.

◆ m_Emb

boost::scoped_ptr<RALEmb> LArGeo::RAL::m_Emb
private

Definition at line 48 of file RAL.h.

◆ m_Emec

boost::scoped_ptr<RALEmec> LArGeo::RAL::m_Emec
private

Definition at line 47 of file RAL.h.

◆ m_ExpHall

boost::scoped_ptr<RALExperimentalHall> LArGeo::RAL::m_ExpHall
private

Definition at line 46 of file RAL.h.

◆ m_Hec

boost::scoped_ptr<RALHec> LArGeo::RAL::m_Hec
private

Definition at line 49 of file RAL.h.


The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArGeo::RAL::m_Hec
boost::scoped_ptr< RALHec > m_Hec
Definition: RAL.h:49
LArGeo::VDetectorParameters::VDetectorParameters
VDetectorParameters()
Definition: VDetectorParameters.h:61
LArGeo::RAL::m_ExpHall
boost::scoped_ptr< RALExperimentalHall > m_ExpHall
Definition: RAL.h:46
a0
double a0
Definition: globals.cxx:27
LArGeo::RAL::m_Emb
boost::scoped_ptr< RALEmb > m_Emb
Definition: RAL.h:48
LArGeo::RAL::m_Emec
boost::scoped_ptr< RALEmec > m_Emec
Definition: RAL.h:47