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 20 of file RALExperimentalHall.h.

Constructor & Destructor Documentation

◆ RALExperimentalHall() [1/2]

LArGeo::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  IGeoDbTagSvc* geoDbTagSvc{nullptr};
50  StatusCode sc = svcLocator->service("GeoDbTagSvc",geoDbTagSvc);
51  if (sc != StatusCode::SUCCESS) {
52  throw std::runtime_error ("Cannot locate GeoDBTagSvc");
53  }
54 
55  IRDBAccessSvc* pAccessSvc{nullptr};
56  sc = svcLocator->service(geoDbTagSvc->getParamSvcName(),pAccessSvc);
57  if (sc != StatusCode::SUCCESS) {
58  throw std::runtime_error ("Cannot locate " + geoDbTagSvc->getParamSvcName());
59  }
60 
61  std::string AtlasVersion;
62 
63  if(geoDbTagSvc->getSqliteReader()==nullptr) {
64  // The geometry DB is used
65  IGeoModelSvc* geoModel{nullptr};
66  sc = svcLocator->service ("GeoModelSvc",geoModel);
67  if (sc != StatusCode::SUCCESS) {
68  throw std::runtime_error ("Cannot locate GeoModelSvc");
69  }
70 
71  AtlasVersion = geoModel->atlasVersion();
72  }
73 
74  m_c->atlasMother = pAccessSvc->getRecordsetPtr("AtlasMother",AtlasVersion, "ATLAS");
75 }

◆ ~RALExperimentalHall()

LArGeo::RALExperimentalHall::~RALExperimentalHall ( )
virtual

Definition at line 78 of file RALExperimentalHall.cxx.

79 {
80  delete m_c;
81 }

◆ 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 LArGeo::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 84 of file RALExperimentalHall.cxx.

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

◆ 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 38 of file RALExperimentalHall.h.


The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArGeo::RALExperimentalHall::m_c
Clockwork * m_c
Definition: RALExperimentalHall.h:37
IGeoModelSvc
Definition: IGeoModelSvc.h:17
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArGeo::VDetectorParameters::VDetectorParameters
VDetectorParameters()
Definition: VDetectorParameters.h:61
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
LArGeo::RALExperimentalHall::Clockwork::atlasMother
IRDBRecordset_ptr atlasMother
Definition: RALExperimentalHall.cxx:38
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130