23 ISvcLocator *svcLocator = Gaudi::svcLocator();
25 SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc")};
26 if(!geoModel.isValid())
27 throw std::runtime_error(
"Error in HECDetectorManager, cannot access GeoModelSvc");
29 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service(
"GeoDbTagSvc")};
30 if(!geoDbTagSvc.isValid())
31 throw std::runtime_error(
"Error in HECDetectorManager, cannot access GeoDbTagSvc");
33 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
34 if(!rdbAccess.isValid())
35 throw std::runtime_error(
"Error in HECDetectorManager, cannot access RDBAccessSvc");
37 std::string larKey, larNode;
38 if(geoDbTagSvc->getSqliteReader()==
nullptr) {
40 larKey = larVersionKey.
tag();
41 larNode = larVersionKey.
node();
44 IRDBRecordset_ptr barrelLongDiv = rdbAccess->getRecordsetPtr(
"BarrelLongDiv", larKey, larNode);
45 if (barrelLongDiv->
size()==0)
throw std::runtime_error(
"Error getting BarrelLongDiv table");
47 IRDBRecordset_ptr barrelGeometry = rdbAccess->getRecordsetPtr(
"BarrelGeometry", larKey, larNode);
48 if (barrelGeometry->
size()==0)
throw std::runtime_error(
"Error getting BarrelGeometry table");
50 IRDBRecordset_ptr presamplerGeometry = rdbAccess->getRecordsetPtr(
"PresamplerGeometry", larKey, larNode);
51 if (presamplerGeometry->
size()==0)
throw std::runtime_error(
"Error getting PresamplerGeometry table");
53 IRDBRecordset_ptr embSampSep = rdbAccess->getRecordsetPtr(
"EMBSampSep", larKey, larNode);
54 if (embSampSep->
size()==0) {
55 embSampSep = rdbAccess->getRecordsetPtr(
"EMBSampSep",
"EMBSampSep-00");
56 if (embSampSep->
size()==0) {
57 throw std::runtime_error(
"Error getting EMBSampSep table");
62 m_rInAc = (*barrelGeometry)[0]->getDouble(
"RIN_AC")*Gaudi::Units::cm;
63 m_rOutAc = (*barrelGeometry)[0]->getDouble(
"ROUT_AC")*Gaudi::Units::cm;
64 for (
int i=0;i<8;i++)
m_EE.push_back((*barrelLongDiv)[0]->getDouble(
"EE",i));
65 for (
int i=0;i<8;i++)
m_RMX12.push_back((*barrelLongDiv)[0]->getDouble(
"RMX12",i)*Gaudi::Units::cm);
66 for (
int i=0;i<53;i++)
m_RMX23.push_back((*barrelLongDiv)[0]->getDouble(
"RMX23",i)*Gaudi::Units::cm);
68 int sampSepSize = embSampSep->
size();
70 for (
int i{0}; i<sampSepSize; ++i) {