CMS 3D CMS Logo

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 
35  // Methods from IUniqueDBObject
36  int getID(){ return m_ID;} ;
37 
38  int fetchID() noexcept(false) override;
39  int fetchIDByRunAndTag() noexcept(false);
40  void setByID(int id) noexcept(false) override;
41 
42  // operators
43  inline bool operator==(const RunIOV &r) const
44  {
45  return (m_runNum == r.m_runNum &&
46  m_runStart == r.m_runStart &&
47  m_runEnd == r.m_runEnd &&
48  m_runTag == r.m_runTag);
49  }
50 
51  inline bool operator!=(const RunIOV &r) const { return !(*this == r); }
52 
53  private:
54  // User data for this IOV
60 
61  int writeDB() noexcept(false);
62  int updateEndTimeDB() noexcept(false);
63  int updateStartTimeDB() noexcept(false);
64 
65  void setByRun(RunTag* tag, run_t run) noexcept(false);
66  void setByRun(std::string location, run_t run) noexcept(false);
67  void setByTime(std::string location, const Tm &t) noexcept(false);
68  void setByRecentData(std::string dataTable, RunTag* tag, run_t run = (unsigned int)-1) noexcept(false);
69  void setByRecentData(std::string dataTable, std::string location, run_t run) noexcept(false);
70 
71 
72 /* void fetchEarliest(RunIOV* fillIOV, RunTag* tag) const noexcept(false); */
73 /* void fetchLatest(RunIOV* fillIOV, RunTag* tag) const noexcept(false); */
74 /* oracle::occi::Statement* prepareFetch(const std::string sql, RunTag* tag) const noexcept(false); */
75 /* void fill(RunIOV* target, oracle::occi::ResultSet* rset) const noexcept(false); */
76 
77 /* // Methods for fetching by Tm */
78 /* void fetchAt(RunIOV* iov, const Tm eventTm, RunTag* tag) const noexcept(false); */
79 /* void fetchWithin(std::vector<RunIOV>* fillVec, const Tm beginTm, const Tm endTm, RunTag* tag) const noexcept(false); */
80 
81 /* // Methods for fetching by run_t */
82 /* void fetchAt(RunIOV* fillIOV, const run_t run, RunTag* tag) const noexcept(false); */
83 /* void fetchWithin(std::vector<RunIOV>* fillVec, const run_t beginRun, const run_t endRun, RunTag* tag) const noexcept(false); */
84 };
85 
86 #endif
Definition: IIOV.h:11
int updateEndTimeDB() noexcept(false)
Definition: RunIOV.cc:240
void setByTime(std::string location, const Tm &t) noexcept(false)
Definition: RunIOV.cc:417
Definition: start.py:1
void setByID(int id) noexcept(false) override
Definition: RunIOV.cc:152
int run_t
Definition: CaliIOV.h:11
void setRunStart(const Tm &start)
Definition: RunIOV.cc:52
Tm m_dbtime
Definition: RunIOV.h:59
Tm getDBInsertionTime()
Definition: RunIOV.h:32
int run_t
Definition: RunIOV.h:11
int fetchIDByRunAndTag() noexcept(false)
Definition: RunIOV.cc:284
Definition: RunTag.h:13
Tm m_runStart
Definition: RunIOV.h:56
RunIOV()
Definition: RunIOV.cc:12
#define noexcept
int updateStartTimeDB() noexcept(false)
Definition: RunIOV.cc:330
void setDBInsertionTime(const Tm &dbtime)
Definition: RunIOV.h:31
bool operator!=(const RunIOV &r) const
Definition: RunIOV.h:51
void setRunTag(const RunTag &tag)
Definition: RunIOV.cc:86
void setRunNumber(run_t run)
Definition: RunIOV.cc:29
RunTag getRunTag() const
Definition: RunIOV.cc:96
Tm getRunStart() const
Definition: RunIOV.cc:62
void setByRun(RunTag *tag, run_t run) noexcept(false)
Definition: RunIOV.cc:376
#define end
Definition: vmac.h:39
Tm m_runEnd
Definition: RunIOV.h:57
int writeDB() noexcept(false)
Definition: RunIOV.cc:190
bool operator==(const RunIOV &r) const
Definition: RunIOV.h:43
Tm getRunEnd() const
Definition: RunIOV.cc:79
void setRunEnd(const Tm &end)
Definition: RunIOV.cc:69
run_t getRunNumber() const
Definition: RunIOV.cc:45
run_t m_runNum
Definition: RunIOV.h:55
int getID()
Definition: RunIOV.h:36
RunTag m_runTag
Definition: RunIOV.h:58
~RunIOV() override
Definition: RunIOV.cc:23
Definition: RunIOV.h:13
int fetchID() noexcept(false) override
Definition: RunIOV.cc:103
Definition: Tm.h:13
void setByRecentData(std::string dataTable, RunTag *tag, run_t run=(unsigned int)-1) noexcept(false)
Definition: RunIOV.cc:496
void setID(int id)
Definition: RunIOV.cc:37