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  // 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
EcalCondDBInterface
Definition: EcalCondDBInterface.h:37
RunIOV
Definition: RunIOV.h:13
RunIOV::m_runStart
Tm m_runStart
Definition: RunIOV.h:51
RunIOV::~RunIOV
~RunIOV() override
Definition: RunIOV.cc:20
RunIOV::getID
int getID()
Definition: RunIOV.h:35
start
Definition: start.py:1
IUniqueDBObject::m_ID
int m_ID
Definition: IUniqueDBObject.h:18
RunIOV::updateStartTimeDB
int updateStartTimeDB() noexcept(false)
Definition: RunIOV.cc:273
funct::false
false
Definition: Factorize.h:34
run_t
int run_t
Definition: CaliIOV.h:11
RunIOV::setID
void setID(int id)
Definition: RunIOV.cc:29
RunTag
Definition: RunTag.h:13
RunIOV::setByTime
void setByTime(std::string location, const Tm &t) noexcept(false)
Definition: RunIOV.cc:353
RunIOV::setByID
void setByID(int id) noexcept(false) override
Definition: RunIOV.cc:106
RunIOV::m_dbtime
Tm m_dbtime
Definition: RunIOV.h:54
RunIOV::setRunStart
void setRunStart(const Tm &start)
Definition: RunIOV.cc:33
watchdog.const
const
Definition: watchdog.py:83
end
#define end
Definition: vmac.h:39
Utilities.operator
operator
Definition: Utilities.py:24
RunIOV::getRunEnd
Tm getRunEnd() const
Definition: RunIOV.cc:49
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
RunIOV::getRunTag
RunTag getRunTag() const
Definition: RunIOV.cc:58
RunIOV::RunIOV
RunIOV()
Definition: RunIOV.cc:12
IIOV
Definition: IIOV.h:11
RunIOV::setDBInsertionTime
void setDBInsertionTime(const Tm &dbtime)
Definition: RunIOV.h:31
RunIOV::setRunTag
void setRunTag(const RunTag &tag)
Definition: RunIOV.cc:51
OrderedSet.t
t
Definition: OrderedSet.py:90
RunIOV::getRunNumber
run_t getRunNumber() const
Definition: RunIOV.cc:31
Tm
Definition: Tm.h:13
RunIOV::setByRecentData
void setByRecentData(std::string dataTable, RunTag *tag, run_t run=(unsigned int) -1) noexcept(false)
Definition: RunIOV.cc:429
IIOV.h
RunIOV::setRunNumber
void setRunNumber(run_t run)
Definition: RunIOV.cc:22
run_t
int run_t
Definition: RunIOV.h:11
Tm.h
RunIOV::m_runTag
RunTag m_runTag
Definition: RunIOV.h:53
RunIOV::operator!=
bool operator!=(const RunIOV &r) const
Definition: RunIOV.h:46
RunIOV::setByRun
void setByRun(RunTag *tag, run_t run) noexcept(false)
Definition: RunIOV.cc:314
alignCSCRings.r
r
Definition: alignCSCRings.py:93
RunIOV::fetchID
int fetchID() noexcept(false) override
Definition: RunIOV.cc:60
RunIOV::m_runEnd
Tm m_runEnd
Definition: RunIOV.h:52
RunIOV::writeDB
int writeDB() noexcept(false)
Definition: RunIOV.cc:140
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
RunIOV::updateEndTimeDB
int updateEndTimeDB() noexcept(false)
Definition: RunIOV.cc:188
EcalCondDBWriter_cfi.location
location
Definition: EcalCondDBWriter_cfi.py:63
RunTag.h
RunIOV::getRunStart
Tm getRunStart() const
Definition: RunIOV.cc:40
RunIOV::setRunEnd
void setRunEnd(const Tm &end)
Definition: RunIOV.cc:42
RunIOV::getDBInsertionTime
Tm getDBInsertionTime()
Definition: RunIOV.h:32
RunIOV::fetchIDByRunAndTag
int fetchIDByRunAndTag() noexcept(false)
Definition: RunIOV.cc:229
RunIOV::m_runNum
run_t m_runNum
Definition: RunIOV.h:50