CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/OnlineDB/EcalCondDB/interface/MODRunIOV.h

Go to the documentation of this file.
00001 #ifndef MODRUNIOV_H
00002 #define MODRUNIOV_H
00003 
00004 #include <stdexcept>
00005 #include <iostream>
00006 
00007 #include "OnlineDB/EcalCondDB/interface/IIOV.h"
00008 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
00009 #include "OnlineDB/EcalCondDB/interface/Tm.h"
00010 
00011 typedef int subrun_t;
00012 
00013 class MODRunIOV : public IIOV {
00014  public:
00015   friend class EcalCondDBInterface;
00016 
00017   MODRunIOV();
00018   ~MODRunIOV();
00019 
00020   void setID(int id);
00021   int getID(){ return m_ID;} ;
00022 
00023   // Methods for user data
00024   void setRunIOV(RunIOV iov);
00025   RunIOV getRunIOV();
00026   void setSubRunNumber(subrun_t subrun);
00027   run_t getSubRunNumber() const;
00028   void setSubRunStart(Tm start);
00029   Tm getSubRunStart() const;
00030   void setSubRunEnd(Tm end);
00031   Tm getSubRunEnd() const;
00032 
00033   // Methods from IUniqueDBObject
00034   int fetchID() throw(std::runtime_error);
00035   void setByID(int id) throw(std::runtime_error);
00036 
00037   // Operators
00038   inline bool operator==(const MODRunIOV &m) const
00039     {
00040       return ( m_runIOV      == m.m_runIOV &&
00041                m_subRunNum   == m.m_subRunNum &&
00042                m_subRunStart == m.m_subRunStart &&
00043                m_subRunEnd   == m.m_subRunEnd );
00044     }
00045 
00046   inline bool operator!=(const MODRunIOV &m) const { return !(*this == m); }
00047 
00048  private:
00049   // User data for this IOV
00050   RunIOV m_runIOV;
00051   subrun_t m_subRunNum;
00052   Tm m_subRunStart;
00053   Tm m_subRunEnd;
00054 
00055   int writeDB() throw(std::runtime_error);
00056   void fetchParentIDs(int* runIOVID) throw(std::runtime_error);
00057 
00058   void setByRun(RunIOV* runiov, subrun_t subrun) throw(std::runtime_error);
00059 };
00060 
00061 #endif