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

#include <RALExperimentalHall.h>

Inheritance diagram for LArGeo::RALExperimentalHall:
Collaboration diagram for LArGeo::RALExperimentalHall:

Classes

class  Clockwork
 

Public Member Functions

 RALExperimentalHall ()
 
virtual ~RALExperimentalHall ()
 
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 Member Functions

 RALExperimentalHall (const RALExperimentalHall &)
 
RALExperimentalHalloperator= (const RALExperimentalHall &)
 

Private Attributes

Clockworkm_c
 

Static Private Attributes

static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 17 of file RALExperimentalHall.h.

Constructor & Destructor Documentation

◆ RALExperimentalHall() [1/2]

RALExperimentalHall::RALExperimentalHall ( )

Definition at line 43 of file RALExperimentalHall.cxx.

43  :
44  m_c(new Clockwork())
45 {
46  // First, fetch the Athena services.
47  ISvcLocator* svcLocator = Gaudi::svcLocator();
48 
49  SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
50  if(!geoDbTagSvc.isValid()) {
51  throw std::runtime_error ("Cannot locate GeoDBTagSvc");
52  }
53 
54  SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service(geoDbTagSvc->getParamSvcName())};
55  if(!pAccessSvc.isValid()) {
56  throw std::runtime_error ("Cannot locate " + geoDbTagSvc->getParamSvcName());
57  }
58 
59  std::string AtlasVersion;
60 
61  if(geoDbTagSvc->getSqliteReader()==nullptr) {
62  // The geometry DB is used
63  SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
64  if(!geoModel.isValid()) {
65  throw std::runtime_error ("Cannot locate GeoModelSvc");
66  }
67 
68  AtlasVersion = geoModel->atlasVersion();
69  }
70 
71  m_c->atlasMother = pAccessSvc->getRecordsetPtr("AtlasMother",AtlasVersion, "ATLAS");
72 }

◆ ~RALExperimentalHall()

RALExperimentalHall::~RALExperimentalHall ( )
virtual

Definition at line 75 of file RALExperimentalHall.cxx.

76 {
77  delete m_c;
78 }

◆ RALExperimentalHall() [2/2]

LArGeo::RALExperimentalHall::RALExperimentalHall ( const RALExperimentalHall )
private

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 RALExperimentalHall::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 81 of file RALExperimentalHall.cxx.

87 {
88 
89  if ( a_name == "LArExpHallOutOfTimeCut" ) return 2.5*CLHEP::ns;
90  if ( a_name == "LArExpHallInnerRadius" ) return (*m_c->atlasMother)[1]->getDouble("RMIN")*CLHEP::cm;
91  if ( a_name == "LArExpHallOuterRadius" ) return (*m_c->atlasMother)[1]->getDouble("RMAX")*CLHEP::cm;
92  if ( a_name == "LArExpHallZmax" ) return (*m_c->atlasMother)[1]->getDouble("ZMAX")*CLHEP::cm;
93 
94  // We didn't find a match.
95  std::string errMessage = "RALExperimentalHall::GetValue: could not find a match for the key '" + a_name;
96  std::cerr << errMessage << std::endl;
97  throw std::runtime_error (errMessage.c_str());
98 
99  // Unreached
100 }

◆ operator=()

RALExperimentalHall& LArGeo::RALExperimentalHall::operator= ( const RALExperimentalHall )
private

◆ 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_c

Clockwork* LArGeo::RALExperimentalHall::m_c
private

Definition at line 35 of file RALExperimentalHall.h.


The documentation for this class was generated from the following files:
LArGeo::RALExperimentalHall::m_c
Clockwork * m_c
Definition: RALExperimentalHall.h:34
LArGeo::VDetectorParameters::VDetectorParameters
VDetectorParameters()
Definition: VDetectorParameters.h:61
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
LArGeo::RALExperimentalHall::Clockwork::atlasMother
IRDBRecordset_ptr atlasMother
Definition: RALExperimentalHall.cxx:38
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130