/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/KKMC/KKMC-00-00-55/KKMC/ReadEb.h

Go to the documentation of this file.
00001 /****************************************
00002  * Read CMS energy from data base for 
00003  * psi(3770) production
00004  *
00005  * 2012-1-05 created pingrg 
00006  *
00007  ***************************************/
00008 #ifndef DTagAlg_ReadBeamInfFromDb_H
00009 #define DTagAlg_ReadBeamInfFromDb_H
00010 
00011 #include "CLHEP/Vector/ThreeVector.h"
00012 #include "DatabaseSvc/IDatabaseSvc.h"
00013 #include <iostream>
00014 #include <mysql.h>
00015 
00016 
00017 class ReadEb {
00018 
00019  public:
00020   
00021  ReadEb(int run):
00022   m_run(-1),
00023   m_isRunValid(false),
00024   m_beamE(0),
00025   m_beta(0.011,0,0),
00026   m_usecbE(true){
00027    if ( run != previousRun) {
00028     previousRun = run;
00029     ReadDb(run);
00030    }
00031  }
00032 
00033   virtual  ~ReadEb() {}
00034   
00035   double getEcms(){return m_Ecms;}
00036   double getXangle(){return m_xangle;}
00037   inline  CLHEP::Hep3Vector getbeta(){return m_beta;}
00038   inline bool setcalib(bool calib){m_usecbE=calib;}
00039 
00040  private:
00041   MYSQL* OpenDb() const;
00042   void ReadDb(int run);
00043   void CloseDb(MYSQL* mysql) const;
00044   
00045   IDatabaseSvc* m_dbsvc;
00046   int m_run;
00047   bool m_isRunValid;
00048   double m_beamE;
00049   static double m_Ecms;
00050   static double m_xangle;
00051   bool m_usecbE;
00052   CLHEP::Hep3Vector m_beta;
00053   static int previousRun;
00054 };
00055 
00056 
00057 #endif

Generated on Tue Nov 29 23:12:39 2016 for BOSS_7.0.2 by  doxygen 1.4.7