CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
33  public:
36  run_(iRun), luminosityBlock_(iLumi), event_(iEvent) {}
37 
38  // ---------- const member functions ---------------------
39  RunNumber_t run() const { return run_; }
41  EventNumber_t event() const { return event_; }
42 
43  //moving from one EventID to another one
45  if(event_ != maxEventNumber()) {
46  return EventID(run_, lumi, event_ + 1);
47  }
48  return EventID(run_ + 1, lumi, 1);
49  }
51  return EventID(run_ + 1, lumi, 0);
52  }
54  return EventID(run_ + 1, lumi, 1);
55  }
57  if(run_ > 1) {
58  return EventID(run_ - 1, lumi, maxEventNumber());
59  }
60  return EventID();
61  }
62 
64  if(event_ > 1) {
65  return EventID(run_, lumi, event_-1);
66  }
67  if(run_ != 0) {
68  return EventID(run_ - 1, lumi, maxEventNumber());
69  }
70  return EventID();
71  }
72 
73  bool operator<(EventID const& iRHS) const {
74  if (run_ < iRHS.run_) return true;
75  if (run_ > iRHS.run_) return false;
76  if (luminosityBlock_ < iRHS.luminosityBlock_) return true;
77  if (luminosityBlock_ > iRHS.luminosityBlock_) return false;
78  return (event_ < iRHS.event_);
79  }
80 
81  bool operator>=(EventID const& iRHS) const {
82  return !(*this < iRHS);
83  }
84 
85  bool operator==(EventID const& iRHS) const {
86  return !(*this < iRHS || iRHS < *this);
87  }
88 
89  bool operator!=(EventID const& iRHS) const {
90  return !(*this == iRHS);
91  }
92 
93  bool operator<=(EventID const& iRHS) const {
94  return (*this < iRHS || *this == iRHS);
95  }
96 
97  bool operator>(EventID const& iRHS) const {
98  return !(*this <= iRHS);
99  }
100 
101  // ---------- static functions ---------------------------
102 
104  return 0xFFFFFFFFU;
105  }
106 
108  return 0xFFFFFFFFU;
109  }
110 
112  return 0xFFFFFFFFFFFFFFFFULL;
113  }
114 
116  return EventID(1, 1, 1);
117  }
118  // ---------- member functions ---------------------------
119 
121  luminosityBlock_ = lb;
122  }
123  private:
124  //EventID(EventID const&); // stop default
125 
126  //EventID const& operator=(EventID const&); // stop default
127 
128  // ---------- member data --------------------------------
132  };
133 
134  std::ostream& operator<<(std::ostream& oStream, EventID const& iID);
135 
136  inline
137  EventID const& min(EventID const& lh, EventID const& rh) {
138  return (rh < lh ? rh : lh);
139  }
140 
141  inline
142  EventID const& max(EventID const& lh, EventID const& rh) {
143  return (rh < lh ? lh : rh);
144  }
145 }
146 #endif
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
EventNumber_t event_
Definition: EventID.h:131
bool operator!=(EventID const &iRHS) const
Definition: EventID.h:89
static RunNumber_t maxRunNumber()
Definition: EventID.h:103
bool operator==(EventID const &iRHS) const
Definition: EventID.h:85
RunNumber_t const invalidRunNumber
tuple lumi
Definition: fjr2json.py:35
bool operator<(EventID const &iRHS) const
Definition: EventID.h:73
unsigned long long EventNumber_t
LuminosityBlockNumber_t luminosityBlock_
Definition: EventID.h:130
bool int lh
Definition: SIMDVec.h:19
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
unsigned int LuminosityBlockNumber_t
EventID previous(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:63
EventID next(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:44
EventNumber_t const invalidEventNumber
int iEvent
Definition: GenABIO.cc:230
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
Definition: EventID.h:107
RunNumber_t run_
Definition: EventID.h:129
void setLuminosityBlockNumber(LuminosityBlockNumber_t const &lb)
Definition: EventID.h:120
EventID const & min(EventID const &lh, EventID const &rh)
Definition: EventID.h:137
EventID nextRun(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:50
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
bool operator<=(EventID const &iRHS) const
Definition: EventID.h:93
static EventID firstValidEvent()
Definition: EventID.h:115
static EventNumber_t maxEventNumber()
Definition: EventID.h:111
EventID nextRunFirstEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:53
unsigned int RunNumber_t
EventID(RunNumber_t iRun, LuminosityBlockNumber_t iLumi, EventNumber_t iEvent)
Definition: EventID.h:35
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
EventID previousRunLastEvent(LuminosityBlockNumber_t const &lumi) const
Definition: EventID.h:56
bool operator>=(EventID const &iRHS) const
Definition: EventID.h:81
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:142
bool operator>(EventID const &iRHS) const
Definition: EventID.h:97