Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:48

0001 #ifndef CALITAG_H
0002 #define CALITAG_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 CaliTag : public ITag {
0014 public:
0015   friend class CaliIOV;  // needs permission to write
0016   friend class EcalCondDBInterface;
0017 
0018   CaliTag();
0019   ~CaliTag() 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   std::string getMethod() const;
0029   void setMethod(std::string method);
0030 
0031   std::string getVersion() const;
0032   void setVersion(std::string version);
0033 
0034   std::string getDataType() const;
0035   void setDataType(std::string dataType);
0036 
0037   // Methods using ID
0038   int fetchID() noexcept(false) override;
0039   void setByID(int id) noexcept(false) override;
0040 
0041   // Operators
0042   inline bool operator==(const CaliTag& t) const { return (m_genTag == t.m_genTag && m_locDef == t.m_locDef); }
0043 
0044   inline bool operator!=(const CaliTag& t) const { return !(*this == t); }
0045 
0046 private:
0047   // User data for this tag
0048   std::string m_genTag;
0049   LocationDef m_locDef;
0050   std::string m_method;
0051   std::string m_version;
0052   std::string m_dataType;
0053 
0054   // Methods from ITag
0055   int writeDB() noexcept(false);
0056   void fetchParentIDs(int* locId) noexcept(false);
0057 
0058   // Public access methods
0059   void fetchAllTags(std::vector<CaliTag>* fillVec) noexcept(false);
0060 };
0061 
0062 #endif