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

#include <RALHec.h>

Inheritance diagram for LArGeo::RALHec:
Collaboration diagram for LArGeo::RALHec:

Classes

class  Clockwork
 

Public Member Functions

 RALHec ()
 
virtual ~RALHec ()
 
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

 RALHec (const RALHec &)
 
RALHecoperator= (const RALHec &)
 

Private Attributes

Clockworkm_c
 

Static Private Attributes

static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 20 of file RALHec.h.

Constructor & Destructor Documentation

◆ RALHec() [1/2]

LArGeo::RALHec::RALHec ( )

Definition at line 45 of file RALHec.cxx.

45  :
46  m_c(new Clockwork())
47 {
48  // First, fetch the Athena services.
49  ISvcLocator* svcLocator = Gaudi::svcLocator();
50 
51  IGeoDbTagSvc* geoDbTagSvc{nullptr};
52  StatusCode sc = svcLocator->service("GeoDbTagSvc",geoDbTagSvc);
53  if (sc != StatusCode::SUCCESS) {
54  throw std::runtime_error ("Cannot locate GeoDBTagSvc");
55  }
56 
57  IRDBAccessSvc* pAccessSvc{nullptr};
58  sc = svcLocator->service(geoDbTagSvc->getParamSvcName(),pAccessSvc);
59  if (sc != StatusCode::SUCCESS) {
60  throw std::runtime_error ("Cannot locate " + geoDbTagSvc->getParamSvcName());
61  }
62 
63  std::string detectorKey;
64  std::string detectorNode;
65 
66  if(geoDbTagSvc->getSqliteReader()==nullptr) {
67  // The geometry DB is used
68  IGeoModelSvc* geoModel{nullptr};
69  sc = svcLocator->service ("GeoModelSvc",geoModel);
70  if (sc != StatusCode::SUCCESS) {
71  throw std::runtime_error ("Cannot locate GeoModelSvc");
72  }
73 
74  std::string AtlasVersion = geoModel->atlasVersion();
75  std::string LArVersion = geoModel->LAr_VersionOverride();
76 
77  detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
78  detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
79  }
80 
81 
82  m_c->hadronicEndcap = pAccessSvc->getRecordsetPtr("HadronicEndcap",detectorKey, detectorNode);
83  m_c->hecGridValues = pAccessSvc->getRecordsetPtr("HecGridValues",detectorKey, detectorNode);
84  m_c->hecLongitudinalBlock = pAccessSvc->getRecordsetPtr("HecLongitudinalBlock",detectorKey, detectorNode);
85 
86 }

◆ ~RALHec()

LArGeo::RALHec::~RALHec ( )
virtual

Definition at line 89 of file RALHec.cxx.

90 {
91  delete m_c;
92 }

◆ RALHec() [2/2]

LArGeo::RALHec::RALHec ( const RALHec )
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::RALHec::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 95 of file RALHec.cxx.

101 {
102 
103  std::ostringstream A0STR;
104  A0STR << "_" << a0;
105  const std::string A0 = A0STR.str();
106 
107 
108  if ( a_name == "LArHECmoduleNumber" ) return (*m_c->hadronicEndcap)[0]->getInt("NSCT");
109  if ( a_name == "LArHECzStart" ) return (*m_c->hadronicEndcap)[0]->getDouble("ZSTART")*CLHEP::cm;
110  if ( a_name == "LArHECgapSize" ) return (*m_c->hadronicEndcap)[0]->getDouble("LARG")*CLHEP::cm;
111  if ( a_name == "LArHECbetweenWheel" ) return (*m_c->hadronicEndcap)[0]->getDouble("GAPWHL")*CLHEP::cm;
112  if ( a_name == "LArHECcopperPad" ) return (*m_c->hadronicEndcap)[0]->getDouble("COPPER")*CLHEP::cm;
113  if ( a_name == "LArHECplateWidth0" ) return (*m_c->hadronicEndcap)[0]->getDouble("PLATE_0")*CLHEP::cm;
114  if ( a_name == "LArHECplateWidth1" ) return (*m_c->hadronicEndcap)[0]->getDouble("PLATE_1")*CLHEP::cm;
115  if ( a_name == "LArHECkaptonPosition") return (*m_c->hadronicEndcap)[0]->getDouble("KPTPOS"+A0)*CLHEP::cm;
116  if ( a_name == "LArHECkaptonWidth" ) return (*m_c->hadronicEndcap)[0]->getDouble("KPTWID"+A0)*CLHEP::cm;
117  if ( a_name == "LArHECrodPosY" ) return (*m_c->hadronicEndcap)[0]->getDouble("RODPOSR"+A0)*CLHEP::cm;
118  if ( a_name == "LArHECrodPosX" ) return (*m_c->hadronicEndcap)[0]->getDouble("RODPOSX"+A0)*CLHEP::cm;
119  if ( a_name == "LArHECrodDim" ) return (*m_c->hadronicEndcap)[0]->getDouble("RODDIM"+A0)*CLHEP::cm;
120  if ( a_name == "LArHECspcDim" ) return (*m_c->hadronicEndcap)[0]->getDouble("SPCDIM"+A0)*CLHEP::cm;
121 
122  if ( a_name == "LArHECsliceIndex" ) return (*m_c->hecLongitudinalBlock)[a0]->getDouble("IBLC");
123  if ( a_name == "LArHECmoduleRinner1" ) return (*m_c->hecLongitudinalBlock)[0]->getDouble("BLRMN")*CLHEP::cm;
124  if ( a_name == "LArHECmoduleRinner2" ) return (*m_c->hecLongitudinalBlock)[1]->getDouble("BLRMN")*CLHEP::cm;
125  if ( a_name == "LArHECmoduleRouter" ) return (*m_c->hecLongitudinalBlock)[0]->getDouble("BLRMX")*CLHEP::cm;
126  if ( a_name == "LArHECdepthZ" ) return (*m_c->hecLongitudinalBlock)[a0]->getDouble("BLDPTH")*CLHEP::cm;
127  if ( a_name == "LArHECfirstAbsorber" ) return (*m_c->hecLongitudinalBlock)[a0]->getDouble("PLATE0")*CLHEP::cm;
128  if ( a_name == "LArHECgapNumber" ) return (*m_c->hecLongitudinalBlock)[a0]->getDouble("BLMOD");
129 
130  // We didn't find a match.
131  std::string errMessage = "RALHec::GetValue: could not find a match for the key '" + a_name;
132  std::cerr << errMessage << std::endl;
133  throw std::runtime_error (errMessage.c_str());
134 
135  // Unreached.
136 }

◆ operator=()

RALHec& LArGeo::RALHec::operator= ( const RALHec )
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::RALHec::m_c
private

Definition at line 38 of file RALHec.h.


The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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
LArGeo::RALHec::Clockwork::hecGridValues
IRDBRecordset_ptr hecGridValues
Definition: RALHec.cxx:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
a0
double a0
Definition: globals.cxx:27
LArGeo::RALHec::Clockwork::hadronicEndcap
IRDBRecordset_ptr hadronicEndcap
Definition: RALHec.cxx:39
LArGeo::RALHec::Clockwork::hecLongitudinalBlock
IRDBRecordset_ptr hecLongitudinalBlock
Definition: RALHec.cxx:41
LArGeo::RALHec::m_c
Clockwork * m_c
Definition: RALHec.h:37