CMS 3D CMS Logo

RunDCSHVDat.h
Go to the documentation of this file.
1 #ifndef RUNDCSHVEBDAT_H
2 #define RUNDCSHVEBDAT_H
3 
4 #include <vector>
5 #include <stdexcept>
6 
14 
15 class RunDCSHVDat : public IDataItem {
16 public:
17  typedef oracle::occi::ResultSet ResultSet;
18 
19  static const int maxDifference = 30 * 60 * 1000000; // 30 minutes
20  static const int maxHVDifferenceEB = 300; // max HV tolerance in mV for EB
21  static const int maxHVDifferenceEE = 5000; // max HV tolerance in mV for EE
22  static const int minHV = 10000; // if HV less than this value (in mV) HV is off
23 
24  static const int HVNOTNOMINAL = 1;
25  static const int HVOFF = 2;
26 
27  friend class EcalCondDBInterface;
28  RunDCSHVDat();
29  ~RunDCSHVDat() override;
30 
31  // User data methods
32  inline std::string getTable() override { return ""; }
33  inline std::string getEBAccount() { return "CMS_ECAL_HV_PVSS_COND"; }
34  inline std::string getEEAccount() { return "CMS_EE_HV_PVSS_COND"; }
35  inline void setHV(float t) { m_hv = t; }
36  inline void setStatus(int t) { m_status = t; }
37  inline void setHVNominal(float t) { m_hvnom = t; }
38  inline float getHV() const { return m_hv; }
39  inline float getHVNominal() const { return m_hvnom; }
40  inline int getStatus() const { return m_status; }
41  int getTimeStatus() { return m_tstatus; }
42  void setTimeStatus(int t) { m_tstatus = t; }
43 
44 private:
45  void setStatusForBarrel(RunDCSHVDat&, const Tm&);
46  void setStatusForEndcaps(RunDCSHVDat&, const Tm&);
48  ResultSet* getBarrelRset(const Tm& timeStart);
49 
52 
53  ResultSet* getEndcapAnodeRset(const Tm& timestart);
54  ResultSet* getEndcapDynodeRset(const Tm& timestart);
55  int nowMicroseconds();
56  void fillTheMap(ResultSet*, std::map<EcalLogicID, RunDCSHVDat>*);
57  // void fillTheMapByTime(ResultSet *, std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > >* ) ;
58  void fillTheMapByTime(ResultSet* rset, std::list<DataReducer<RunDCSHVDat>::MyData<RunDCSHVDat> >* my_data_list);
59 
60  void prepareWrite() noexcept(false) override;
61 
62  void writeDB(const EcalLogicID* ecid, const RunDCSHVDat* item, RunIOV* iov) noexcept(false);
63 
64  void fetchData(std::map<EcalLogicID, RunDCSHVDat>* fillMap, RunIOV* iov) noexcept(false);
65 
66  void fetchLastData(std::map<EcalLogicID, RunDCSHVDat>* fillMap) noexcept(false);
67 
68  void fetchHistoricalData(std::list<std::pair<Tm, std::map<EcalLogicID, RunDCSHVDat> > >* fillMap,
69  const Tm& timeStart) noexcept(false);
70 
71  // User data
72  float m_hv;
73  float m_hvnom;
74  int m_status;
75  int m_tstatus;
76 };
77 
78 #endif
static const int maxHVDifferenceEB
Definition: RunDCSHVDat.h:20
oracle::occi::ResultSet ResultSet
Definition: RunDCSHVDat.h:17
void setStatusForEndcaps(RunDCSHVDat &, const Tm &)
Definition: RunDCSHVDat.cc:398
ResultSet * getEndcapDynodeRset()
Definition: RunDCSHVDat.cc:213
std::string getEEAccount()
Definition: RunDCSHVDat.h:34
void writeDB(const EcalLogicID *ecid, const RunDCSHVDat *item, RunIOV *iov) noexcept(false)
Definition: RunDCSHVDat.cc:32
ResultSet * getEndcapAnodeRset()
Definition: RunDCSHVDat.cc:186
float m_hv
Definition: RunDCSHVDat.h:72
ResultSet * getBarrelRset()
Definition: RunDCSHVDat.cc:159
void fetchHistoricalData(std::list< std::pair< Tm, std::map< EcalLogicID, RunDCSHVDat > > > *fillMap, const Tm &timeStart) noexcept(false)
Definition: RunDCSHVDat.cc:443
static const int HVNOTNOMINAL
Definition: RunDCSHVDat.h:24
void fetchData(std::map< EcalLogicID, RunDCSHVDat > *fillMap, RunIOV *iov) noexcept(false)
Definition: RunDCSHVDat.cc:34
~RunDCSHVDat() override
Definition: RunDCSHVDat.cc:28
std::string getEBAccount()
Definition: RunDCSHVDat.h:33
void setStatusForBarrel(RunDCSHVDat &, const Tm &)
Definition: RunDCSHVDat.cc:377
int getStatus() const
Definition: RunDCSHVDat.h:40
float getHV() const
Definition: RunDCSHVDat.h:38
static const int minHV
Definition: RunDCSHVDat.h:22
static const int maxHVDifferenceEE
Definition: RunDCSHVDat.h:21
float m_hvnom
Definition: RunDCSHVDat.h:73
void fetchLastData(std::map< EcalLogicID, RunDCSHVDat > *fillMap) noexcept(false)
Definition: RunDCSHVDat.cc:416
void prepareWrite() noexcept(false) override
Definition: RunDCSHVDat.cc:30
void setTimeStatus(int t)
Definition: RunDCSHVDat.h:42
void setStatus(int t)
Definition: RunDCSHVDat.h:36
void setHVNominal(float t)
Definition: RunDCSHVDat.h:37
static const int HVOFF
Definition: RunDCSHVDat.h:25
void fillTheMapByTime(ResultSet *rset, std::list< DataReducer< RunDCSHVDat >::MyData< RunDCSHVDat > > *my_data_list)
Definition: RunDCSHVDat.cc:278
std::string getTable() override
Definition: RunDCSHVDat.h:32
float getHVNominal() const
Definition: RunDCSHVDat.h:39
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSHVDat > *)
Definition: RunDCSHVDat.cc:240
int nowMicroseconds()
Definition: RunDCSHVDat.cc:369
void setHV(float t)
Definition: RunDCSHVDat.h:35
Definition: RunIOV.h:13
Definition: Tm.h:13
int getTimeStatus()
Definition: RunDCSHVDat.h:41
static const int maxDifference
Definition: RunDCSHVDat.h:19