2#include "KKMC/ReadME.h"
3int ReadME::preRunNo=-1;
5 m_sampleName=-1; m_ecms=-1; m_ecmsErr=-1; m_aveEcms=-1; m_aveEcmsErr=-1; m_runNoValid=
false;
7 std::cout<<
"RunNo can not be 0"<<std::endl;
10 int runNum=std::abs(
runNo);
11 StatusCode scDbSvc=Gaudi::svcLocator()->service(
"DatabaseSvc", m_dbSvc,
true);
12 if(scDbSvc.isFailure()){
13 std::cout<<
"Gaudi::svcLocator()->service is Failed"<<std::endl;
17 snprintf(stmt, 1024,
"select sample, RunFrom, RunTo, Ecms, Ecms_err, Ave_Ecms, Ave_Ecms_err from MeasuredEcms2 where RunFrom <= %d and RunTo >= %d", runNum, runNum);
19 int rowNo=m_dbSvc->
query(
"offlinedb", stmt, res);
21 std::cout<<
"Can not find this RowNo"<<std::endl;
27 m_sampleName=records->
GetDouble(
"sample");
31 m_aveEcmsErr=records->
GetDouble(
"Ave_Ecms_err");
32 if(m_ecms!=-1) m_runNoValid=
true;
double GetDouble(std::string key)
virtual int query(const std::string &dbName, const std::string &sql, DatabaseRecordVector &res)=0
void readMeasuredEcms(int runNo)