BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
ReadEb.h
Go to the documentation of this file.
1/****************************************
2 * Read CMS energy from data base for
3 * psi(3770) production
4 *
5 * 2012-1-05 created pingrg
6 *
7 ***************************************/
8#ifndef DTagAlg_ReadBeamInfFromDb_H
9#define DTagAlg_ReadBeamInfFromDb_H
10
11#include "CLHEP/Vector/ThreeVector.h"
13#include <iostream>
14#include <mysql.h>
15
16
17class ReadEb {
18
19 public:
20
21 ReadEb(int run):
22 m_run(-1),
23 m_isRunValid(false),
24 m_beamE(0),
25 m_beta(0.011,0,0),
26 m_usecbE(true){
27 if ( run != previousRun) {
28 previousRun = run;
29 ReadDb(run);
30 }
31 }
32
33 virtual ~ReadEb() {}
34
35 double getEcms(){return m_Ecms;}
36 double getXangle(){return m_xangle;}
37 inline CLHEP::Hep3Vector getbeta(){return m_beta;}
38 inline bool setcalib(bool calib){m_usecbE=calib;}
39
40 private:
41 MYSQL* OpenDb() const;
42 void ReadDb(int run);
43 void CloseDb(MYSQL* mysql) const;
44
45 IDatabaseSvc* m_dbsvc;
46 int m_run;
47 bool m_isRunValid;
48 double m_beamE;
49 static double m_Ecms;
50 static double m_xangle;
51 bool m_usecbE;
52 CLHEP::Hep3Vector m_beta;
53 static int previousRun;
54};
55
56
57#endif
struct st_mysql MYSQL
Definition: ReadEb.h:17
bool setcalib(bool calib)
Definition: ReadEb.h:38
virtual ~ReadEb()
Definition: ReadEb.h:33
double getXangle()
Definition: ReadEb.h:36
double getEcms()
Definition: ReadEb.h:35
CLHEP::Hep3Vector getbeta()
Definition: ReadEb.h:37
ReadEb(int run)
Definition: ReadEb.h:21