Destructor.
198{
199 ISvcLocator *svcLocator = Gaudi::svcLocator();
200
201 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
202 if(!geoModel.isValid())
203 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoModelSvc");
204
205 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
206 if(!geoDbTagSvc.isValid())
207 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoDbTagSvc");
208
209 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
210 if(!rdbAccess.isValid())
211 throw std::runtime_error("Error in HECDetectorManager, cannot access RDBAccessSvc");
212
213 if(
m_c->detStore.retrieve().isFailure())
214 throw std::runtime_error("Error in HECDetectorManager, cannot access DetectorStore");
215
216 std::string detectorKey, detectorNode;
217
218 if(geoDbTagSvc->getSqliteReader()==nullptr) {
220 std::string LArVersion = geoModel->LAr_VersionOverride();
221
222 detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
223 detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
224 }
225
226 IRDBRecordset_ptr barrelGeometry = rdbAccess->getRecordsetPtr(
"BarrelGeometry",detectorKey,detectorNode);
227 if (barrelGeometry->
size()==0) {
228 throw std::runtime_error("Cannot find the BarrelGeometry Table");
229 }
230
231 IRDBRecordset_ptr barrelLongDiv = rdbAccess->getRecordsetPtr(
"BarrelLongDiv",detectorKey,detectorNode);
232 if (barrelLongDiv->
size()==0) {
233 throw std::runtime_error("Cannot find the BarrelLongDiv Table");
234 }
235
236
237 m_c->Nbrt = (*barrelGeometry)[0]->getInt(
"NBRT");
238
239 m_c->Nbrt1 =
m_c->Nbrt + 1;
240
241 m_c->gam0 = (*barrelGeometry)[0]->getDouble(
"PHIFIRST");
242
243 m_c->rint_eleFib = (*barrelGeometry)[0]->getDouble(
"RINT")*Gaudi::Units::cm;
244
245
246 for (
int idat = 0; idat <
m_c->Nbrt1 ; idat++)
247 {
248 m_c->rc[idat] = (*barrelGeometry)[0]->getDouble(
"RHOCEN",idat)*Gaudi::Units::cm;
249 m_c->phic[idat] = (*barrelGeometry)[0]->getDouble(
"PHICEN",idat)*Gaudi::Units::deg;
250 m_c->delta[idat] = (*barrelGeometry)[0]->getDouble(
"DELTA",idat)*Gaudi::Units::deg;
253 }
254
255 m_c->rMinAccordion = (*barrelGeometry)[0]->getDouble(
"RIN_AC")*Gaudi::Units::cm;
256 m_c->rMaxAccordion = (*barrelGeometry)[0]->getDouble(
"ROUT_AC")*Gaudi::Units::cm;
257 m_c->etaMaxBarrel = (*barrelGeometry)[0]->getDouble(
"ETACUT");
258 m_c->zMinBarrel = (*barrelLongDiv)[0]->getDouble(
"ZMAXACT")*Gaudi::Units::cm;
259 m_c->zMaxBarrel = (*barrelLongDiv)[0]->getDouble(
"ZMINACT")*Gaudi::Units::cm;
260
261
262 m_c->NCellTot = (*barrelGeometry)[0]->getInt(
"NCELMX");
264
265
266
268
269}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual unsigned int size() const =0