CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/OnlineDB/EcalCondDB/interface/MonRunIOV.h

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