CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 #include "boost/cstdint.hpp"
23 
24 // user include files
27 
28 // forward declarations
29 namespace edm {
30 
32  public:
36  run_(iRun), luminosityBlock_(iLuminosityBlock) {}
37 
38  //virtual ~LuminosityBlockID();
39 
40  // ---------- const member functions ---------------------
41  RunNumber_t run() const { return run_; }
43 
44  boost::uint64_t value() const;
45 
46  //moving from one LuminosityBlockID to another one
50  }
51  return LuminosityBlockID(run_+1, 1);
52  }
54  return LuminosityBlockID(run_+1, 0);
55  }
57  return LuminosityBlockID(run_+1, 1);
58  }
60  if(run_ > 1) {
62  }
63  return LuminosityBlockID(0,0);
64  }
65 
67  if(luminosityBlock_ > 1) {
69  }
70  if(run_ != 0) {
72  }
73  return LuminosityBlockID(0,0);
74  }
75 
76  bool operator==(LuminosityBlockID const& iRHS) const {
77  return iRHS.run_ == run_ && iRHS.luminosityBlock_ == luminosityBlock_;
78  }
79  bool operator!=(LuminosityBlockID const& iRHS) const {
80  return ! (*this == iRHS);
81  }
82 
83  bool operator<(LuminosityBlockID const& iRHS) const {
84  return doOp<std::less>(iRHS);
85  }
86  bool operator<=(LuminosityBlockID const& iRHS) const {
87  return doOp<std::less_equal>(iRHS);
88  }
89  bool operator>(LuminosityBlockID const& iRHS) const {
90  return doOp<std::greater>(iRHS);
91  }
92  bool operator>=(LuminosityBlockID const& iRHS) const {
93  return doOp<std::greater_equal>(iRHS);
94  }
95 
96  // ---------- static functions ---------------------------
97 
99  return 0xFFFFFFFFU;
100  }
101 
103  return LuminosityBlockID(1, 1);
104  }
105  // ---------- member functions ---------------------------
106 
107  private:
108  template<template <typename> class Op>
109  bool doOp(LuminosityBlockID const& iRHS) const {
110  //Run takes presidence for comparisions
111  if(run_ == iRHS.run_) {
112  Op<LuminosityBlockNumber_t> op_e;
113  return op_e(luminosityBlock_, iRHS.luminosityBlock_);
114  }
115  Op<RunNumber_t> op;
116  return op(run_, iRHS.run_) ;
117  }
118  //LuminosityBlockID(LuminosityBlockID const&); // stop default
119 
120  //LuminosityBlockID const& operator=(LuminosityBlockID const&); // stop default
121 
122  // ---------- member data --------------------------------
125  };
126 
127  std::ostream& operator<<(std::ostream& oStream, LuminosityBlockID const& iID);
128 
129  inline
131  return (rh < lh ? rh : lh);
132  }
133 
134  inline
136  return (rh < lh ? lh : rh);
137  }
138 
139 }
140 #endif
boost::uint64_t value() const
LuminosityBlockID previous() const
static LuminosityBlockID firstValidLuminosityBlock()
LuminosityBlockID next() const
bool operator>=(LuminosityBlockID const &iRHS) const
LuminosityBlockNumber_t luminosityBlock_
RunNumber_t const invalidRunNumber
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
bool operator>(LuminosityBlockID const &iRHS) const
bool int lh
Definition: SIMDVec.h:19
unsigned int LuminosityBlockNumber_t
bool operator!=(LuminosityBlockID const &iRHS) const
bool operator<=(LuminosityBlockID const &iRHS) const
bool doOp(LuminosityBlockID const &iRHS) const
RunNumber_t run() const
EventID const & min(EventID const &lh, EventID const &rh)
Definition: EventID.h:137
LuminosityBlockID nextRunFirstLuminosityBlock() const
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
bool operator<(LuminosityBlockID const &iRHS) const
LuminosityBlockID nextRun() const
unsigned long long uint64_t
Definition: Time.h:15
LuminosityBlockID(RunNumber_t iRun, LuminosityBlockNumber_t iLuminosityBlock)
LuminosityBlockNumber_t luminosityBlock() const
bool operator==(LuminosityBlockID const &iRHS) const
LuminosityBlockID previousRunLastLuminosityBlock() const
unsigned int RunNumber_t
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:142