CMS 3D CMS Logo

LumiSummary.h
Go to the documentation of this file.
1 #ifndef DataFormats_Luminosity_LumiSummary_h
2 #define DataFormats_Luminosity_LumiSummary_h
3 
17 #include <vector>
18 #include <iosfwd>
19 #include <string>
20 class LumiSummary {
21 public:
22  class L1 {
23  public:
24  L1() : triggernameidx(-1), prescale(0) {}
26  unsigned int prescale;
27  };
28  class HLT {
29  public:
30  HLT() : pathnameidx(-1), prescale(0) {}
32  unsigned int prescale;
33  };
34 
35 public:
38  : lumiversion_("-1"),
39  avginsdellumi_(0.0),
40  avginsdellumierr_(0.0),
41  lumisecqual_(0),
42  deadcount_(0),
43  bitzerocount_(),
44  lsnumber_(0),
45  startorbit_(0),
46  numorbit_(0) {
47  hltdata_.reserve(100);
48  l1data_.reserve(192);
49  }
50 
52  LumiSummary(float avginsdellumi,
53  float avginsdellumierr,
54  short lumisecqual,
55  unsigned long long deadcount,
56  unsigned long long bitzerocount,
57  unsigned int lsnumber,
58  const std::vector<L1>& l1in,
59  const std::vector<HLT>& hltin,
60  unsigned int startorbit,
61  unsigned int numorbit,
62  const std::string& lumiversion)
64  avginsdellumi_(avginsdellumi),
65  avginsdellumierr_(avginsdellumierr),
66  lumisecqual_(lumisecqual),
69  lsnumber_(lsnumber),
70  hltdata_(hltin),
71  l1data_(l1in),
72  startorbit_(startorbit),
73  numorbit_(numorbit) {}
74 
82  float avgInsDelLumi() const;
86  float avgInsDelLumiErr() const;
92  float intgDelLumi() const;
93  short lumiSecQual() const;
97  unsigned long long deadcount() const;
101  unsigned long long bitzerocount() const;
108  float deadFrac() const;
115  float liveFrac() const;
119  float lumiSectionLength() const;
120  unsigned int lsNumber() const;
121  unsigned int startOrbit() const;
122  unsigned int numOrbit() const;
125  bool isValid() const;
126  //retrieve trigger bit by bit number 0-191(algo,tech)
127  L1 l1info(unsigned int idx) const;
128  HLT hltinfo(unsigned int idx) const;
129  size_t nTriggerLine() const;
130  size_t nHLTPath() const;
132  float avgInsRecLumi() const;
134  float avgInsRecLumiErr() const;
136  float intgRecLumi() const;
137  bool isProductEqual(LumiSummary const& next) const;
142  std::string lumiVersion() const;
143  //
144  //setters
145  //
147  void setLumiData(float instlumi, float instlumierr, short lumiquality);
148  void setDeadCount(unsigned long long deadcount);
149  void setBitZeroCount(unsigned long long bitzerocount);
150  void setlsnumber(unsigned int lsnumber);
151  void setOrbitData(unsigned int startorbit, unsigned int numorbit);
152  void swapL1Data(std::vector<L1>& l1data);
153  void swapHLTData(std::vector<HLT>& hltdata);
154  void copyL1Data(const std::vector<L1>& l1data);
155  void copyHLTData(const std::vector<HLT>& hltdata);
156 
157 private:
159  //instant lumi , selected from best algorithm
161  //instant lumierror
163  //detector quality flag use HF,HLX
165  unsigned long long deadcount_;
166  unsigned long long bitzerocount_;
167  unsigned int lsnumber_;
168  //contains about 100 - 200 hlt paths
169  std::vector<HLT> hltdata_;
170  //contains 128 + 64 triggers
171  std::vector<L1> l1data_;
172  //first orbit number of this LS
173  unsigned int startorbit_;
174  //number of orbits in this LS
175  unsigned int numorbit_;
176 };
177 
178 std::ostream& operator<<(std::ostream& s, const LumiSummary& lumiSummary);
179 
180 #endif // DataFormats_Luminosity_LumiSummary_h
float liveFrac() const
Definition: LumiSummary.cc:35
short lumiSecQual() const
Definition: LumiSummary.cc:19
bool isValid() const
Definition: LumiSummary.cc:50
float avgInsDelLumiErr() const
Definition: LumiSummary.cc:17
unsigned long long bitzerocount_
Definition: LumiSummary.h:166
float avgInsRecLumiErr() const
Definition: LumiSummary.cc:56
float intgDelLumi() const
Definition: LumiSummary.cc:16
float lumiSectionLength() const
Definition: LumiSummary.cc:43
void swapHLTData(std::vector< HLT > &hltdata)
Definition: LumiSummary.cc:78
unsigned int startOrbit() const
Definition: LumiSummary.cc:48
unsigned int startorbit_
Definition: LumiSummary.h:173
~LumiSummary()
destructor
Definition: LumiSummary.h:76
size_t nTriggerLine() const
Definition: LumiSummary.cc:53
LumiSummary(float avginsdellumi, float avginsdellumierr, short lumisecqual, unsigned long long deadcount, unsigned long long bitzerocount, unsigned int lsnumber, const std::vector< L1 > &l1in, const std::vector< HLT > &hltin, unsigned int startorbit, unsigned int numorbit, const std::string &lumiversion)
set default constructor
Definition: LumiSummary.h:52
std::string lumiVersion() const
Definition: LumiSummary.cc:63
unsigned long long deadcount() const
Definition: LumiSummary.cc:20
void setlsnumber(unsigned int lsnumber)
Definition: LumiSummary.cc:72
unsigned int lsnumber_
Definition: LumiSummary.h:167
std::vector< L1 > l1data_
Definition: LumiSummary.h:171
unsigned int prescale
Definition: LumiSummary.h:26
void setOrbitData(unsigned int startorbit, unsigned int numorbit)
Definition: LumiSummary.cc:73
float avgInsDelLumi() const
Definition: LumiSummary.cc:8
float avgInsRecLumi() const
Definition: LumiSummary.cc:55
bool isProductEqual(LumiSummary const &next) const
Definition: LumiSummary.cc:57
LumiSummary()
default constructor
Definition: LumiSummary.h:37
void copyL1Data(const std::vector< L1 > &l1data)
Definition: LumiSummary.cc:79
float avginsdellumierr_
Definition: LumiSummary.h:162
std::ostream & operator<<(std::ostream &s, const LumiSummary &lumiSummary)
Definition: LumiSummary.cc:81
unsigned int lsNumber() const
Definition: LumiSummary.cc:47
void setLumiVersion(const std::string &lumiversion)
Definition: LumiSummary.cc:64
size_t nHLTPath() const
Definition: LumiSummary.cc:54
std::string lumiversion_
Definition: LumiSummary.h:158
void setLumiData(float instlumi, float instlumierr, short lumiquality)
Definition: LumiSummary.cc:65
void setBitZeroCount(unsigned long long bitzerocount)
Definition: LumiSummary.cc:71
void copyHLTData(const std::vector< HLT > &hltdata)
Definition: LumiSummary.cc:80
void setDeadCount(unsigned long long deadcount)
Definition: LumiSummary.cc:70
short lumisecqual_
Definition: LumiSummary.h:164
void swapL1Data(std::vector< L1 > &l1data)
Definition: LumiSummary.cc:77
L1 l1info(unsigned int idx) const
Definition: LumiSummary.cc:51
unsigned int numorbit_
Definition: LumiSummary.h:175
float deadFrac() const
Definition: LumiSummary.cc:22
unsigned long long deadcount_
Definition: LumiSummary.h:165
float avginsdellumi_
Definition: LumiSummary.h:160
HLT hltinfo(unsigned int idx) const
Definition: LumiSummary.cc:52
unsigned long long bitzerocount() const
Definition: LumiSummary.cc:21
float intgRecLumi() const
Definition: LumiSummary.cc:18
std::vector< HLT > hltdata_
Definition: LumiSummary.h:169
unsigned int numOrbit() const
Definition: LumiSummary.cc:49
unsigned int prescale
Definition: LumiSummary.h:32