File indexing completed on 2024-04-06 12:22:57
0001 #ifndef RUNDCSMAGNET_H
0002 #define RUNDCSMAGNET_H
0003
0004 #include <vector>
0005 #include <stdexcept>
0006
0007 #include "OnlineDB/EcalCondDB/interface/IDataItem.h"
0008 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
0009 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
0010 #include "OnlineDB/EcalCondDB/interface/Tm.h"
0011 #include "OnlineDB/EcalCondDB/interface/DateHandler.h"
0012 #include "OnlineDB/EcalCondDB/interface/DataReducer.h"
0013 #include "OnlineDB/Oracle/interface/Oracle.h"
0014
0015 class RunDCSMagnetDat : public IDataItem {
0016 public:
0017 typedef oracle::occi::ResultSet ResultSet;
0018
0019 friend class EcalCondDBInterface;
0020 RunDCSMagnetDat();
0021 ~RunDCSMagnetDat() override;
0022
0023
0024 inline std::string getTable() override { return "CMSFWMAGNET_LV"; }
0025 inline std::string getMagnetAccount() { return "CMS_DCS_ENV_PVSS_COND"; }
0026 inline void setMagnetCurrent(float t) { m_current = t; }
0027 inline float getMagnetCurrent() const { return m_current; }
0028
0029 void setTime(const Tm& start);
0030 Tm getTime() const;
0031
0032 private:
0033 ResultSet* getMagnetRset();
0034
0035 int nowMicroseconds();
0036
0037 void fillTheMap(ResultSet*, std::map<EcalLogicID, RunDCSMagnetDat>*);
0038
0039 void prepareWrite() noexcept(false) override;
0040
0041 void writeDB(const EcalLogicID* ecid, const RunDCSMagnetDat* item, RunIOV* iov) noexcept(false);
0042
0043 void fetchData(std::map<EcalLogicID, RunDCSMagnetDat>* fillMap, RunIOV* iov) noexcept(false);
0044
0045 void fetchLastData(std::map<EcalLogicID, RunDCSMagnetDat>* fillMap) noexcept(false);
0046
0047
0048 float m_current;
0049 Tm m_time;
0050 };
0051
0052 #endif