test
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
26 
27 // forward declarations
28 namespace edm {
29 
30  typedef unsigned int LuminosityBlockNumber_t;
31 
33  public:
37  run_(iRun), luminosityBlock_(iLuminosityBlock) {}
38 
39  //virtual ~LuminosityBlockID();
40 
41  // ---------- const member functions ---------------------
42  RunNumber_t run() const { return run_; }
44 
45  boost::uint64_t value() const;
46 
47  //moving from one LuminosityBlockID to another one
51  }
52  return LuminosityBlockID(run_+1, 1);
53  }
55  return LuminosityBlockID(run_+1, 0);
56  }
58  return LuminosityBlockID(run_+1, 1);
59  }
61  if(run_ > 1) {
63  }
64  return LuminosityBlockID(0,0);
65  }
66 
68  if(luminosityBlock_ > 1) {
70  }
71  if(run_ != 0) {
73  }
74  return LuminosityBlockID(0,0);
75  }
76 
77  bool operator==(LuminosityBlockID const& iRHS) const {
78  return iRHS.run_ == run_ && iRHS.luminosityBlock_ == luminosityBlock_;
79  }
80  bool operator!=(LuminosityBlockID const& iRHS) const {
81  return ! (*this == iRHS);
82  }
83 
84  bool operator<(LuminosityBlockID const& iRHS) const {
85  return doOp<std::less>(iRHS);
86  }
87  bool operator<=(LuminosityBlockID const& iRHS) const {
88  return doOp<std::less_equal>(iRHS);
89  }
90  bool operator>(LuminosityBlockID const& iRHS) const {
91  return doOp<std::greater>(iRHS);
92  }
93  bool operator>=(LuminosityBlockID const& iRHS) const {
94  return doOp<std::greater_equal>(iRHS);
95  }
96 
97  // ---------- static functions ---------------------------
98 
100  return 0xFFFFFFFFU;
101  }
102 
104  return LuminosityBlockID(1, 1);
105  }
106  // ---------- member functions ---------------------------
107 
108  private:
109  template<template <typename> class Op>
110  bool doOp(LuminosityBlockID const& iRHS) const {
111  //Run takes presidence for comparisions
112  if(run_ == iRHS.run_) {
113  Op<LuminosityBlockNumber_t> op_e;
114  return op_e(luminosityBlock_, iRHS.luminosityBlock_);
115  }
116  Op<RunNumber_t> op;
117  return op(run_, iRHS.run_) ;
118  }
119  //LuminosityBlockID(LuminosityBlockID const&); // stop default
120 
121  //LuminosityBlockID const& operator=(LuminosityBlockID const&); // stop default
122 
123  // ---------- member data --------------------------------
126  };
127 
128  std::ostream& operator<<(std::ostream& oStream, LuminosityBlockID const& iID);
129 
130  inline
132  return (rh < lh ? rh : lh);
133  }
134 
135  inline
137  return (rh < lh ? lh : rh);
138  }
139 
140 }
141 #endif
LuminosityBlockID previous() const
static LuminosityBlockID firstValidLuminosityBlock()
LuminosityBlockID next() const
bool operator>=(LuminosityBlockID const &iRHS) const
LuminosityBlockNumber_t luminosityBlock_
static LuminosityBlockNumber_t maxLuminosityBlockNumber()
boost::uint64_t value() const
bool operator>(LuminosityBlockID const &iRHS) const
bool int lh
Definition: SIMDVec.h:19
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
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:132
LuminosityBlockID nextRunFirstLuminosityBlock() const
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
Definition: EventRange.h:32
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:137