CMS 3D CMS Logo

EventID.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_EventID_h
2 #define DataFormats_Provenance_EventID_h
3 // -*- C++ -*-
4 //
5 // Package: DataFormats/Provenance
6 // Class : EventID
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Mon Aug 8 15:13:14 EDT 2005
19 //
20 
21 // system include files
22 #include <iosfwd>
23 
24 // user include files
27 
28 // forward declarations
29 namespace edm {
30 
31  class EventID {
32  public:
35  : run_(iRun), luminosityBlock_(iLumi), event_(iEvent) {}
36 
37  // ---------- const member functions ---------------------
38  RunNumber_t run() const { return run_; }
40  EventNumber_t event() const { return event_; }
41 
42  //moving from one EventID to another one
44  if (event_ != maxEventNumber()) {
45  return EventID(run_, lumi, event_ + 1);
46  }
47  return EventID(run_ + 1, lumi, 1);
48  }
49  EventID nextRun(LuminosityBlockNumber_t const& lumi) const { return EventID(run_ + 1, lumi, 0); }
52  if (run_ > 1) {
53  return EventID(run_ - 1, lumi, maxEventNumber());
54  }
55  return EventID();
56  }
57 
59  if (event_ > 1) {
60  return EventID(run_, lumi, event_ - 1);
61  }
62  if (run_ != 0) {
63  return EventID(run_ - 1, lumi, maxEventNumber());
64  }
65  return EventID();
66  }
67 
68  bool operator<(EventID const& iRHS) const {
69  if (run_ < iRHS.run_)
70  return true;
71  if (run_ > iRHS.run_)
72  return false;
74  return true;
76  return false;
77  return (event_ < iRHS.event_);
78  }
79 
80  bool operator>=(EventID const& iRHS) const { return !(*this < iRHS); }
81 
82  bool operator==(EventID const& iRHS) const { return !(*this < iRHS || iRHS < *this); }
83 
84  bool operator!=(EventID const& iRHS) const { return !(*this == iRHS); }
85 
86  bool operator<=(EventID const& iRHS) const { return (*this < iRHS || *this == iRHS); }
87 
88  bool operator>(EventID const& iRHS) const { return !(*this <= iRHS); }
89 
90  // ---------- static functions ---------------------------
91 
92  static RunNumber_t maxRunNumber() { return 0xFFFFFFFFU; }
93 
94  static LuminosityBlockNumber_t maxLuminosityBlockNumber() { return 0xFFFFFFFFU; }
95 
96  static EventNumber_t maxEventNumber() { return 0xFFFFFFFFFFFFFFFFULL; }
97 
98  static EventID firstValidEvent() { return EventID(1, 1, 1); }
99  // ---------- member functions ---------------------------
100 
102 
103  private:
104  //EventID(EventID const&); // stop default
105 
106  //EventID const& operator=(EventID const&); // stop default
107 
108  // ---------- member data --------------------------------
112  };
113 
114  std::ostream& operator<<(std::ostream& oStream, EventID const& iID);
115 
116  inline EventID const& min(EventID const& lh, EventID const& rh) { return (rh < lh ? rh : lh); }
117 
118  inline EventID const& max(EventID const& lh, EventID const& rh) { return (rh < lh ? lh : rh); }
119 } // namespace edm
120 #endif
EventID next(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:43
EventNumber_t event_
Definition: EventID.h:111
static RunNumber_t maxRunNumber()
Definition: EventID.h:92
RunNumber_t const invalidRunNumber
bool operator>(EventID const &iRHS) const
Definition: EventID.h:88
bool operator<=(EventID const &iRHS) const
Definition: EventID.h:86
unsigned long long EventNumber_t
LuminosityBlockNumber_t luminosityBlock_
Definition: EventID.h:110
bool int lh
Definition: SIMDVec.h:27
unsigned int LuminosityBlockNumber_t
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
EventNumber_t const invalidEventNumber
int iEvent
Definition: GenABIO.cc:224
EventID previous(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:58
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
Definition: EventID.h:94
RunNumber_t run_
Definition: EventID.h:109
void setLuminosityBlockNumber(LuminosityBlockNumber_t const &lb)
Definition: EventID.h:101
EventID const & min(EventID const &lh, EventID const &rh)
Definition: EventID.h:116
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
bool operator<(EventID const &iRHS) const
Definition: EventID.h:68
RunNumber_t run() const
Definition: EventID.h:38
EventID nextRun(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:49
static EventID firstValidEvent()
Definition: EventID.h:98
static EventNumber_t maxEventNumber()
Definition: EventID.h:96
EventID nextRunFirstEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:50
EventID previousRunLastEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:51
HLT enums.
bool operator>=(EventID const &iRHS) const
Definition: EventID.h:80
unsigned int RunNumber_t
EventID(RunNumber_t iRun, LuminosityBlockNumber_t iLumi, EventNumber_t iEvent)
Definition: EventID.h:34
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger table.
EventNumber_t event() const
Definition: EventID.h:40
bool operator==(EventID const &iRHS) const
Definition: EventID.h:82
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:118
bool operator!=(EventID const &iRHS) const
Definition: EventID.h:84