28 ISvcLocator *svcLocator=Gaudi::svcLocator();
29 SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc")};
30 if (!geoModel.isValid()) {
31 throw std::runtime_error (
"Cannot locate GeoModelSvc!!");
34 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(
"RDBAccessSvc")};
35 if(!rdbAccess.isValid()) {
36 throw std::runtime_error (
"Cannot locate RDBAccessSvc!!");
38 m_cw->pAccessSvc = rdbAccess.get();
42 std::string AtlasVersion = geoModel->atlasVersion();
43 std::string LArVersion = geoModel->LAr_VersionOverride();
45 m_cw->detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
46 m_cw->detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
56 const std::string & FallbackVersion,
57 const std::string & ColumnName)
const {
59 std::map<std::string, IRDBRecordset_ptr>::iterator m=
m_cw->recMap.find(TableName);
63 rec =
m_cw->pAccessSvc->getRecordsetPtr(TableName,FallbackVersion);
65 throw std::runtime_error((std::string(
"Cannot find the Table: ") + TableName).c_str());
68 double retval = (*rec)[0]->getDouble(ColumnName);
69 if (m==
m_cw->recMap.end()) {
70 m_cw->recMap[TableName]=std::move(rec);