#include <DatabaseAccessTool.h>
Definition at line 16 of file DatabaseAccessTool.h.
◆ DatabaseAccessTool() [1/2]
| DatabaseAccessTool::DatabaseAccessTool |
( |
| ) |
|
Definition at line 25 of file DatabaseAccessTool.cxx.
27{
28 ISvcLocator *svcLocator=Gaudi::svcLocator();
29 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
30 if (!geoModel.isValid()) {
31 throw std::runtime_error ("Cannot locate GeoModelSvc!!");
32 }
33
34 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service("RDBAccessSvc")};
35 if(!rdbAccess.isValid()) {
36 throw std::runtime_error ("Cannot locate RDBAccessSvc!!");
37 }
38 m_cw->pAccessSvc = rdbAccess.get();
39
40
41
43 std::string LArVersion = geoModel->LAr_VersionOverride();
44
46 m_cw->detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
47
48}
◆ ~DatabaseAccessTool()
| DatabaseAccessTool::~DatabaseAccessTool |
( |
| ) |
|
◆ DatabaseAccessTool() [2/2]
◆ getDouble()
| double DatabaseAccessTool::getDouble |
( |
const std::string & | TableName, |
|
|
const std::string & | FallbackVersion, |
|
|
const std::string & | ColumnName ) const |
Definition at line 55 of file DatabaseAccessTool.cxx.
57 {
58
59 std::map<std::string, IRDBRecordset_ptr>::iterator
m=
m_cw->recMap.find(TableName);
60
63 rec =
m_cw->pAccessSvc->getRecordsetPtr(TableName,FallbackVersion);
65 throw std::runtime_error((std::string("Cannot find the Table: ") + TableName).c_str());
66 }
67 }
68 double retval = (*rec)[0]->getDouble(ColumnName);
69 if (m==
m_cw->recMap.end()) {
70 m_cw->recMap[TableName]=std::move(rec);
71 }
73}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual unsigned int size() const =0
◆ operator=()
◆ m_cw
The documentation for this class was generated from the following files: