Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:52

0001 #ifndef CALIIOV_H
0002 #define CALIIOV_H
0003 
0004 #include <stdexcept>
0005 #include <iostream>
0006 
0007 #include "OnlineDB/EcalCondDB/interface/IIOV.h"
0008 #include "OnlineDB/EcalCondDB/interface/CaliTag.h"
0009 #include "OnlineDB/EcalCondDB/interface/Tm.h"
0010 
0011 typedef int run_t;
0012 
0013 class CaliIOV : public IIOV {
0014 public:
0015   friend class EcalCondDBInterface;
0016 
0017   CaliIOV();
0018   ~CaliIOV() override;
0019 
0020   // Methods for user data
0021 
0022   void setSince(const Tm& since);
0023   Tm getSince() const;
0024   void setTill(const Tm& till);
0025   Tm getTill() const;
0026   void setCaliTag(const CaliTag& tag);
0027   CaliTag getCaliTag() const;
0028 
0029   // Methods from IUniqueDBObject
0030   int getID() { return m_ID; };
0031   int fetchID() noexcept(false) override;
0032   void setByID(int id) noexcept(false) override;
0033 
0034   // Operators
0035   inline bool operator==(const CaliIOV& m) const {
0036     return (m_caliTag == m.m_caliTag && m_since == m.m_since && m_till == m.m_till);
0037   }
0038 
0039   inline bool operator!=(const CaliIOV& m) const { return !(*this == m); }
0040 
0041 private:
0042   // User data for this IOV
0043   Tm m_since;
0044   Tm m_till;
0045   CaliTag m_caliTag;
0046 
0047   int writeDB() noexcept(false);
0048   void setByTm(CaliTag* tag, const Tm& time) noexcept(false);
0049 };
0050 
0051 #endif