CMS 3D CMS Logo

RunID.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_RunID_h
2 #define DataFormats_Provenance_RunID_h
3 // -*- C++ -*-
4 //
5 // Package: DataFormats/Provenance
6 // Class : RunID
7 //
14 #include <iosfwd>
15 
17 
18 namespace edm {
19 
20  class RunID {
21  public:
23  explicit RunID(RunNumber_t iRun) : run_(iRun) {}
24 
25  // ---------- const member functions ---------------------
26  RunNumber_t run() const { return run_; }
27 
28  //moving from one RunID to another one
29  RunID next() const { return RunID(run_ + 1); }
30  RunID previous() const {
31  if (run_ != 0) {
32  return RunID(run_ - 1);
33  }
34  return RunID(0);
35  }
36 
37  bool operator==(RunID const& iRHS) const { return iRHS.run_ == run_; }
38  bool operator!=(RunID const& iRHS) const { return !(*this == iRHS); }
39 
40  bool operator<(RunID const& iRHS) const { return run_ < iRHS.run_; }
41  bool operator<=(RunID const& iRHS) const { return run_ <= iRHS.run_; }
42  bool operator>(RunID const& iRHS) const { return run_ > iRHS.run_; }
43  bool operator>=(RunID const& iRHS) const { return run_ >= iRHS.run_; }
44  // ---------- static functions ---------------------------
45 
46  static RunNumber_t maxRunNumber() { return 0xFFFFFFFFU; }
47 
48  static RunID firstValidRun() { return RunID(1); }
49 
50  private:
51  // ---------- member data --------------------------------
53  };
54 
55  std::ostream& operator<<(std::ostream& oStream, RunID const& iID);
56 
57 } // namespace edm
58 #endif
bool operator<(RunID const &iRHS) const
Definition: RunID.h:40
RunNumber_t run_
Definition: RunID.h:52
RunNumber_t const invalidRunNumber
RunID previous() const
Definition: RunID.h:30
bool operator<=(RunID const &iRHS) const
Definition: RunID.h:41
static RunID firstValidRun()
Definition: RunID.h:48
RunID()
Definition: RunID.h:22
bool operator!=(RunID const &iRHS) const
Definition: RunID.h:38
RunID next() const
Definition: RunID.h:29
bool operator>(RunID const &iRHS) const
Definition: RunID.h:42
HLT enums.
bool operator>=(RunID const &iRHS) const
Definition: RunID.h:43
bool operator==(RunID const &iRHS) const
Definition: RunID.h:37
unsigned int RunNumber_t
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
static RunNumber_t maxRunNumber()
Definition: RunID.h:46
RunNumber_t run() const
Definition: RunID.h:26
RunID(RunNumber_t iRun)
Definition: RunID.h:23