test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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();
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() throw(std::runtime_error);
39  int fetchIDByRunAndTag() throw(std::runtime_error);
40  void setByID(int id) throw(std::runtime_error);
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() throw(std::runtime_error);
62  int updateEndTimeDB() throw(std::runtime_error);
63  int updateStartTimeDB() throw(std::runtime_error);
64 
65  void setByRun(RunTag* tag, run_t run) throw(std::runtime_error);
66  void setByRun(std::string location, run_t run) throw(std::runtime_error);
67  void setByTime(std::string location, const Tm &t) throw(std::runtime_error);
68  void setByRecentData(std::string dataTable, RunTag* tag, run_t run = (unsigned int)-1) throw(std::runtime_error);
69  void setByRecentData(std::string dataTable, std::string location, run_t run) throw(std::runtime_error);
70 
71 
72 /* void fetchEarliest(RunIOV* fillIOV, RunTag* tag) const throw(std::runtime_error); */
73 /* void fetchLatest(RunIOV* fillIOV, RunTag* tag) const throw(std::runtime_error); */
74 /* oracle::occi::Statement* prepareFetch(const std::string sql, RunTag* tag) const throw(std::runtime_error); */
75 /* void fill(RunIOV* target, oracle::occi::ResultSet* rset) const throw(std::runtime_error); */
76 
77 /* // Methods for fetching by Tm */
78 /* void fetchAt(RunIOV* iov, const Tm eventTm, RunTag* tag) const throw(std::runtime_error); */
79 /* void fetchWithin(std::vector<RunIOV>* fillVec, const Tm beginTm, const Tm endTm, RunTag* tag) const throw(std::runtime_error); */
80 
81 /* // Methods for fetching by run_t */
82 /* void fetchAt(RunIOV* fillIOV, const run_t run, RunTag* tag) const throw(std::runtime_error); */
83 /* void fetchWithin(std::vector<RunIOV>* fillVec, const run_t beginRun, const run_t endRun, RunTag* tag) const throw(std::runtime_error); */
84 };
85 
86 #endif
Definition: IIOV.h:11
void setByTime(std::string location, const Tm &t)
Definition: RunIOV.cc:417
int run_t
Definition: CaliIOV.h:11
void setRunStart(const Tm &start)
Definition: RunIOV.cc:52
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
Tm m_dbtime
Definition: RunIOV.h:59
Tm getDBInsertionTime()
Definition: RunIOV.h:32
void setByID(int id)
Definition: RunIOV.cc:152
Definition: RunTag.h:13
Tm m_runStart
Definition: RunIOV.h:56
int fetchID()
Definition: RunIOV.cc:103
RunIOV()
Definition: RunIOV.cc:12
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
int fetchIDByRunAndTag()
Definition: RunIOV.cc:284
void setRunNumber(run_t run)
Definition: RunIOV.cc:29
RunTag getRunTag() const
Definition: RunIOV.cc:96
void setByRun(RunTag *tag, run_t run)
Definition: RunIOV.cc:376
Tm getRunStart() const
Definition: RunIOV.cc:62
int updateStartTimeDB()
Definition: RunIOV.cc:330
~RunIOV()
Definition: RunIOV.cc:23
#define end
Definition: vmac.h:37
Tm m_runEnd
Definition: RunIOV.h:57
string const
Definition: compareJSON.py:14
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
void setByRecentData(std::string dataTable, RunTag *tag, run_t run=(unsigned int)-1)
Definition: RunIOV.cc:496
RunTag m_runTag
Definition: RunIOV.h:58
int writeDB()
Definition: RunIOV.cc:190
Definition: RunIOV.h:13
int updateEndTimeDB()
Definition: RunIOV.cc:240
Definition: Tm.h:13
void setID(int id)
Definition: RunIOV.cc:37