BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
KKMC/KKMC-00-00-62/src/ReadME.cxx
Go to the documentation of this file.
1//======= Lianjin WU <[email protected]> ======
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;
6 if(runNo==0){
7 std::cout<<"RunNo can not be 0"<<std::endl;
8 }
9 else{
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;
14 }
15 else{
16 char stmt[400];
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);
20 if(rowNo==0){
21 std::cout<<"Can not find this RowNo"<<std::endl;
22 }
23 else{
24 DatabaseRecord* records=res[0];
25 m_runFrom=records->GetDouble("RunFrom");
26 m_runTo=records->GetDouble("RunTo");
27 m_sampleName=records->GetDouble("sample");
28 m_ecms=records->GetDouble("Ecms");
29 m_ecmsErr=records->GetDouble("Ecms_err");
30 m_aveEcms=records->GetDouble("Ave_Ecms");
31 m_aveEcmsErr=records->GetDouble("Ave_Ecms_err");
32 if(m_ecms!=-1) m_runNoValid=true;
33 }
34 }
35 }
36}
int runNo
Definition: DQA_TO_DB.cxx:12
double GetDouble(std::string key)
virtual int query(const std::string &dbName, const std::string &sql, DatabaseRecordVector &res)=0