File indexing completed on 2024-04-06 12:22:55
0001 #ifndef MONRUNIOV_H
0002 #define MONRUNIOV_H
0003
0004 #include <stdexcept>
0005 #include <iostream>
0006
0007 #include "OnlineDB/EcalCondDB/interface/IIOV.h"
0008 #include "OnlineDB/EcalCondDB/interface/MonRunTag.h"
0009 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
0010 #include "OnlineDB/EcalCondDB/interface/Tm.h"
0011
0012 typedef int subrun_t;
0013
0014 class MonRunIOV : public IIOV {
0015 public:
0016 friend class EcalCondDBInterface;
0017
0018 MonRunIOV();
0019 ~MonRunIOV() override;
0020
0021 void setID(int id);
0022 int getID() { return m_ID; };
0023
0024
0025 void setMonRunTag(const MonRunTag& tag);
0026 MonRunTag getMonRunTag() const;
0027 void setRunIOV(const RunIOV& iov);
0028 RunIOV getRunIOV();
0029 void setSubRunNumber(subrun_t subrun);
0030 run_t getSubRunNumber() const;
0031 void setSubRunStart(const Tm& start);
0032 Tm getSubRunStart() const;
0033 void setSubRunEnd(const Tm& end);
0034 Tm getSubRunEnd() const;
0035
0036
0037 int fetchID() noexcept(false) override;
0038 void setByID(int id) noexcept(false) override;
0039
0040
0041 inline bool operator==(const MonRunIOV& m) const {
0042 return (m_monRunTag == m.m_monRunTag && m_runIOV == m.m_runIOV && m_subRunNum == m.m_subRunNum &&
0043 m_subRunStart == m.m_subRunStart && m_subRunEnd == m.m_subRunEnd);
0044 }
0045
0046 inline bool operator!=(const MonRunIOV& m) const { return !(*this == m); }
0047
0048 private:
0049
0050 MonRunTag m_monRunTag;
0051 RunIOV m_runIOV;
0052 subrun_t m_subRunNum;
0053 Tm m_subRunStart;
0054 Tm m_subRunEnd;
0055
0056 int writeDB() noexcept(false);
0057 void fetchParentIDs(int* monRunTagID, int* runIOVID) noexcept(false);
0058
0059 void setByRun(MonRunTag* montag, RunIOV* runiov, subrun_t subrun) noexcept(false);
0060 };
0061
0062 #endif