CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RunIOV.h
Go to the documentation of this file.
1 #ifndef RUNIOV_H
2 #define RUNIOV_H
3 
4 #include <stdexcept>
5 #include <iostream>
6 
10 
11 typedef int run_t;
12 
13 class RunIOV : public IIOV {
14 public:
15  friend class EcalCondDBInterface;
16 
17  RunIOV();
18  ~RunIOV() override;
19 
20  // Methods for user data
21  void setRunNumber(run_t run);
22  run_t getRunNumber() const;
23  void setRunStart(const Tm& start);
24  Tm getRunStart() const;
25  void setRunEnd(const Tm& end);
26  Tm getRunEnd() const;
27  void setRunTag(const RunTag& tag);
28  RunTag getRunTag() const;
29  void setID(int id);
30 
31  void setDBInsertionTime(const Tm& dbtime) { m_dbtime = dbtime; }
33 
34  // Methods from IUniqueDBObject
35  int getID() { return m_ID; };
36 
37  int fetchID() noexcept(false) override;
38  int fetchIDByRunAndTag() noexcept(false);
39  void setByID(int id) noexcept(false) override;
40 
41  // operators
42  inline bool operator==(const RunIOV& r) const {
43  return (m_runNum == r.m_runNum && m_runStart == r.m_runStart && m_runEnd == r.m_runEnd && m_runTag == r.m_runTag);
44  }
45 
46  inline bool operator!=(const RunIOV& r) const { return !(*this == r); }
47 
48 private:
49  // User data for this IOV
55 
56  int writeDB() noexcept(false);
57  int updateEndTimeDB() noexcept(false);
58  int updateStartTimeDB() noexcept(false);
59 
60  void setByRun(RunTag* tag, run_t run) noexcept(false);
61  void setByRun(std::string location, run_t run) noexcept(false);
62  void setByTime(std::string location, const Tm& t) noexcept(false);
63  void setByRecentData(std::string dataTable, RunTag* tag, run_t run = (unsigned int)-1) noexcept(false);
64  void setByRecentData(std::string dataTable, std::string location, run_t run) noexcept(false);
65 
66  /* void fetchEarliest(RunIOV* fillIOV, RunTag* tag) const noexcept(false); */
67  /* void fetchLatest(RunIOV* fillIOV, RunTag* tag) const noexcept(false); */
68  /* oracle::occi::Statement* prepareFetch(const std::string sql, RunTag* tag) const noexcept(false); */
69  /* void fill(RunIOV* target, oracle::occi::ResultSet* rset) const noexcept(false); */
70 
71  /* // Methods for fetching by Tm */
72  /* void fetchAt(RunIOV* iov, const Tm eventTm, RunTag* tag) const noexcept(false); */
73  /* void fetchWithin(std::vector<RunIOV>* fillVec, const Tm beginTm, const Tm endTm, RunTag* tag) const noexcept(false); */
74 
75  /* // Methods for fetching by run_t */
76  /* void fetchAt(RunIOV* fillIOV, const run_t run, RunTag* tag) const noexcept(false); */
77  /* void fetchWithin(std::vector<RunIOV>* fillVec, const run_t beginRun, const run_t endRun, RunTag* tag) const noexcept(false); */
78 };
79 
80 #endif
Definition: IIOV.h:11
int updateEndTimeDB() noexcept(false)
Definition: RunIOV.cc:188
void setByTime(std::string location, const Tm &t) noexcept(false)
Definition: RunIOV.cc:353
void setByID(int id) noexcept(false) override
Definition: RunIOV.cc:106
int run_t
Definition: CaliIOV.h:11
void setRunStart(const Tm &start)
Definition: RunIOV.cc:33
Tm m_dbtime
Definition: RunIOV.h:54
Tm getDBInsertionTime()
Definition: RunIOV.h:32
int fetchIDByRunAndTag() noexcept(false)
Definition: RunIOV.cc:229
Definition: RunTag.h:13
Tm m_runStart
Definition: RunIOV.h:51
RunIOV()
Definition: RunIOV.cc:12
int updateStartTimeDB() noexcept(false)
Definition: RunIOV.cc:273
void setDBInsertionTime(const Tm &dbtime)
Definition: RunIOV.h:31
bool operator!=(const RunIOV &r) const
Definition: RunIOV.h:46
void setRunTag(const RunTag &tag)
Definition: RunIOV.cc:51
void setRunNumber(run_t run)
Definition: RunIOV.cc:22
RunTag getRunTag() const
Definition: RunIOV.cc:58
Tm getRunStart() const
Definition: RunIOV.cc:40
void setByRun(RunTag *tag, run_t run) noexcept(false)
Definition: RunIOV.cc:314
Tm m_runEnd
Definition: RunIOV.h:52
int writeDB() noexcept(false)
Definition: RunIOV.cc:140
Tm getRunEnd() const
Definition: RunIOV.cc:49
void setRunEnd(const Tm &end)
Definition: RunIOV.cc:42
run_t getRunNumber() const
Definition: RunIOV.cc:31
run_t m_runNum
Definition: RunIOV.h:50
string end
Definition: dataset.py:937
int getID()
Definition: RunIOV.h:35
RunTag m_runTag
Definition: RunIOV.h:53
~RunIOV() override
Definition: RunIOV.cc:20
Definition: RunIOV.h:13
int fetchID() noexcept(false) override
Definition: RunIOV.cc:60
Definition: Tm.h:13
void setByRecentData(std::string dataTable, RunTag *tag, run_t run=(unsigned int)-1) noexcept(false)
Definition: RunIOV.cc:429
void setID(int id)
Definition: RunIOV.cc:29