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
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
edm::EventID::operator<=
bool operator<=(EventID const &iRHS) const
Definition: EventID.h:86
edm::invalidLuminosityBlockNumber
const LuminosityBlockNumber_t invalidLuminosityBlockNumber
Definition: RunLumiEventNumber.h:17
edm::EventID::operator>
bool operator>(EventID const &iRHS) const
Definition: EventID.h:88
edm::EventID::event_
EventNumber_t event_
Definition: EventID.h:111
edm::EventID::maxRunNumber
static RunNumber_t maxRunNumber()
Definition: EventID.h:92
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::max
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:118
edm::min
EventID const & min(EventID const &lh, EventID const &rh)
Definition: EventID.h:116
RunLumiEventNumber.h
mathSSE::lh
bool int lh
Definition: SIMDVec.h:20
edm::EventID::previous
EventID previous(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:58
edm::EventID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
edm::invalidRunNumber
const RunNumber_t invalidRunNumber
Definition: RunLumiEventNumber.h:18
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition: HLTGlobalStatus.h:106
edm::EventID::maxLuminosityBlockNumber
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
Definition: EventID.h:94
edm::EventID::nextRunFirstEvent
EventID nextRunFirstEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:50
edm::invalidEventNumber
const EventNumber_t invalidEventNumber
Definition: RunLumiEventNumber.h:16
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
edm::EventID::maxEventNumber
static EventNumber_t maxEventNumber()
Definition: EventID.h:96
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::EventID::setLuminosityBlockNumber
void setLuminosityBlockNumber(LuminosityBlockNumber_t const &lb)
Definition: EventID.h:101
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventID::nextRun
EventID nextRun(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:49
edm::EventID::previousRunLastEvent
EventID previousRunLastEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:51
edm::EventID::EventID
EventID(RunNumber_t iRun, LuminosityBlockNumber_t iLumi, EventNumber_t iEvent)
Definition: EventID.h:34
edm::EventID::EventID
EventID()
Definition: EventID.h:33
edm::EventID::operator<
bool operator<(EventID const &iRHS) const
Definition: EventID.h:68
edm::EventID::firstValidEvent
static EventID firstValidEvent()
Definition: EventID.h:98
edm::EventID::operator>=
bool operator>=(EventID const &iRHS) const
Definition: EventID.h:80
edm::EventID::run_
RunNumber_t run_
Definition: EventID.h:109
edm::EventID::luminosityBlock_
LuminosityBlockNumber_t luminosityBlock_
Definition: EventID.h:110
edm::EventID
Definition: EventID.h:31
edm::EventID::operator==
bool operator==(EventID const &iRHS) const
Definition: EventID.h:82
lumi
Definition: LumiSectionData.h:20
RunID.h
edm::EventID::operator!=
bool operator!=(EventID const &iRHS) const
Definition: EventID.h:84
edm::EventID::next
EventID next(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:43