ATLAS Offline Software
Loading...
Searching...
No Matches
LArGeo::RAL Class Reference

#include <RAL.h>

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

Public Member Functions

 RAL ()=default
virtual ~RAL ()=default
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

RALExperimentalHall m_ExpHall {}
RALEmec m_Emec {}
RALEmb m_Emb {}
RALHec m_Hec {}

Static Private Attributes

static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE

Detailed Description

Definition at line 17 of file RAL.h.

Constructor & Destructor Documentation

◆ RAL()

LArGeo::RAL::RAL ( )
default

◆ ~RAL()

virtual 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 23 of file RAL.cxx.

29 {
30
31 // Call the appropriate GetValue() based on the contents of the
32 // string in a_name.
33
34 // Note: "npos" is defined in the <string> header. If it's the
35 // result of a find() method, then the sub-string was not found.
36
37 if ( a_name.find("ExpHall") != std::string::npos )
38 return m_ExpHall.GetValue(a_name,a0,a1,a2,a3,a4);
39
40 if ( a_name.find("EMEC") != std::string::npos )
41 return m_Emec.GetValue(a_name,a0,a1,a2,a3,a4);
42
43 if ( a_name.find("EMB") != std::string::npos )
44 return m_Emb.GetValue(a_name,a0,a1,a2,a3,a4);
45
46 if ( a_name.find("HEC") != std::string::npos )
47 return m_Hec.GetValue(a_name,a0,a1,a2,a3,a4);
48
49
50 // We didn't find a match. Throw an exception
51 MsgStream log(Athena::getMessageSvc(),"RAL");
52 std::string errMessage = "RAL::GetValue: could not find a match for the key '" + a_name;
53 log << MSG::FATAL << errMessage << endmsg;
54 throw std::runtime_error(errMessage);
55
56 // Unreached.
57 }
#define endmsg
RALExperimentalHall m_ExpHall
Definition RAL.h:31
RALEmec m_Emec
Definition RAL.h:32
RALEmb m_Emb
Definition RAL.h:33
RALHec m_Hec
Definition RAL.h:34
double a0
Definition globals.cxx:27
IMessageSvc * getMessageSvc(bool quiet=false)

◆ 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

RALEmb LArGeo::RAL::m_Emb {}
private

Definition at line 33 of file RAL.h.

33{};

◆ m_Emec

RALEmec LArGeo::RAL::m_Emec {}
private

Definition at line 32 of file RAL.h.

32{};

◆ m_ExpHall

RALExperimentalHall LArGeo::RAL::m_ExpHall {}
private

Definition at line 31 of file RAL.h.

31{};

◆ m_Hec

RALHec LArGeo::RAL::m_Hec {}
private

Definition at line 34 of file RAL.h.

34{};

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