BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
ReadME Class Reference

#include <ReadME.h>

Public Member Functions

 ReadME (int runNo)
 
virtual ~ReadME ()
 
void readMeasuredEcms (int runNo)
 
int getSampleName ()
 
int getRunFrom ()
 
int getRunTo ()
 
bool isRunNoValid ()
 
double getEcms ()
 
double getEcmsErr ()
 
double getAveEcms ()
 
double getAveEcmsErr ()
 
void readDB (int runNo)
 
void readRunParams (int runNo)
 
 ReadME (int runNo)
 
virtual ~ReadME ()
 
void readMeasuredEcms (int runNo)
 
int getSampleName ()
 
int getRunFrom ()
 
int getRunTo ()
 
bool isRunNoValid ()
 
double getEcms ()
 
double getEcmsErr ()
 
double getAveEcms ()
 
double getAveEcmsErr ()
 

Detailed Description

Constructor & Destructor Documentation

◆ ReadME() [1/2]

ReadME::ReadME ( int  runNo)
inline

Definition at line 21 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

21 {
22 if(runNo!=preRunNo){
23 Gaudi::svcLocator()->service("DatabaseSvc", m_dbSvc, true);
25 preRunNo=runNo;
26 }
27 }
int runNo
Definition: DQA_TO_DB.cxx:12

◆ ~ReadME() [1/2]

virtual ReadME::~ReadME ( )
inlinevirtual

Definition at line 28 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

28{}

◆ ReadME() [2/2]

ReadME::ReadME ( int  runNo)
inline

Definition at line 21 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

21 {
22 if(runNo!=preRunNo){
23 preRunNo=runNo;
25 }
26 }

◆ ~ReadME() [2/2]

virtual ReadME::~ReadME ( )
inlinevirtual

Definition at line 27 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

27{}

Member Function Documentation

◆ getAveEcms() [1/2]

double ReadME::getAveEcms ( )
inline

Definition at line 37 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

37{return m_aveEcms;}

◆ getAveEcms() [2/2]

double ReadME::getAveEcms ( )
inline

Definition at line 36 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

36{return m_aveEcms;}

◆ getAveEcmsErr() [1/2]

double ReadME::getAveEcmsErr ( )
inline

Definition at line 38 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

38{return m_aveEcmsErr;}

◆ getAveEcmsErr() [2/2]

double ReadME::getAveEcmsErr ( )
inline

Definition at line 37 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

37{return m_aveEcmsErr;}

◆ getEcms() [1/2]

double ReadME::getEcms ( )
inline

Definition at line 35 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

35{return m_ecms;}

Referenced by EvtDecay::execute().

◆ getEcms() [2/2]

double ReadME::getEcms ( )
inline

Definition at line 34 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

34{return m_ecms;}

◆ getEcmsErr() [1/2]

double ReadME::getEcmsErr ( )
inline

Definition at line 36 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

36{return m_ecmsErr;}

◆ getEcmsErr() [2/2]

double ReadME::getEcmsErr ( )
inline

Definition at line 35 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

35{return m_ecmsErr;}

◆ getRunFrom() [1/2]

int ReadME::getRunFrom ( )
inline

Definition at line 32 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

32{return m_runFrom;}

◆ getRunFrom() [2/2]

int ReadME::getRunFrom ( )
inline

Definition at line 31 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

31{return m_runFrom;}

◆ getRunTo() [1/2]

int ReadME::getRunTo ( )
inline

Definition at line 33 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

33{return m_runTo;}

◆ getRunTo() [2/2]

int ReadME::getRunTo ( )
inline

Definition at line 32 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

32{return m_runTo;}

◆ getSampleName() [1/2]

int ReadME::getSampleName ( )
inline

Definition at line 31 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

31{return m_sampleName;}

◆ getSampleName() [2/2]

int ReadME::getSampleName ( )
inline

Definition at line 30 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

30{return m_sampleName;}

◆ isRunNoValid() [1/2]

bool ReadME::isRunNoValid ( )
inline

Definition at line 34 of file BesEvtGen/BesEvtGen-00-04-08/EvtGen_i/ReadME.h.

34{return m_runNoValid;}

Referenced by EvtDecay::execute().

◆ isRunNoValid() [2/2]

bool ReadME::isRunNoValid ( )
inline

Definition at line 33 of file KKMC/KKMC-00-00-62/KKMC/ReadME.h.

33{return m_runNoValid;}

◆ readDB()

void ReadME::readDB ( int  runNo)

Definition at line 35 of file BesEvtGen/BesEvtGen-00-04-08/src/ReadME.cxx.

35 {
36 RunParamsMin=11414;
37 RunParamsMax=23454;
38 MeasuredEcmsMin=23463;
39 MeasuredEcmsMax=38140;
40 DsRunParamsMin=43716;
41 DsRunParamsMax=47066;
42 runxyzMin=47543;
43 runxyzMax=51498;
44 if(std::abs(runNo)>=RunParamsMin&&std::abs(runNo)<=RunParamsMax) readRunParams(runNo);
45 if(std::abs(runNo)>=MeasuredEcmsMin&&std::abs(runNo)<=MeasuredEcmsMax) readMeasuredEcms(runNo);
46 if(std::abs(runNo)>=DsRunParamsMin&&std::abs(runNo)<=DsRunParamsMax) readRunParams(runNo);
47 if(std::abs(runNo)>=runxyzMin&&std::abs(runNo)<=runxyzMax) readMeasuredEcms(runNo);
48}

Referenced by ReadME().

◆ readMeasuredEcms() [1/2]

void ReadME::readMeasuredEcms ( int  runNo)

Definition at line 4 of file BesEvtGen/BesEvtGen-00-04-08/src/ReadME.cxx.

4 {
5 m_sampleName=0; m_ecms=0; m_ecmsErr=0;
6 m_aveEcms=0; m_aveEcmsErr=0; m_runFrom=0;
7 m_runTo=0; m_runNoValid=false;
8 m_px=0; m_py=0; m_pz=0;
9
10 std::cout<<"MeasuredEcmsSvc begin read database MeasuredEcmsSvc"<<std::endl;
11 int runNum=std::abs(runNo);
12 if(runNo<0) std::cout<<"MeasuredEcmsSvc for MC events"<<std::endl;
13 else std::cout<<"MeasuredEcmsSvc for DT events"<<std::endl;
14
15 char stmt[400];
16 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);
17
19 int rowNo=m_dbSvc->query("offlinedb", stmt, res);
20 if(rowNo==0){ std::cout<<"RowNo can not be 0 for MeasuredEcmsSvc, failed to read DB"<<std::endl; }
21 else{
22 DatabaseRecord* records=res[0];
23 std::cout<<"MeasuredEcmsSvc first read the runNo, read the MeasuredEcms database"<<runNo<<std::endl;
24 m_runFrom=records->GetDouble("RunFrom");
25 m_runTo=records->GetDouble("RunTo");
26 m_sampleName=records->GetDouble("sample");
27 m_ecms=records->GetDouble("Ecms");
28 // m_ecmsErr=records->GetDouble("Ecms_err");
29 // m_aveEcms=records->GetDouble("Ave_Ecms");
30 // m_aveEcmsErr=records->GetDouble("Ave_Ecms_err");
31 m_runNoValid=true;
32 }
33}
double GetDouble(std::string key)
virtual int query(const std::string &dbName, const std::string &sql, DatabaseRecordVector &res)=0

Referenced by readDB(), and ReadME().

◆ readMeasuredEcms() [2/2]

void ReadME::readMeasuredEcms ( int  runNo)

◆ readRunParams()

void ReadME::readRunParams ( int  runNo)

Definition at line 50 of file BesEvtGen/BesEvtGen-00-04-08/src/ReadME.cxx.

50 {
51 m_sampleName=0; m_ecms=0; m_ecmsErr=0;
52 m_aveEcms=0; m_aveEcmsErr=0; m_runFrom=0;
53 m_runTo=0; m_runNoValid=false;
54 m_px=0; m_py=0; m_pz=0;
55
56 std::cout<<"MeasuredEcmsSvc begin read database RunParams"<<std::endl;
57 int runNum=std::abs(runNo);
58
59 if(runNo<0) std::cout<<"MeasuredEcmsSvc for MC events"<<std::endl;
60 else std::cout<<"MeasuredEcmsSvc for DT events"<<std::endl;
61
62 char stmt1[400];
63 snprintf(stmt1, 1024, "select beam_energy, px, py, pz from RunParams where run_number = %d", runNum);
64
66 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
67 if(row_no==0){std::cout<<"RowNo can not be 0 for RunParams, failed to read DB"<<std::endl;}
68 else{
69 DatabaseRecord* records = res[0];
70 std::cout<<"MeasuredEcmsSvc first read the runNo, read the RunParams database"<<runNo<<std::endl;
71 double bE=0;
72 bE=records->GetDouble("beam_energy");
73 m_px=records->GetDouble("px");
74 m_py=records->GetDouble("py");
75 m_pz=records->GetDouble("pz");
76 m_ecms=bE*2.00;
77 m_runNoValid=true;
78 }
79}

Referenced by readDB().


The documentation for this class was generated from the following files: