Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ODRUNCONFIGINFO_H
0002 #define ODRUNCONFIGINFO_H
0003 
0004 #include <stdexcept>
0005 #include <iostream>
0006 
0007 #include "OnlineDB/EcalCondDB/interface/IODConfig.h"
0008 #include "OnlineDB/EcalCondDB/interface/Tm.h"
0009 #include "OnlineDB/EcalCondDB/interface/RunModeDef.h"
0010 #include "OnlineDB/EcalCondDB/interface/RunTypeDef.h"
0011 
0012 class ODRunConfigInfo : public IODConfig {
0013 public:
0014   friend class EcalCondDBInterface;
0015 
0016   ODRunConfigInfo();
0017   ~ODRunConfigInfo() override;
0018   inline std::string getTable() override { return "ECAL_RUN_CONFIGURATION_DAT"; }
0019 
0020   inline void setId(int id) { m_ID = id; }
0021   inline int getId() const { return m_ID; }
0022 
0023   void setDBTime(const Tm& x) { m_db_time = x; }
0024   inline Tm getDBTime() const { return m_db_time; }
0025   //

0026   inline void setTag(std::string x) { m_tag = x; }
0027   std::string getTag() const { return m_tag; }
0028   //

0029   void setDescription(std::string x) { m_description = x; }
0030   std::string getDescription() const { return m_description; }
0031   //

0032   void setVersion(int x) { m_version = x; }
0033   int getVersion() const { return m_version; }
0034   //

0035   void setNumberOfSequences(int n) { m_num_seq = n; }
0036   int getNumberOfSequences() const { return m_num_seq; }
0037   //

0038   void setDefaults(int x) { m_defaults = x; }
0039   int getDefaults() const { return m_defaults; }
0040   //

0041   void setTriggerMode(std::string x) { m_trigger_mode = x; }
0042   std::string getTriggerMode() const { return m_trigger_mode; }
0043   //

0044   void setNumberOfEvents(int x) { m_num_events = x; }
0045   int getNumberOfEvents() const { return m_num_events; }
0046   //

0047   void setUsageStatus(std::string x) { m_usage_status = x; }
0048   std::string getUsageStatus() const { return m_usage_status; }
0049   //

0050 
0051   RunTypeDef getRunTypeDef() const;
0052   void setRunTypeDef(const RunTypeDef& runTypeDef);
0053   RunModeDef getRunModeDef() const;
0054   void setRunModeDef(const RunModeDef& runModeDef);
0055 
0056   // operators

0057   inline bool operator==(const ODRunConfigInfo& r) const { return (m_ID == r.m_ID); }
0058   inline bool operator!=(const ODRunConfigInfo& r) const { return !(*this == r); }
0059 
0060 private:
0061   // User data for this IOV

0062   int m_ID;
0063   Tm m_db_time;
0064   std::string m_tag;
0065   int m_version;
0066   RunModeDef m_runModeDef;
0067   RunTypeDef m_runTypeDef;
0068   int m_num_seq;
0069   std::string m_description;
0070   int m_defaults;
0071   std::string m_trigger_mode;
0072   int m_num_events;
0073   std::string m_usage_status;
0074 
0075   // Methods from IUniqueDBObject

0076   int fetchNextId() noexcept(false);
0077   int fetchID() noexcept(false);
0078   int fetchIDFromTagAndVersion() noexcept(false);
0079   int fetchIDLast() noexcept(false);
0080   void setByID(int id) noexcept(false);
0081 
0082   void prepareWrite() noexcept(false) override;
0083   void writeDB() noexcept(false);
0084   void fetchData(ODRunConfigInfo* result) noexcept(false);
0085   int updateDefaultCycle() noexcept(false);
0086   void clear();
0087 };
0088 
0089 #endif