BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
MeasuredEcmsSvc Class Reference

#include <MeasuredEcmsSvc.h>

+ Inheritance diagram for MeasuredEcmsSvc:

Public Member Functions

 MeasuredEcmsSvc (const std::string &name, ISvcLocator *svcLoc)
 
virtual ~MeasuredEcmsSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIF)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &)
 
void readMeasuredEcms (int runNo)
 
void readRunParams (int runNo)
 
void readDB (int runNo)
 
int getSampleName (int runNo)
 
int getRunFrom (int runNo)
 
int getRunTo (int runNo)
 
double getEcmsErr (int runNo)
 
double getAveEcms (int runNo)
 
double getAveEcmsErr (int runNo)
 
double getPx (int runNo)
 
double getPy (int runNo)
 
double getPz (int runNo)
 
double getEcms (int runNo)
 
bool isRunNoValid (int runNo)
 
bool isGetEcmsValid (int runNo)
 
void readInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
double getInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
bool isGetInfoValid (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
void readInfo (int runNo)
 
double getInfo (int runNo)
 
bool isGetInfoValid (int runNo)
 
void readRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
std::string getRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
bool isGetRecordValid (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
void readRecord (int runNo)
 
std::string getRecord (int runNo)
 
bool isGetRecordValid (int runNo)
 
void readMeasuredEcms2 (int runNo)
 
void readRunParams2 (int runNo)
 
int getSampleName ()
 
int getRunFrom ()
 
int getRunTo ()
 
double getEcmsErr ()
 
double getAveEcms ()
 
double getAveEcmsErr ()
 
double getPx ()
 
double getPy ()
 
double getPz ()
 
double getEcms ()
 
bool isReadDBValid ()
 
bool isGetEcmsValid ()
 
bool isRunNoValid ()
 
 MeasuredEcmsSvc (const std::string &name, ISvcLocator *svcLoc)
 
virtual ~MeasuredEcmsSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvIF)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &)
 
void readMeasuredEcms (int runNo)
 
void readRunParams (int runNo)
 
void readDB (int runNo)
 
int getSampleName (int runNo)
 
int getRunFrom (int runNo)
 
int getRunTo (int runNo)
 
double getEcmsErr (int runNo)
 
double getAveEcms (int runNo)
 
double getAveEcmsErr (int runNo)
 
double getPx (int runNo)
 
double getPy (int runNo)
 
double getPz (int runNo)
 
double getEcms (int runNo)
 
bool isRunNoValid (int runNo)
 
bool isGetEcmsValid (int runNo)
 
void readInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
double getInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
bool isGetInfoValid (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
void readInfo (int runNo)
 
double getInfo (int runNo)
 
bool isGetInfoValid (int runNo)
 
void readRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
std::string getRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
bool isGetRecordValid (int runNo, char *tab, char *col, char *min_col, char *max_col)
 
void readRecord (int runNo)
 
std::string getRecord (int runNo)
 
bool isGetRecordValid (int runNo)
 
void readMeasuredEcms2 (int runNo)
 
void readRunParams2 (int runNo)
 
int getSampleName ()
 
int getRunFrom ()
 
int getRunTo ()
 
double getEcmsErr ()
 
double getAveEcms ()
 
double getAveEcmsErr ()
 
double getPx ()
 
double getPy ()
 
double getPz ()
 
double getEcms ()
 
bool isReadDBValid ()
 
bool isGetEcmsValid ()
 
bool isRunNoValid ()
 
- Public Member Functions inherited from IMeasuredEcmsSvc
virtual ~IMeasuredEcmsSvc ()
 
virtual void readMeasuredEcms (int runNo)=0
 
virtual void readRunParams (int runNo)=0
 
virtual void readDB (int runNo)=0
 
virtual int getSampleName (int runNo)=0
 
virtual int getRunFrom (int runNo)=0
 
virtual int getRunTo (int runNo)=0
 
virtual double getEcmsErr (int runNo)=0
 
virtual double getAveEcms (int runNo)=0
 
virtual double getAveEcmsErr (int runNo)=0
 
virtual double getPx (int runNo)=0
 
virtual double getPy (int runNo)=0
 
virtual double getPz (int runNo)=0
 
virtual double getEcms (int runNo)=0
 
virtual bool isRunNoValid (int runNo)=0
 
virtual bool isGetEcmsValid (int runNo)=0
 
virtual void readInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual double getInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual bool isGetInfoValid (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual void readInfo (int runNo)=0
 
virtual double getInfo (int runNo)=0
 
virtual bool isGetInfoValid (int runNo)=0
 
virtual void readRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual std::string getRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual bool isGetRecordValid (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual void readRecord (int runNo)=0
 
virtual std::string getRecord (int runNo)=0
 
virtual bool isGetRecordValid (int runNo)=0
 
virtual void readMeasuredEcms2 (int runNo)=0
 
virtual void readRunParams2 (int runNo)=0
 
virtual int getSampleName ()=0
 
virtual int getRunFrom ()=0
 
virtual int getRunTo ()=0
 
virtual bool isRunNoValid ()=0
 
virtual double getEcmsErr ()=0
 
virtual double getAveEcms ()=0
 
virtual double getAveEcmsErr ()=0
 
virtual double getPx ()=0
 
virtual double getPy ()=0
 
virtual double getPz ()=0
 
virtual double getEcms ()=0
 
virtual bool isReadDBValid ()=0
 
virtual bool isGetEcmsValid ()=0
 
virtual ~IMeasuredEcmsSvc ()
 
virtual void readMeasuredEcms (int runNo)=0
 
virtual void readRunParams (int runNo)=0
 
virtual void readDB (int runNo)=0
 
virtual int getSampleName (int runNo)=0
 
virtual int getRunFrom (int runNo)=0
 
virtual int getRunTo (int runNo)=0
 
virtual double getEcmsErr (int runNo)=0
 
virtual double getAveEcms (int runNo)=0
 
virtual double getAveEcmsErr (int runNo)=0
 
virtual double getPx (int runNo)=0
 
virtual double getPy (int runNo)=0
 
virtual double getPz (int runNo)=0
 
virtual double getEcms (int runNo)=0
 
virtual bool isRunNoValid (int runNo)=0
 
virtual bool isGetEcmsValid (int runNo)=0
 
virtual void readInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual double getInfo (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual bool isGetInfoValid (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual void readInfo (int runNo)=0
 
virtual double getInfo (int runNo)=0
 
virtual bool isGetInfoValid (int runNo)=0
 
virtual void readRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual std::string getRecord (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual bool isGetRecordValid (int runNo, char *tab, char *col, char *min_col, char *max_col)=0
 
virtual void readRecord (int runNo)=0
 
virtual std::string getRecord (int runNo)=0
 
virtual bool isGetRecordValid (int runNo)=0
 
virtual void readMeasuredEcms2 (int runNo)=0
 
virtual void readRunParams2 (int runNo)=0
 
virtual int getSampleName ()=0
 
virtual int getRunFrom ()=0
 
virtual int getRunTo ()=0
 
virtual bool isRunNoValid ()=0
 
virtual double getEcmsErr ()=0
 
virtual double getAveEcms ()=0
 
virtual double getAveEcmsErr ()=0
 
virtual double getPx ()=0
 
virtual double getPy ()=0
 
virtual double getPz ()=0
 
virtual double getEcms ()=0
 
virtual bool isReadDBValid ()=0
 
virtual bool isGetEcmsValid ()=0
 

Friends

class CnvFactory< MeasuredEcmsSvc >
 

Additional Inherited Members

- Static Public Member Functions inherited from IMeasuredEcmsSvc
static const InterfaceID & interfaceID ()
 
static const InterfaceID & interfaceID ()
 

Detailed Description

Constructor & Destructor Documentation

◆ MeasuredEcmsSvc() [1/2]

MeasuredEcmsSvc::MeasuredEcmsSvc ( const std::string &  name,
ISvcLocator *  svcLoc 
)

Definition at line 4 of file MeasuredEcmsSvc.cxx.

4 :Service(name, svcLoc){
5 declareProperty("RunParamsMin", RunParamsMin=11414);
6 declareProperty("RunParamsMax", RunParamsMax=23454);
7
8 declareProperty("MeasuredEcmsMin", MeasuredEcmsMin=23463);
9 declareProperty("MeasuredEcmsMax", MeasuredEcmsMax=38140);
10
11 declareProperty("TableName", table="RunParams");
12 declareProperty("ColumnName", column="beam_energy");
13 declareProperty("DownRangeColumnName", down_column="run_number");
14 declareProperty("UpRangeColumnName", up_column="run_number");
15}

◆ ~MeasuredEcmsSvc() [1/2]

MeasuredEcmsSvc::~MeasuredEcmsSvc ( )
virtual

Definition at line 17 of file MeasuredEcmsSvc.cxx.

17{}

◆ MeasuredEcmsSvc() [2/2]

MeasuredEcmsSvc::MeasuredEcmsSvc ( const std::string &  name,
ISvcLocator *  svcLoc 
)

◆ ~MeasuredEcmsSvc() [2/2]

virtual MeasuredEcmsSvc::~MeasuredEcmsSvc ( )
virtual

Member Function Documentation

◆ finalize() [1/2]

StatusCode MeasuredEcmsSvc::finalize ( )
virtual

Definition at line 50 of file MeasuredEcmsSvc.cxx.

50 {
51 MsgStream log(msgSvc(), name());
52 log<<MSG::INFO<<"MeasuredEcmsSvc finalize begin here"<<endreq;
53
54 StatusCode status= Service::finalize();
55 if(!status.isSuccess()){
56 log<<MSG::ERROR<<"MeasuredEcmsSvc Can not finalize"<<endreq;
57 return status;
58 }
59
60 log<<MSG::INFO<<"MeasuredEcmsSvc finalized successfully"<<endreq;
61 return StatusCode::SUCCESS;
62}

◆ finalize() [2/2]

virtual StatusCode MeasuredEcmsSvc::finalize ( )
virtual

◆ getAveEcms() [1/4]

double MeasuredEcmsSvc::getAveEcms ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 59 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

59{return m_aveEcms2;}

◆ getAveEcms() [2/4]

double MeasuredEcmsSvc::getAveEcms ( )
inlinevirtual

◆ getAveEcms() [3/4]

double MeasuredEcmsSvc::getAveEcms ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 188 of file MeasuredEcmsSvc.cxx.

188 {
189 MsgStream log(msgSvc(), name());
190 log<<MSG::INFO<<"MeasuredEcmsSvc read the average ecms"<<endreq;
191 if(old_runNo!=runNo){
192 readDB(runNo);
193 old_runNo=runNo;
194 }
195 return m_aveEcms;
196}
int runNo
Definition: DQA_TO_DB.cxx:12
void readDB(int runNo)

◆ getAveEcms() [4/4]

double MeasuredEcmsSvc::getAveEcms ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getAveEcmsErr() [1/4]

double MeasuredEcmsSvc::getAveEcmsErr ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 60 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

60{return m_aveEcmsErr2;}

◆ getAveEcmsErr() [2/4]

double MeasuredEcmsSvc::getAveEcmsErr ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 60 of file Utilities/MeasuredEcmsSvc/MeasuredEcmsSvc-00-00-19/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

60{return m_aveEcmsErr2;}

◆ getAveEcmsErr() [3/4]

double MeasuredEcmsSvc::getAveEcmsErr ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 198 of file MeasuredEcmsSvc.cxx.

198 {
199 MsgStream log(msgSvc(), name());
200 log<<MSG::INFO<<"MeasuredEcmsSvc read the error of the average ecms"<<endreq;
201 if(old_runNo!=runNo){
202 readDB(runNo);
203 old_runNo=runNo;
204 }
205 return m_aveEcmsErr;
206}

◆ getAveEcmsErr() [4/4]

double MeasuredEcmsSvc::getAveEcmsErr ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getEcms() [1/4]

double MeasuredEcmsSvc::getEcms ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 64 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

64{return m_ecms2;}

◆ getEcms() [2/4]

double MeasuredEcmsSvc::getEcms ( )
inlinevirtual

◆ getEcms() [3/4]

double MeasuredEcmsSvc::getEcms ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 208 of file MeasuredEcmsSvc.cxx.

208 {
209 MsgStream log(msgSvc(), name());
210 log<<MSG::INFO<<"MeasuredEcmsSvc read the ecms"<<endreq;
211 if(old_runNo!=runNo){
212 readDB(runNo);
213 old_runNo=runNo;
214 }
215 return m_ecms;
216}

◆ getEcms() [4/4]

double MeasuredEcmsSvc::getEcms ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getEcmsErr() [1/4]

double MeasuredEcmsSvc::getEcmsErr ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 58 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

58{return m_ecmsErr2;}

◆ getEcmsErr() [2/4]

double MeasuredEcmsSvc::getEcmsErr ( )
inlinevirtual

◆ getEcmsErr() [3/4]

double MeasuredEcmsSvc::getEcmsErr ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 178 of file MeasuredEcmsSvc.cxx.

178 {
179 MsgStream log(msgSvc(), name());
180 log<<MSG::INFO<<"MeasuredEcmsSvc read the error of ecms"<<endreq;
181 if(old_runNo!=runNo){
182 readDB(runNo);
183 old_runNo=runNo;
184 }
185 return m_ecmsErr;
186}

◆ getEcmsErr() [4/4]

double MeasuredEcmsSvc::getEcmsErr ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getInfo() [1/4]

double MeasuredEcmsSvc::getInfo ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 302 of file MeasuredEcmsSvc.cxx.

302 {
303 char tab[100];
304 char col[100];
305 strcpy(tab, table.c_str());
306 strcpy(col, column.c_str());
307 MsgStream log(msgSvc(), name());
308 log<<MSG::INFO<<"MeasuredEcmsSvc read the "<<tab<<"-"<<col<<endreq;
309 if(old_runNo1!=runNo){
311 old_runNo1=runNo;
312 }
313 return m_info1;
314}
void readInfo(int runNo, char *tab, char *col, char *min_col, char *max_col)

◆ getInfo() [2/4]

double MeasuredEcmsSvc::getInfo ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getInfo() [3/4]

double MeasuredEcmsSvc::getInfo ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 354 of file MeasuredEcmsSvc.cxx.

354 {
355 MsgStream log(msgSvc(), name());
356 log<<MSG::INFO<<"MeasuredEcmsSvc read the "<<tab<<"-"<<col<<endreq;
357 if(old_runNo2!=runNo){
358 readInfo(runNo, tab, col, min_col, max_col);
359 old_runNo2=runNo;
360 }
361 return m_info2;
362}

◆ getInfo() [4/4]

double MeasuredEcmsSvc::getInfo ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

◆ getPx() [1/4]

double MeasuredEcmsSvc::getPx ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 61 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

61{return m_px2;}

◆ getPx() [2/4]

double MeasuredEcmsSvc::getPx ( )
inlinevirtual

◆ getPx() [3/4]

double MeasuredEcmsSvc::getPx ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 218 of file MeasuredEcmsSvc.cxx.

218 {
219 MsgStream log(msgSvc(), name());
220 log<<MSG::INFO<<"MeasuredEcmsSvc read the ecms"<<endreq;
221 if(old_runNo!=runNo){
222 readDB(runNo);
223 old_runNo=runNo;
224 }
225 return m_px;
226}

◆ getPx() [4/4]

double MeasuredEcmsSvc::getPx ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getPy() [1/4]

double MeasuredEcmsSvc::getPy ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 62 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

62{return m_py2;}

◆ getPy() [2/4]

double MeasuredEcmsSvc::getPy ( )
inlinevirtual

◆ getPy() [3/4]

double MeasuredEcmsSvc::getPy ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 228 of file MeasuredEcmsSvc.cxx.

228 {
229 MsgStream log(msgSvc(), name());
230 log<<MSG::INFO<<"MeasuredEcmsSvc read the ecms"<<endreq;
231 if(old_runNo!=runNo){
232 readDB(runNo);
233 old_runNo=runNo;
234 }
235 return m_py;
236}

◆ getPy() [4/4]

double MeasuredEcmsSvc::getPy ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getPz() [1/4]

double MeasuredEcmsSvc::getPz ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 63 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

63{return m_pz2;}

◆ getPz() [2/4]

double MeasuredEcmsSvc::getPz ( )
inlinevirtual

◆ getPz() [3/4]

double MeasuredEcmsSvc::getPz ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 238 of file MeasuredEcmsSvc.cxx.

238 {
239 MsgStream log(msgSvc(), name());
240 log<<MSG::INFO<<"MeasuredEcmsSvc read the ecms"<<endreq;
241 if(old_runNo!=runNo){
242 readDB(runNo);
243 old_runNo=runNo;
244 }
245 return m_pz;
246}

◆ getPz() [4/4]

double MeasuredEcmsSvc::getPz ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getRecord() [1/4]

string MeasuredEcmsSvc::getRecord ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 408 of file MeasuredEcmsSvc.cxx.

408 {
409 char tab[100];
410 char col[100];
411 strcpy(tab, table.c_str());
412 strcpy(col, column.c_str());
413 MsgStream log(msgSvc(), name());
414 log<<MSG::INFO<<"MeasuredEcmsSvc read the "<<tab<<"-"<<col<<endreq;
415 if(old_runNo3!=runNo){
417 old_runNo3=runNo;
418 }
419 return m_record1;
420}
void readRecord(int runNo, char *tab, char *col, char *min_col, char *max_col)

◆ getRecord() [2/4]

std::string MeasuredEcmsSvc::getRecord ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getRecord() [3/4]

string MeasuredEcmsSvc::getRecord ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 460 of file MeasuredEcmsSvc.cxx.

460 {
461 MsgStream log(msgSvc(), name());
462 log<<MSG::INFO<<"MeasuredEcmsSvc read the "<<tab<<"-"<<col<<endreq;
463 if(old_runNo4!=runNo){
464 readRecord(runNo, tab, col, min_col, max_col);
465 old_runNo4=runNo;
466 }
467 return m_record2;
468}

◆ getRecord() [4/4]

std::string MeasuredEcmsSvc::getRecord ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

◆ getRunFrom() [1/4]

int MeasuredEcmsSvc::getRunFrom ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 56 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

56{return m_runFrom2;}

◆ getRunFrom() [2/4]

int MeasuredEcmsSvc::getRunFrom ( )
inlinevirtual

◆ getRunFrom() [3/4]

int MeasuredEcmsSvc::getRunFrom ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 158 of file MeasuredEcmsSvc.cxx.

158 {
159 MsgStream log(msgSvc(), name());
160 log<<MSG::INFO<<"MeasuredEcmsSvc read the RunFrom"<<endreq;
161 if(old_runNo!=runNo){
162 readDB(runNo);
163 old_runNo=runNo;
164 }
165 return m_runFrom;
166}

◆ getRunFrom() [4/4]

int MeasuredEcmsSvc::getRunFrom ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getRunTo() [1/4]

int MeasuredEcmsSvc::getRunTo ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 57 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

57{return m_runTo2;}

◆ getRunTo() [2/4]

int MeasuredEcmsSvc::getRunTo ( )
inlinevirtual

◆ getRunTo() [3/4]

int MeasuredEcmsSvc::getRunTo ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 168 of file MeasuredEcmsSvc.cxx.

168 {
169 MsgStream log(msgSvc(), name());
170 log<<MSG::INFO<<"MeasuredEcmsSvc read the RunTo"<<endreq;
171 if(old_runNo!=runNo){
172 readDB(runNo);
173 old_runNo=runNo;
174 }
175 return m_runTo;
176}

◆ getRunTo() [4/4]

int MeasuredEcmsSvc::getRunTo ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ getSampleName() [1/4]

int MeasuredEcmsSvc::getSampleName ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 55 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

55{return m_sampleName2;}

◆ getSampleName() [2/4]

int MeasuredEcmsSvc::getSampleName ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 55 of file Utilities/MeasuredEcmsSvc/MeasuredEcmsSvc-00-00-19/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

55{return m_sampleName2;}

◆ getSampleName() [3/4]

int MeasuredEcmsSvc::getSampleName ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 148 of file MeasuredEcmsSvc.cxx.

148 {
149 MsgStream log(msgSvc(), name());
150 log<<MSG::INFO<<"MeasuredEcmsSvc read the sample name"<<endreq;
151 if(old_runNo!=runNo){
152 readDB(runNo);
153 old_runNo=runNo;
154 }
155 return m_sampleName;
156}

◆ getSampleName() [4/4]

int MeasuredEcmsSvc::getSampleName ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ handle() [1/2]

void MeasuredEcmsSvc::handle ( const Incident &  inc)

Definition at line 73 of file MeasuredEcmsSvc.cxx.

73 {
74 MsgStream log(messageService(), name());
75 log<<MSG::DEBUG<<"handle: "<<inc.type()<<endreq;
76
77 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc, "/Event/EventHeader");
78 int runNo=eventHeader->runNumber();
79 if(inc.type()=="NewRun"){
80 log<<MSG::INFO<<"RunNo is new, call the readMeasuredEcms again"<<endreq;
81 if(std::abs(runNo)>=RunParamsMin&&std::abs(runNo)<=RunParamsMax) readRunParams2(runNo);
82 if(std::abs(runNo)>=MeasuredEcmsMin&&std::abs(runNo)<=MeasuredEcmsMax) readMeasuredEcms2(runNo);
83 }
84}
void readMeasuredEcms2(int runNo)
void readRunParams2(int runNo)

◆ handle() [2/2]

void MeasuredEcmsSvc::handle ( const Incident &  )

◆ initialize() [1/2]

StatusCode MeasuredEcmsSvc::initialize ( )
virtual

Definition at line 19 of file MeasuredEcmsSvc.cxx.

19 {
20 MsgStream log(msgSvc(), name());
21 log<<MSG::INFO<<"MeasuredEcmsSvc initialize begin here"<<endreq;
22
23 StatusCode status=Service::initialize();
24 if(!status.isSuccess()){
25 log<<MSG::ERROR<<"MeasuredEcmsSvc Can not initialize"<<endreq;
26 return status;
27 }
28
29 IIncidentSvc* incsvc;
30 status=service("IncidentSvc", incsvc);
31 int priority = 100;
32 if(status.isSuccess()) incsvc->addListener(this, "NewRun", priority);
33
34 status=serviceLocator()->service("DatabaseSvc", m_dbSvc, true);
35 if(!status.isSuccess()){
36 log<<MSG::ERROR<<"MeasuredEcmsSvc Unable to find DatabaseSvc"<<endreq;
37 return status;
38 }
39
40 status=serviceLocator()->service("EventDataSvc", m_eventSvc, true);
41 if(!status.isSuccess()){
42 log<<MSG::ERROR<<"MeasuredEcmsSvc Unable to find EventDataSvc "<<endreq;
43 return status;
44 }
45
46 log<<MSG::INFO<<"MeasuredEcmsSvc initialized successfully"<<endreq;
47 return StatusCode::SUCCESS;
48}

◆ initialize() [2/2]

virtual StatusCode MeasuredEcmsSvc::initialize ( )
virtual

◆ isGetEcmsValid() [1/4]

bool MeasuredEcmsSvc::isGetEcmsValid ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 66 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

66{return m2_runNoValid;}

◆ isGetEcmsValid() [2/4]

bool MeasuredEcmsSvc::isGetEcmsValid ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 66 of file Utilities/MeasuredEcmsSvc/MeasuredEcmsSvc-00-00-19/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

66{return m2_runNoValid;}

◆ isGetEcmsValid() [3/4]

bool MeasuredEcmsSvc::isGetEcmsValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 258 of file MeasuredEcmsSvc.cxx.

258 {
259 MsgStream log(msgSvc(), name());
260 log<<MSG::INFO<<"MeasuredEcmsSvc judge the valid of runNo"<<endreq;
261 if(old_runNo!=runNo){
262 readDB(runNo);
263 old_runNo=runNo;
264 }
265 return m_runNoValid;
266}

◆ isGetEcmsValid() [4/4]

bool MeasuredEcmsSvc::isGetEcmsValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ isGetInfoValid() [1/4]

bool MeasuredEcmsSvc::isGetInfoValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 316 of file MeasuredEcmsSvc.cxx.

316 {
317 char tab[100];
318 char col[100];
319 strcpy(tab, table.c_str());
320 strcpy(col, column.c_str());
321 MsgStream log(msgSvc(), name());
322 log<<MSG::INFO<<"MeasuredEcmsSvc judge the valid of "<<tab<<"-"<<col<<endreq;
323 if(old_runNo1!=runNo){
325 old_runNo1=runNo;
326 }
327 return m_runNoValid1;
328}

◆ isGetInfoValid() [2/4]

bool MeasuredEcmsSvc::isGetInfoValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ isGetInfoValid() [3/4]

bool MeasuredEcmsSvc::isGetInfoValid ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 364 of file MeasuredEcmsSvc.cxx.

364 {
365 MsgStream log(msgSvc(), name());
366 log<<MSG::INFO<<"MeasuredEcmsSvc judge the valid of "<<tab<<"-"<<col<<endreq;
367 if(old_runNo2!=runNo){
368 readInfo(runNo, tab, col, min_col, max_col);
369 old_runNo2=runNo;
370 }
371 return m_runNoValid2;
372}

◆ isGetInfoValid() [4/4]

bool MeasuredEcmsSvc::isGetInfoValid ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

◆ isGetRecordValid() [1/4]

bool MeasuredEcmsSvc::isGetRecordValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 422 of file MeasuredEcmsSvc.cxx.

422 {
423 char tab[100];
424 char col[100];
425 strcpy(tab, table.c_str());
426 strcpy(col, column.c_str());
427 MsgStream log(msgSvc(), name());
428 log<<MSG::INFO<<"MeasuredEcmsSvc judge the valid of "<<tab<<"-"<<col<<endreq;
429 if(old_runNo3!=runNo){
431 old_runNo3=runNo;
432 }
433 return m_record_valid1;
434}

◆ isGetRecordValid() [2/4]

bool MeasuredEcmsSvc::isGetRecordValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ isGetRecordValid() [3/4]

bool MeasuredEcmsSvc::isGetRecordValid ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 470 of file MeasuredEcmsSvc.cxx.

470 {
471 MsgStream log(msgSvc(), name());
472 log<<MSG::INFO<<"MeasuredEcmsSvc judge the valid of "<<tab<<"-"<<col<<endreq;
473 if(old_runNo4!=runNo){
474 readRecord(runNo, tab, col, min_col, max_col);
475 old_runNo4=runNo;
476 }
477 return m_record_valid2;
478}

◆ isGetRecordValid() [4/4]

bool MeasuredEcmsSvc::isGetRecordValid ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

◆ isReadDBValid() [1/2]

bool MeasuredEcmsSvc::isReadDBValid ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 65 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

65{return m2_runNoValid;}

◆ isReadDBValid() [2/2]

bool MeasuredEcmsSvc::isReadDBValid ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 65 of file Utilities/MeasuredEcmsSvc/MeasuredEcmsSvc-00-00-19/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

65{return m2_runNoValid;}

◆ isRunNoValid() [1/4]

bool MeasuredEcmsSvc::isRunNoValid ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 67 of file InstallArea/include/MeasuredEcmsSvc/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

67{return m2_runNoValid;}

◆ isRunNoValid() [2/4]

bool MeasuredEcmsSvc::isRunNoValid ( )
inlinevirtual

Implements IMeasuredEcmsSvc.

Definition at line 67 of file Utilities/MeasuredEcmsSvc/MeasuredEcmsSvc-00-00-19/MeasuredEcmsSvc/MeasuredEcmsSvc.h.

67{return m2_runNoValid;}

◆ isRunNoValid() [3/4]

bool MeasuredEcmsSvc::isRunNoValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 248 of file MeasuredEcmsSvc.cxx.

248 {
249 MsgStream log(msgSvc(), name());
250 log<<MSG::INFO<<"MeasuredEcmsSvc judge the valid of runNo"<<endreq;
251 if(old_runNo!=runNo){
252 readDB(runNo);
253 old_runNo=runNo;
254 }
255 return m_runNoValid;
256}

◆ isRunNoValid() [4/4]

bool MeasuredEcmsSvc::isRunNoValid ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ queryInterface() [1/2]

StatusCode MeasuredEcmsSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvIF 
)
virtual

Definition at line 64 of file MeasuredEcmsSvc.cxx.

64 {
65 if(IMeasuredEcmsSvc::interfaceID().versionMatch(riid)) *ppvIF = dynamic_cast<IMeasuredEcmsSvc*>(this);
66 else return Service::queryInterface(riid, ppvIF);
67
68 addRef();
69
70 return StatusCode::SUCCESS;
71}

◆ queryInterface() [2/2]

virtual StatusCode MeasuredEcmsSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvIF 
)
virtual

◆ readDB() [1/2]

void MeasuredEcmsSvc::readDB ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 143 of file MeasuredEcmsSvc.cxx.

143 {
144 if(std::abs(runNo)>=RunParamsMin&&std::abs(runNo)<=RunParamsMax) readRunParams(runNo);
145 if(std::abs(runNo)>=MeasuredEcmsMin&&std::abs(runNo)<=MeasuredEcmsMax) readMeasuredEcms(runNo);
146}
void readRunParams(int runNo)
void readMeasuredEcms(int runNo)

Referenced by getAveEcms(), getAveEcmsErr(), getEcms(), getEcmsErr(), getPx(), getPy(), getPz(), getRunFrom(), getRunTo(), getSampleName(), isGetEcmsValid(), and isRunNoValid().

◆ readDB() [2/2]

void MeasuredEcmsSvc::readDB ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ readInfo() [1/4]

void MeasuredEcmsSvc::readInfo ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 270 of file MeasuredEcmsSvc.cxx.

270 {
271 char tab[100];
272 char col[100];
273 char min_col[100];
274 char max_col[100];
275
276 strcpy(tab, table.c_str());
277 strcpy(col, column.c_str());
278 strcpy(min_col, down_column.c_str());
279 strcpy(max_col, up_column.c_str());
280
281 MsgStream log(msgSvc(), name());
282 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database "<<tab<<"-"<<col<<endreq;
283
284 int runNum=std::abs(runNo);
285
286 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
287 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
288
289 char stmt1[500];
290 snprintf(stmt1, 1024, "select %s from %s where %s <= %d and %s >= %d", col, tab, min_col, runNum, max_col, runNum);
292 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
293 if(row_no==0){log<<MSG::ERROR<<"RowNo can not be 0 for "<<tab<<", failed to read DB for "<<runNo<<endreq;}
294 else{
295 DatabaseRecord* records = res[0];
296 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the "<<tab<<" database "<<runNo<<endreq;
297 m_info1=records->GetDouble(col);
298 m_runNoValid1=true;
299 }
300}
virtual int query(const std::string &dbName, const std::string &sql, DatabaseRecordVector &res)=0

◆ readInfo() [2/4]

void MeasuredEcmsSvc::readInfo ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ readInfo() [3/4]

void MeasuredEcmsSvc::readInfo ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 332 of file MeasuredEcmsSvc.cxx.

332 {
333 MsgStream log(msgSvc(), name());
334 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database "<<tab<<"-"<<col<<endreq;
335
336 int runNum=std::abs(runNo);
337
338 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
339 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
340
341 char stmt1[400];
342 snprintf(stmt1, 1024, "select %s from %s where %s <= %d and %s >=%d", col, tab, min_col, runNum, max_col, runNum);
344 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
345 if(row_no==0){log<<MSG::ERROR<<"RowNo can not be 0 for "<<tab<<", failed to read DB for "<<runNo<<endreq;}
346 else{
347 DatabaseRecord* records = res[0];
348 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the "<<tab<<" database "<<runNo<<endreq;
349 m_info2=records->GetDouble(col);
350 m_runNoValid2=true;
351 }
352}

Referenced by getInfo(), and isGetInfoValid().

◆ readInfo() [4/4]

void MeasuredEcmsSvc::readInfo ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

◆ readMeasuredEcms() [1/2]

void MeasuredEcmsSvc::readMeasuredEcms ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 88 of file MeasuredEcmsSvc.cxx.

88 {
89 MsgStream log(msgSvc(), name());
90 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database MeasuredEcmsSvc"<<endreq;
91
92 int runNum=std::abs(runNo);
93
94 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
95 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
96
97 char stmt[400];
98 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);
100 int rowNo=m_dbSvc->query("offlinedb", stmt, res);
101 if(rowNo==0){ log<<MSG::ERROR<<"RowNo can not be 0 for MeasuredEcmsSvc, failed to read DB for "<<runNo<<endreq; }
102 else{
103 DatabaseRecord* records=res[0];
104 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the MeasuredEcms database "<<runNo<<endreq;
105 m_runFrom=records->GetDouble("RunFrom");
106 m_runTo=records->GetDouble("RunTo");
107 m_sampleName=records->GetDouble("sample");
108 m_ecms=records->GetDouble("Ecms");
109 m_ecmsErr=records->GetDouble("Ecms_err");
110 m_aveEcms=records->GetDouble("Ave_Ecms");
111 m_aveEcmsErr=records->GetDouble("Ave_Ecms_err");
112 m_runNoValid=true;
113 }
114}

Referenced by readDB().

◆ readMeasuredEcms() [2/2]

void MeasuredEcmsSvc::readMeasuredEcms ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ readMeasuredEcms2() [1/2]

void MeasuredEcmsSvc::readMeasuredEcms2 ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 482 of file MeasuredEcmsSvc.cxx.

482 {
483 MsgStream log(msgSvc(), name());
484 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database MeasuredEcmsSvc"<<endreq;
485
486 int runNum=std::abs(runNo);
487
488 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
489 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
490
491 char stmt[400];
492 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);
494 int rowNo=m_dbSvc->query("offlinedb", stmt, res);
495 if(rowNo==0){ log<<MSG::ERROR<<"RowNo can not be 0 for MeasuredEcmsSvc, failed to read DB for "<<runNo<<endreq; }
496 else{
497 DatabaseRecord* records=res[0];
498 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the MeasuredEcms database "<<runNo<<endreq;
499
500 m_runFrom2=records->GetDouble("RunFrom");
501 m_runTo2=records->GetDouble("RunTo");
502 m_sampleName2=records->GetDouble("sample");
503 m_ecms2=records->GetDouble("Ecms");
504 m_ecmsErr2=records->GetDouble("Ecms_err");
505 m_aveEcms2=records->GetDouble("Ave_Ecms");
506 m_aveEcmsErr2=records->GetDouble("Ave_Ecms_err");
507 m2_runNoValid=true;
508 }
509}

Referenced by handle().

◆ readMeasuredEcms2() [2/2]

void MeasuredEcmsSvc::readMeasuredEcms2 ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ readRecord() [1/4]

void MeasuredEcmsSvc::readRecord ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 376 of file MeasuredEcmsSvc.cxx.

376 {
377 char tab[100];
378 char col[100];
379 char min_col[100];
380 char max_col[100];
381
382 strcpy(tab, table.c_str());
383 strcpy(col, column.c_str());
384 strcpy(min_col, down_column.c_str());
385 strcpy(max_col, up_column.c_str());
386
387 MsgStream log(msgSvc(), name());
388 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database "<<tab<<"-"<<col<<endreq;
389
390 int runNum=std::abs(runNo);
391
392 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
393 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
394
395 char stmt1[500];
396 snprintf(stmt1, 1024, "select %s from %s where %s <= %d and %s >= %d", col, tab, min_col, runNum, max_col, runNum);
398 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
399 if(row_no==0){log<<MSG::ERROR<<"RowNo can not be 0 for "<<tab<<", failed to read DB for "<<runNo<<endreq;}
400 else{
401 DatabaseRecord* records = res[0];
402 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the "<<tab<<" database "<<runNo<<endreq;
403 m_record1=records->GetString(col);
404 m_record_valid1=true;
405 }
406}

◆ readRecord() [2/4]

void MeasuredEcmsSvc::readRecord ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ readRecord() [3/4]

void MeasuredEcmsSvc::readRecord ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 438 of file MeasuredEcmsSvc.cxx.

438 {
439 MsgStream log(msgSvc(), name());
440 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database "<<tab<<"-"<<col<<endreq;
441
442 int runNum=std::abs(runNo);
443
444 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
445 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
446
447 char stmt1[400];
448 snprintf(stmt1, 1024, "select %s from %s where %s <= %d and %s >=%d", col, tab, min_col, runNum, max_col, runNum);
450 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
451 if(row_no==0){log<<MSG::ERROR<<"RowNo can not be 0 for "<<tab<<", failed to read DB for "<<runNo<<endreq;}
452 else{
453 DatabaseRecord* records = res[0];
454 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the "<<tab<<" database "<<runNo<<endreq;
455 m_record2=records->GetString(col);
456 m_record_valid2=true;
457 }
458}

Referenced by getRecord(), and isGetRecordValid().

◆ readRecord() [4/4]

void MeasuredEcmsSvc::readRecord ( int  runNo,
char *  tab,
char *  col,
char *  min_col,
char *  max_col 
)
virtual

Implements IMeasuredEcmsSvc.

◆ readRunParams() [1/2]

void MeasuredEcmsSvc::readRunParams ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 116 of file MeasuredEcmsSvc.cxx.

116 {
117 MsgStream log(msgSvc(), name());
118 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database RunParams"<<endreq;
119
120 int runNum=std::abs(runNo);
121
122 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
123 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
124
125 char stmt1[400];
126 snprintf(stmt1, 1024, "select beam_energy, px, py, pz from RunParams where run_number = %d", runNum);
128 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
129 if(row_no==0){log<<MSG::ERROR<<"RowNo can not be 0 for RunParams, failed to read DB for "<<runNo<<endreq;}
130 else{
131 DatabaseRecord* records = res[0];
132 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the RunParams database"<<runNo<<endreq;
133 double bE=0;
134 bE=records->GetDouble("beam_energy");
135 m_px=records->GetDouble("px");
136 m_py=records->GetDouble("py");
137 m_pz=records->GetDouble("pz");
138 m_ecms=bE*2.00;
139 m_runNoValid=true;
140 }
141}

Referenced by readDB().

◆ readRunParams() [2/2]

void MeasuredEcmsSvc::readRunParams ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

◆ readRunParams2() [1/2]

void MeasuredEcmsSvc::readRunParams2 ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Definition at line 511 of file MeasuredEcmsSvc.cxx.

511 {
512 MsgStream log(msgSvc(), name());
513 log<<MSG::INFO<<"MeasuredEcmsSvc begin read database RunParams"<<endreq;
514
515 int runNum=std::abs(runNo);
516
517 if(runNo<0) log<<MSG::INFO<<"MeasuredEcmsSvc for MC events"<<endreq;
518 else log<<MSG::INFO<<"MeasuredEcmsSvc for DT events"<<endreq;
519
520 char stmt1[400];
521 snprintf(stmt1, 1024, "select beam_energy, px, py, pz from RunParams where run_number = %d", runNum);
523 int row_no = m_dbSvc->query("offlinedb", stmt1, res);
524 if(row_no==0){log<<MSG::ERROR<<"RowNo can not be 0 for RunParams, failed to read DB for "<<runNo<<endreq;}
525 else{
526 DatabaseRecord* records = res[0];
527 log<<MSG::INFO<<"MeasuredEcmsSvc first read the runNo, read the RunParams database"<<runNo<<endreq;
528 double bE=0;
529 bE=records->GetDouble("beam_energy");
530
531 m_px2=records->GetDouble("px");
532 m_py2=records->GetDouble("py");
533 m_pz2=records->GetDouble("pz");
534 m_ecms2=bE*2.00;
535 m2_runNoValid=true;
536 }
537}

Referenced by handle().

◆ readRunParams2() [2/2]

void MeasuredEcmsSvc::readRunParams2 ( int  runNo)
virtual

Implements IMeasuredEcmsSvc.

Friends And Related Function Documentation

◆ CnvFactory< MeasuredEcmsSvc >


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