CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/OnlineDB/EcalCondDB/interface/RunDCSLVDat.h

Go to the documentation of this file.
00001 #ifndef RUNDCSLVEBDAT_H
00002 #define RUNDCSLVEBDAT_H
00003 
00004 #include <vector>
00005 #include <stdexcept>
00006 
00007 #include "OnlineDB/EcalCondDB/interface/IDataItem.h"
00008 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
00009 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
00010 #include "OnlineDB/EcalCondDB/interface/Tm.h"
00011 #include "OnlineDB/EcalCondDB/interface/DateHandler.h"
00012 #include "OnlineDB/Oracle/interface/Oracle.h"
00013 
00014 class RunDCSLVDat : public IDataItem {
00015  public:
00016   typedef oracle::occi::ResultSet ResultSet;
00017 
00018   static const int maxDifference = 30*60*1000000; // 30 minutes
00019   static const int maxLVDifferenceEB = 1000;      // max LV tolerance in mV for EB
00020   static const int maxLVDifferenceEE = 1000;      // max LV tolerance in mV for EE
00021   static const int minLV = 2000;                  // if LV less than this value (in mV) LV is off
00022   
00023   static const int LVNOTNOMINAL = 1;
00024   static const int LVOFF        = 2;
00025 
00026   friend class EcalCondDBInterface;
00027   RunDCSLVDat();
00028   ~RunDCSLVDat();
00029 
00030   // User data methods
00031   inline std::string getTable() { return ""; }
00032   inline std::string getEBAccount() { return "CMS_ECAL_LV_PVSS_COND"; }
00033   inline std::string getEEAccount() { return "CMS_ECAL_LV_PVSS_COND"; }
00034   inline void setLV(float t) { m_lv = t; }
00035   inline void setStatus(int t) { m_status = t; }
00036   inline void setLVNominal(float t) { m_lvnom = t; }
00037   inline float getLV() const { return m_lv; }
00038   inline float getLVNominal() const { return m_lvnom; }
00039   inline int getStatus() const { return m_status; }
00040   int getTimeStatus() {return m_tstatus;}
00041   void setTimeStatus(int t ) {m_tstatus=t; } 
00042 
00043  private:
00044   void setStatusForBarrel(RunDCSLVDat&, Tm);
00045   void setStatusForEndcaps(RunDCSLVDat&, Tm);
00046   ResultSet* getBarrelRset();
00047   ResultSet* getEndcapRset();
00048   int nowMicroseconds();
00049   void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSLVDat >* );
00050   void prepareWrite() 
00051     throw(std::runtime_error);
00052 
00053   void writeDB(const EcalLogicID* ecid, const RunDCSLVDat* item, RunIOV* iov )
00054     throw(std::runtime_error);
00055 
00056   void fetchData(std::map< EcalLogicID, RunDCSLVDat >* fillMap, RunIOV* iov)
00057      throw(std::runtime_error);
00058 
00059   void fetchLastData(std::map< EcalLogicID, RunDCSLVDat >* fillMap)
00060      throw(std::runtime_error);
00061 
00062   // User data
00063   float m_lv;
00064   float m_lvnom;
00065   int m_status;
00066   int m_tstatus;
00067 };
00068 
00069 #endif