CMS 3D CMS Logo

RunDCSLVDat.h
Go to the documentation of this file.
1 #ifndef RUNDCSLVEBDAT_H
2 #define RUNDCSLVEBDAT_H
3 
4 #include <vector>
5 #include <stdexcept>
6 
13 
14 class RunDCSLVDat : public IDataItem {
15 public:
16  typedef oracle::occi::ResultSet ResultSet;
17 
18  static const int maxDifference = 30 * 60 * 1000000; // 30 minutes
19  static const int maxLVDifferenceEB = 1000; // max LV tolerance in mV for EB
20  static const int maxLVDifferenceEE = 1000; // max LV tolerance in mV for EE
21  static const int minLV = 2000; // if LV less than this value (in mV) LV is off
22 
23  static const int LVNOTNOMINAL = 1;
24  static const int LVOFF = 2;
25 
26  friend class EcalCondDBInterface;
27  RunDCSLVDat();
28  ~RunDCSLVDat() override;
29 
30  // User data methods
31  inline std::string getTable() override { return ""; }
32  inline std::string getEBAccount() { return "CMS_ECAL_LV_PVSS_COND"; }
33  inline std::string getEEAccount() { return "CMS_ECAL_LV_PVSS_COND"; }
34  inline void setLV(float t) { m_lv = t; }
35  inline void setStatus(int t) { m_status = t; }
36  inline void setLVNominal(float t) { m_lvnom = t; }
37  inline float getLV() const { return m_lv; }
38  inline float getLVNominal() const { return m_lvnom; }
39  inline int getStatus() const { return m_status; }
40  int getTimeStatus() { return m_tstatus; }
41  void setTimeStatus(int t) { m_tstatus = t; }
42 
43 private:
44  void setStatusForBarrel(RunDCSLVDat&, const Tm&);
45  void setStatusForEndcaps(RunDCSLVDat&, const Tm&);
48  int nowMicroseconds();
49  void fillTheMap(ResultSet*, std::map<EcalLogicID, RunDCSLVDat>*);
50  void prepareWrite() noexcept(false) override;
51 
52  void writeDB(const EcalLogicID* ecid, const RunDCSLVDat* item, RunIOV* iov) noexcept(false);
53 
54  void fetchData(std::map<EcalLogicID, RunDCSLVDat>* fillMap, RunIOV* iov) noexcept(false);
55 
56  void fetchLastData(std::map<EcalLogicID, RunDCSLVDat>* fillMap) noexcept(false);
57 
58  // User data
59  float m_lv;
60  float m_lvnom;
61  int m_status;
62  int m_tstatus;
63 };
64 
65 #endif
std::string getEEAccount()
Definition: RunDCSLVDat.h:33
int nowMicroseconds()
Definition: RunDCSLVDat.cc:123
std::string getEBAccount()
Definition: RunDCSLVDat.h:32
static const int maxLVDifferenceEE
Definition: RunDCSLVDat.h:20
std::string getTable() override
Definition: RunDCSLVDat.h:31
void setLV(float t)
Definition: RunDCSLVDat.h:34
void fetchData(std::map< EcalLogicID, RunDCSLVDat > *fillMap, RunIOV *iov) noexcept(false)
Definition: RunDCSLVDat.cc:29
~RunDCSLVDat() override
Definition: RunDCSLVDat.cc:23
float getLV() const
Definition: RunDCSLVDat.h:37
float m_lvnom
Definition: RunDCSLVDat.h:60
static const int maxLVDifferenceEB
Definition: RunDCSLVDat.h:19
oracle::occi::ResultSet ResultSet
Definition: RunDCSLVDat.h:16
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSLVDat > *)
Definition: RunDCSLVDat.cc:87
int getTimeStatus()
Definition: RunDCSLVDat.h:40
static const int LVOFF
Definition: RunDCSLVDat.h:24
void setStatus(int t)
Definition: RunDCSLVDat.h:35
void setStatusForEndcaps(RunDCSLVDat &, const Tm &)
Definition: RunDCSLVDat.cc:149
void writeDB(const EcalLogicID *ecid, const RunDCSLVDat *item, RunIOV *iov) noexcept(false)
Definition: RunDCSLVDat.cc:27
ResultSet * getBarrelRset()
Definition: RunDCSLVDat.cc:33
ResultSet * getEndcapRset()
Definition: RunDCSLVDat.cc:60
void prepareWrite() noexcept(false) override
Definition: RunDCSLVDat.cc:25
static const int maxDifference
Definition: RunDCSLVDat.h:18
static const int LVNOTNOMINAL
Definition: RunDCSLVDat.h:23
void fetchLastData(std::map< EcalLogicID, RunDCSLVDat > *fillMap) noexcept(false)
Definition: RunDCSLVDat.cc:167
float getLVNominal() const
Definition: RunDCSLVDat.h:38
void setLVNominal(float t)
Definition: RunDCSLVDat.h:36
static const int minLV
Definition: RunDCSLVDat.h:21
Definition: RunIOV.h:13
float m_lv
Definition: RunDCSLVDat.h:59
int getStatus() const
Definition: RunDCSLVDat.h:39
Definition: Tm.h:13
void setTimeStatus(int t)
Definition: RunDCSLVDat.h:41
void setStatusForBarrel(RunDCSLVDat &, const Tm &)
Definition: RunDCSLVDat.cc:131