14 #include "GaudiKernel/Bootstrap.h"
15 #include "GaudiKernel/ISvcLocator.h"
18 #include "CLHEP/Units/PhysicalConstants.h"
55 ISvcLocator* svcLocator = Gaudi::svcLocator();
57 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service(
"GeoDbTagSvc")};
58 if(!geoDbTagSvc.isValid()) {
59 throw std::runtime_error (
"Cannot locate GeoDBTagSvc");
62 SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service(geoDbTagSvc->getParamSvcName())};
63 if(!pAccessSvc.isValid()) {
64 throw std::runtime_error (
"Cannot locate " + geoDbTagSvc->getParamSvcName());
67 std::string detectorKey;
68 std::string detectorNode;
71 if(geoDbTagSvc->getSqliteReader()==
nullptr) {
73 SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc")};
74 if(!geoModel.isValid()) {
75 throw std::runtime_error (
"Cannot locate GeoModelSvc");
79 std::string LArVersion = geoModel->LAr_VersionOverride();
81 detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
82 detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
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);
90 m_c->
emecWhlOptParm = pAccessSvc->getRecordsetPtr(
"EmecWhlOptParm",detectorKey, detectorNode);
110 std::ostringstream A0STR;
112 const std::string A0 = A0STR.str();
114 std::ostringstream A1STR;
116 const std::string A1 = A1STR.str();
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;
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");
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;
136 if ( a_name ==
"LArEMECHalfCrack" )
return (*m_c->emecGeometry)[0]->getDouble(
"DCRACK")*
CLHEP::cm;
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);
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;
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;
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");
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;
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;
185 std::string errMessage =
"RALEmec::GetValue: could not find a match for the key '" + a_name;
187 throw std::runtime_error(errMessage);