Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RUNTAG_H
0002 #define RUNTAG_H
0003 
0004 #include <string>
0005 #include <stdexcept>
0006 
0007 #include "OnlineDB/EcalCondDB/interface/ITag.h"
0008 #include "OnlineDB/EcalCondDB/interface/LocationDef.h"
0009 #include "OnlineDB/EcalCondDB/interface/RunTypeDef.h"
0010 /**
0011  *   Tag for Run information
0012  */
0013 class RunTag : public ITag {
0014 public:
0015   friend class RunIOV;  // needs permission to write
0016   friend class EcalCondDBInterface;
0017 
0018   RunTag();
0019   ~RunTag() override;
0020 
0021   // Methods for user data
0022   std::string getGeneralTag() const;
0023   void setGeneralTag(std::string tag);
0024 
0025   LocationDef getLocationDef() const;
0026   void setLocationDef(const LocationDef& locDef);
0027 
0028   RunTypeDef getRunTypeDef() const;
0029   void setRunTypeDef(const RunTypeDef& runTypeDef);
0030 
0031   // Methods using ID
0032   int fetchID() noexcept(false) override;
0033   void setByID(int id) noexcept(false) override;
0034 
0035   // operators
0036   inline bool operator==(const RunTag& t) const {
0037     return (m_genTag == t.m_genTag && m_locDef == t.m_locDef && m_runTypeDef == t.m_runTypeDef);
0038   }
0039 
0040   inline bool operator!=(const RunTag& t) const { return !(*this == t); }
0041 
0042 private:
0043   // User data for this tag
0044   std::string m_genTag;
0045   LocationDef m_locDef;
0046   RunTypeDef m_runTypeDef;
0047 
0048   // Methods from ITag
0049   int writeDB() noexcept(false);
0050   void fetchParentIDs(int* locId, int* runTypeID) noexcept(false);
0051 
0052   // Public access methods
0053   void fetchAllTags(std::vector<RunTag>* fillVec) noexcept(false);
0054 };
0055 
0056 #endif