CMS 3D CMS Logo

LuminosityBlockID.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_LuminosityBlockID_h
2 #define DataFormats_Provenance_LuminosityBlockID_h
3 // -*- C++ -*-
4 //
5 // Package: DataFormats/Provenance
6 // Class : LuminosityBlockID
7 //
16 //
17 //
18 
19 // system include files
20 #include <functional>
21 #include <iosfwd>
22 
23 // user include files
26 #include <cstdint>
27 
28 // forward declarations
29 namespace edm {
30 
32  public:
34  explicit LuminosityBlockID(uint64_t id);
36  : run_(iRun), luminosityBlock_(iLuminosityBlock) {}
37 
38  //virtual ~LuminosityBlockID();
39 
40  // ---------- const member functions ---------------------
41  RunNumber_t run() const { return run_; }
43 
44  uint64_t value() const;
45 
46  //moving from one LuminosityBlockID to another one
50  }
51  return LuminosityBlockID(run_ + 1, 1);
52  }
53  LuminosityBlockID nextRun() const { return LuminosityBlockID(run_ + 1, 0); }
56  if (run_ > 1) {
58  }
59  return LuminosityBlockID(0, 0);
60  }
61 
63  if (luminosityBlock_ > 1) {
65  }
66  if (run_ != 0) {
68  }
69  return LuminosityBlockID(0, 0);
70  }
71 
72  bool operator==(LuminosityBlockID const& iRHS) const {
73  return iRHS.run_ == run_ && iRHS.luminosityBlock_ == luminosityBlock_;
74  }
75  bool operator!=(LuminosityBlockID const& iRHS) const { return !(*this == iRHS); }
76 
77  bool operator<(LuminosityBlockID const& iRHS) const { return doOp<std::less>(iRHS); }
78  bool operator<=(LuminosityBlockID const& iRHS) const { return doOp<std::less_equal>(iRHS); }
79  bool operator>(LuminosityBlockID const& iRHS) const { return doOp<std::greater>(iRHS); }
80  bool operator>=(LuminosityBlockID const& iRHS) const { return doOp<std::greater_equal>(iRHS); }
81 
82  // ---------- static functions ---------------------------
83 
84  static LuminosityBlockNumber_t maxLuminosityBlockNumber() { return 0xFFFFFFFFU; }
85 
87  // ---------- member functions ---------------------------
88 
89  private:
90  template <template <typename> class Op>
91  bool doOp(LuminosityBlockID const& iRHS) const {
92  //Run takes presidence for comparisions
93  if (run_ == iRHS.run_) {
94  Op<LuminosityBlockNumber_t> op_e;
95  return op_e(luminosityBlock_, iRHS.luminosityBlock_);
96  }
97  Op<RunNumber_t> op;
98  return op(run_, iRHS.run_);
99  }
100  //LuminosityBlockID(LuminosityBlockID const&); // stop default
101 
102  //LuminosityBlockID const& operator=(LuminosityBlockID const&); // stop default
103 
104  // ---------- member data --------------------------------
107  };
108 
109  std::ostream& operator<<(std::ostream& oStream, LuminosityBlockID const& iID);
110 
111  inline LuminosityBlockID const& min(LuminosityBlockID const& lh, LuminosityBlockID const& rh) {
112  return (rh < lh ? rh : lh);
113  }
114 
115  inline LuminosityBlockID const& max(LuminosityBlockID const& lh, LuminosityBlockID const& rh) {
116  return (rh < lh ? lh : rh);
117  }
118 
119 } // namespace edm
120 #endif
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
edm::LuminosityBlockID::next
LuminosityBlockID next() const
Definition: LuminosityBlockID.h:47
edm::LuminosityBlockID::previousRunLastLuminosityBlock
LuminosityBlockID previousRunLastLuminosityBlock() const
Definition: LuminosityBlockID.h:55
edm::invalidLuminosityBlockNumber
const LuminosityBlockNumber_t invalidLuminosityBlockNumber
Definition: RunLumiEventNumber.h:17
edm::LuminosityBlockID::operator==
bool operator==(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:72
edm::LuminosityBlockID::operator<=
bool operator<=(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:78
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::max
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:118
edm::LuminosityBlockID::run_
RunNumber_t run_
Definition: LuminosityBlockID.h:105
edm::min
EventID const & min(EventID const &lh, EventID const &rh)
Definition: EventID.h:116
RunLumiEventNumber.h
edm::LuminosityBlockID::doOp
bool doOp(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:91
mathSSE::lh
bool int lh
Definition: SIMDVec.h:20
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::LuminosityBlockID::operator<
bool operator<(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:77
edm::LuminosityBlockID::luminosityBlock_
LuminosityBlockNumber_t luminosityBlock_
Definition: LuminosityBlockID.h:106
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::LuminosityBlockID::nextRunFirstLuminosityBlock
LuminosityBlockID nextRunFirstLuminosityBlock() const
Definition: LuminosityBlockID.h:54
edm::LuminosityBlockID::nextRun
LuminosityBlockID nextRun() const
Definition: LuminosityBlockID.h:53
edm::LuminosityBlockID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: LuminosityBlockID.h:42
edm::LuminosityBlockID::operator!=
bool operator!=(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:75
edm::LuminosityBlockID::value
uint64_t value() const
Definition: LuminosityBlockID.cc:13
edm::LuminosityBlockID::LuminosityBlockID
LuminosityBlockID()
Definition: LuminosityBlockID.h:33
edm::LuminosityBlockID::operator>
bool operator>(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:79
edm::LuminosityBlockID::operator>=
bool operator>=(LuminosityBlockID const &iRHS) const
Definition: LuminosityBlockID.h:80
edm::LuminosityBlockID::run
RunNumber_t run() const
Definition: LuminosityBlockID.h:41
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
edm::LuminosityBlockID::LuminosityBlockID
LuminosityBlockID(RunNumber_t iRun, LuminosityBlockNumber_t iLuminosityBlock)
Definition: LuminosityBlockID.h:35
edm::LuminosityBlockID::firstValidLuminosityBlock
static LuminosityBlockID firstValidLuminosityBlock()
Definition: LuminosityBlockID.h:86
RunID.h
edm::LuminosityBlockID::maxLuminosityBlockNumber
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
Definition: LuminosityBlockID.h:84
edm::LuminosityBlockID::previous
LuminosityBlockID previous() const
Definition: LuminosityBlockID.h:62