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

#include <RALEmec.h>

Inheritance diagram for LArGeo::RALEmec:
Collaboration diagram for LArGeo::RALEmec:

Classes

class  Clockwork
 

Public Member Functions

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

 RALEmec (const RALEmec &)
 
RALEmecoperator= (const RALEmec &)
 

Private Attributes

Clockworkm_c
 

Static Private Attributes

static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 17 of file RALEmec.h.

Constructor & Destructor Documentation

◆ RALEmec() [1/2]

RALEmec::RALEmec ( )

Definition at line 51 of file RALEmec.cxx.

51  :
52  m_c(new Clockwork())
53 {
54  // First, fetch the Athena services.
55  ISvcLocator* svcLocator = Gaudi::svcLocator();
56 
57  SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
58  if(!geoDbTagSvc.isValid()) {
59  throw std::runtime_error ("Cannot locate GeoDBTagSvc");
60  }
61 
62  SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service(geoDbTagSvc->getParamSvcName())};
63  if(!pAccessSvc.isValid()) {
64  throw std::runtime_error ("Cannot locate " + geoDbTagSvc->getParamSvcName());
65  }
66 
67  std::string detectorKey;
68  std::string detectorNode;
69  std::string AtlasVersion;
70 
71  if(geoDbTagSvc->getSqliteReader()==nullptr) {
72  // The geometry DB is used
73  SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
74  if(!geoModel.isValid()) {
75  throw std::runtime_error ("Cannot locate GeoModelSvc");
76  }
77 
78  AtlasVersion = geoModel->atlasVersion();
79  std::string LArVersion = geoModel->LAr_VersionOverride();
80 
81  detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
82  detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
83  }
84 
85  m_c->emecCylLayer = pAccessSvc->getRecordsetPtr("EmecCylLayer",detectorKey, detectorNode);
86  m_c->emecGeometry = pAccessSvc->getRecordsetPtr("EmecGeometry",detectorKey, detectorNode);
87  m_c->emecRapRegion = pAccessSvc->getRecordsetPtr("EmecRapRegion",detectorKey, detectorNode);
88  m_c->emecSamplingSep = pAccessSvc->getRecordsetPtr("EmecSamplingSep",detectorKey, detectorNode);
89  m_c->emecWheelParameters = pAccessSvc->getRecordsetPtr("EmecWheelParameters",detectorKey, detectorNode);
90  m_c->emecWhlOptParm = pAccessSvc->getRecordsetPtr("EmecWhlOptParm",detectorKey, detectorNode);
91  m_c->presamplerPosition = pAccessSvc->getRecordsetPtr("PresamplerPosition",AtlasVersion, "ATLAS");
92 
93 }

◆ ~RALEmec()

RALEmec::~RALEmec ( )
virtual

Definition at line 96 of file RALEmec.cxx.

97 {
98  delete m_c;
99 }

◆ RALEmec() [2/2]

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

108 {
109 
110  std::ostringstream A0STR;
111  A0STR << "_" << a0;
112  const std::string A0 = A0STR.str();
113 
114  std::ostringstream A1STR;
115  A1STR << "_" << a1;
116  const std::string A1 = A1STR.str();
117 
118 
119 
120 
121  if ( a_name == "LArEMECZshift" ) return (*m_c->emecGeometry)[0]->getDouble("ZSHIFT")*CLHEP::cm;
122  if ( a_name == "LArEMECRadiusMin" ) return (*m_c->emecGeometry)[0]->getDouble("RMIN")*CLHEP::cm;
123  if ( a_name == "LArEMECRadiusMax" ) return (*m_c->emecGeometry)[0]->getDouble("RMAX")*CLHEP::cm;
124 
125  if ( a_name == "LArEMECAverageGap" ) return (*m_c->emecGeometry)[0]->getDouble("GAP0")*CLHEP::cm;
126  if ( a_name == "LArEMECStartAbsLength" ) return (*m_c->emecGeometry)[0]->getDouble("SABL")*CLHEP::cm;
127  if ( a_name == "LArEMECRefPoint" ) return (*m_c->emecGeometry)[0]->getDouble("Z0")*CLHEP::cm;
128  if ( a_name == "LArEMECNomLarOrig" ) return (*m_c->emecGeometry)[0]->getDouble("Z1")*CLHEP::cm;
129  if ( a_name == "LArEMECMaxRadiusActivePart" ) return (*m_c->emecGeometry)[0]->getDouble("RLIMIT")*CLHEP::cm;
130  if ( a_name == "LArEMECNumberRadialLayer" ) return (*m_c->emecGeometry)[0]->getInt("NLAYER");
131 
132  if ( a_name == "LArEMECLArThickness" ) return (*m_c->emecGeometry)[0]->getDouble("ETOT")*CLHEP::cm;
133  if ( a_name == "LArEMECKaptonThickness" ) return (*m_c->emecGeometry)[0]->getDouble("EKAP")*CLHEP::cm;
134  if ( a_name == "LArEMECCopperThickness" ) return (*m_c->emecGeometry)[0]->getDouble("ECU")*CLHEP::cm;
135 
136  if ( a_name == "LArEMECHalfCrack" ) return (*m_c->emecGeometry)[0]->getDouble("DCRACK")*CLHEP::cm;
137 
138  if ( a_name == "LArEMECRegionEtaGranularity" ) return (*m_c->emecGeometry)[0]->getDouble("DETA"+A0);
139  if ( a_name == "LArEMECRegionPhiGranularity" ) return (*m_c->emecGeometry)[0]->getDouble("DPHI"+A0);
140 
141 
142  if ( a_name == "LArEMECLayerInnerRadius" ) return (*m_c->emecCylLayer)[a0]->getDouble("RADIL")*CLHEP::cm;
143  if ( a_name == "LArEMECLayerOuterRadius" ) return (*m_c->emecCylLayer)[a0]->getDouble("RADOL")*CLHEP::cm;
144  if ( a_name == "LArEMECLayerInnerAngle" ) return (*m_c->emecCylLayer)[a0]->getDouble("ALFIL")*CLHEP::rad;
145  if ( a_name == "LArEMECLayerOuterAngle" ) return (*m_c->emecCylLayer)[a0]->getDouble("ALFOL")*CLHEP::rad;
146  if ( a_name == "LArEMECAbsorberInnerThickness" ) return (*m_c->emecCylLayer)[a0]->getDouble("TCKIL")*CLHEP::cm;
147  if ( a_name == "LArEMECAbsorberOuterThickness" ) return (*m_c->emecCylLayer)[a0]->getDouble("TCKOL")*CLHEP::cm;
148  if ( a_name == "LArEMECRegionLowEta" ) return (*m_c->emecRapRegion)[a0]->getDouble("ETA1");
149  if ( a_name == "LArEMECRegionHighEta" ) return (*m_c->emecRapRegion)[a0]->getDouble("ETA2");
150  if ( a_name == "LArEMECRegionLowEtaDepth" ) return (*m_c->emecRapRegion)[a0]->getDouble("ZMN"+A1)*CLHEP::cm;
151  if ( a_name == "LArEMECRegionHighEtaDepth" ) return (*m_c->emecRapRegion)[a0]->getDouble("ZMX"+A1)*CLHEP::cm;
152 
153  if ( a_name == "LArEMECLengthSeparationArrays" ) return (*m_c->emecSamplingSep)[0]->getInt("NSEP"+A0);
154  if ( a_name == "LArEMECInnerWheelSeparation" ) return (*m_c->emecSamplingSep)[0]->getDouble("ZIW"+A0)*CLHEP::cm;
155  if ( a_name == "LArEMECZSeparation12" ) return (*m_c->emecSamplingSep)[0]->getDouble("ZSEP12"+A0)*CLHEP::cm;
156  if ( a_name == "LArEMECZSeparation23" ) return (*m_c->emecSamplingSep)[0]->getDouble("ZSEP23"+A0)*CLHEP::cm;
157 
158  // In this case (since the number of wheels isn't likely to change),
159  // hard-code the inner versus the outer wheel.
160  if ( a_name == "LArEMECInnerNumberAbsorbers" ) return (*m_c->emecWheelParameters)[0]->getInt("NABS");
161  if ( a_name == "LArEMECInnerNumberWaves" ) return (*m_c->emecWheelParameters)[0]->getInt("NACC");
162  if ( a_name == "LArEMECInnerMaxEta" ) return (*m_c->emecWheelParameters)[0]->getDouble("ETAINT");
163  if ( a_name == "LArEMECInnerMinEta" ) return (*m_c->emecWheelParameters)[0]->getDouble("ETAEXT");
164  if ( a_name == "LArEMECOuterNumberAbsorbers" ) return (*m_c->emecWheelParameters)[1]->getInt("NABS");
165  if ( a_name == "LArEMECOuterNumberWaves" ) return (*m_c->emecWheelParameters)[1]->getInt("NACC");
166  if ( a_name == "LArEMECOuterMaxEta" ) return (*m_c->emecWheelParameters)[1]->getDouble("ETAINT");
167  if ( a_name == "LArEMECOuterMinEta" ) return (*m_c->emecWheelParameters)[1]->getDouble("ETAEXT");
168 
169  if ( a_name == "LArEMECInnerBeta" ) return (*m_c->emecWhlOptParm)[0]->getDouble("BETX");
170  if ( a_name == "LArEMECInnerLowerAngle" ) return (*m_c->emecWhlOptParm)[0]->getDouble("ALFINT")*CLHEP::rad;
171  if ( a_name == "LArEMECInnerUpperAngle" ) return (*m_c->emecWhlOptParm)[0]->getDouble("ALFEXT")*CLHEP::rad;
172  if ( a_name == "LArEMECInnerLeadThickness" ) return (*m_c->emecWhlOptParm)[0]->getDouble("PBTH")*CLHEP::cm;
173  if ( a_name == "LArEMECOuterBeta" ) return (*m_c->emecWhlOptParm)[1]->getDouble("BETX");
174  if ( a_name == "LArEMECOuterLowerAngle" ) return (*m_c->emecWhlOptParm)[1]->getDouble("ALFINT")*CLHEP::rad;
175  if ( a_name == "LArEMECOuterUpperAngle" ) return (*m_c->emecWhlOptParm)[1]->getDouble("ALFEXT")*CLHEP::rad;
176  if ( a_name == "LArEMECOuterLeadThickness" ) return (*m_c->emecWhlOptParm)[1]->getDouble("PBTH")*CLHEP::cm;
177 
178  if ( a_name == "LArEMECPreNomPos" ) return (*m_c->presamplerPosition)[0]->getDouble("ZPOS")*CLHEP::cm;
179  if ( a_name == "LArEMECPreThickness" ) return (*m_c->presamplerPosition)[0]->getDouble("TCK")*CLHEP::cm;
180  if ( a_name == "LArEMECPreMinRadius" ) return (*m_c->presamplerPosition)[0]->getDouble("RMIN")*CLHEP::cm;
181  if ( a_name == "LArEMECPreMaxRadius" ) return (*m_c->presamplerPosition)[0]->getDouble("RMAX")*CLHEP::cm;
182 
183  // We didn't find a match.
184  MsgStream log(Athena::getMessageSvc(),"RALEmec");
185  std::string errMessage = "RALEmec::GetValue: could not find a match for the key '" + a_name;
186  log << MSG::FATAL << errMessage << endmsg;
187  throw std::runtime_error(errMessage);
188 
189  // Unreached
190 }

◆ operator=()

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

Definition at line 35 of file RALEmec.h.


The documentation for this class was generated from the following files:
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
LArGeo::RALEmec::Clockwork::emecCylLayer
IRDBRecordset_ptr emecCylLayer
Definition: RALEmec.cxx:41
LArGeo::RALEmec::Clockwork::emecSamplingSep
IRDBRecordset_ptr emecSamplingSep
Definition: RALEmec.cxx:44
LArGeo::RALEmec::Clockwork::emecRapRegion
IRDBRecordset_ptr emecRapRegion
Definition: RALEmec.cxx:43
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
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::RALEmec::Clockwork::emecWheelParameters
IRDBRecordset_ptr emecWheelParameters
Definition: RALEmec.cxx:45
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
a0
double a0
Definition: globals.cxx:27
LArGeo::RALEmec::m_c
Clockwork * m_c
Definition: RALEmec.h:34
LArGeo::RALEmec::Clockwork::presamplerPosition
IRDBRecordset_ptr presamplerPosition
Definition: RALEmec.cxx:47
LArGeo::RALEmec::Clockwork::emecWhlOptParm
IRDBRecordset_ptr emecWhlOptParm
Definition: RALEmec.cxx:46
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
LArGeo::RALEmec::Clockwork::emecGeometry
IRDBRecordset_ptr emecGeometry
Definition: RALEmec.cxx:42