File indexing completed on 2024-04-06 12:22:55
0001 #ifndef MONOCCUPANCYDAT_H
0002 #define MONOCCUPANCYDAT_H
0003
0004 #include <map>
0005 #include <stdexcept>
0006
0007 #include "OnlineDB/EcalCondDB/interface/IDataItem.h"
0008 #include "OnlineDB/EcalCondDB/interface/MonRunTag.h"
0009 #include "OnlineDB/EcalCondDB/interface/MonRunIOV.h"
0010 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
0011
0012 class MonOccupancyDat : public IDataItem {
0013 public:
0014 friend class EcalCondDBInterface;
0015 MonOccupancyDat();
0016 ~MonOccupancyDat() override;
0017
0018
0019 inline std::string getTable() override { return "MON_OCCUPANCY_DAT"; }
0020
0021 void setEventsOverLowThreshold(int events) { m_eventsOverLowThreshold = events; }
0022 int getEventsOverLowThreshold() const { return m_eventsOverLowThreshold; }
0023
0024 void setEventsOverHighThreshold(int events) { m_eventsOverHighThreshold = events; }
0025 int getEventsOverHighThreshold() const { return m_eventsOverHighThreshold; }
0026
0027 void setAvgEnergy(float energy) { m_avgEnergy = energy; }
0028 float getAvgEnergy() const { return m_avgEnergy; }
0029
0030 private:
0031 void prepareWrite() noexcept(false) override;
0032
0033 void writeDB(const EcalLogicID* ecid, const MonOccupancyDat* item, MonRunIOV* iov) noexcept(false);
0034
0035 void writeArrayDB(const std::map<EcalLogicID, MonOccupancyDat>* data, MonRunIOV* iov) noexcept(false);
0036
0037 void fetchData(std::map<EcalLogicID, MonOccupancyDat>* fillVec, MonRunIOV* iov) noexcept(false);
0038
0039
0040 int m_eventsOverLowThreshold;
0041 int m_eventsOverHighThreshold;
0042 float m_avgEnergy;
0043 };
0044
0045 #endif