File indexing completed on 2024-04-06 12:04:40
0001 #ifndef DataFormats_Luminosity_LumiSummary_h
0002 #define DataFormats_Luminosity_LumiSummary_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <vector>
0018 #include <iosfwd>
0019 #include <string>
0020 class LumiSummary {
0021 public:
0022 class L1 {
0023 public:
0024 L1() : triggernameidx(-1), prescale(0) {}
0025 int triggernameidx;
0026 unsigned int prescale;
0027 };
0028 class HLT {
0029 public:
0030 HLT() : pathnameidx(-1), prescale(0) {}
0031 int pathnameidx;
0032 unsigned int prescale;
0033 };
0034
0035 public:
0036
0037 LumiSummary()
0038 : lumiversion_("-1"),
0039 avginsdellumi_(0.0),
0040 avginsdellumierr_(0.0),
0041 lumisecqual_(0),
0042 deadcount_(0),
0043 bitzerocount_(),
0044 lsnumber_(0),
0045 startorbit_(0),
0046 numorbit_(0) {
0047 hltdata_.reserve(100);
0048 l1data_.reserve(192);
0049 }
0050
0051
0052 LumiSummary(float avginsdellumi,
0053 float avginsdellumierr,
0054 short lumisecqual,
0055 unsigned long long deadcount,
0056 unsigned long long bitzerocount,
0057 unsigned int lsnumber,
0058 const std::vector<L1>& l1in,
0059 const std::vector<HLT>& hltin,
0060 unsigned int startorbit,
0061 unsigned int numorbit,
0062 const std::string& lumiversion)
0063 : lumiversion_(lumiversion),
0064 avginsdellumi_(avginsdellumi),
0065 avginsdellumierr_(avginsdellumierr),
0066 lumisecqual_(lumisecqual),
0067 deadcount_(deadcount),
0068 bitzerocount_(bitzerocount),
0069 lsnumber_(lsnumber),
0070 hltdata_(hltin),
0071 l1data_(l1in),
0072 startorbit_(startorbit),
0073 numorbit_(numorbit) {}
0074
0075
0076 ~LumiSummary() {}
0077
0078
0079
0080
0081
0082 float avgInsDelLumi() const;
0083
0084
0085
0086 float avgInsDelLumiErr() const;
0087
0088
0089
0090
0091
0092 float intgDelLumi() const;
0093 short lumiSecQual() const;
0094
0095
0096
0097 unsigned long long deadcount() const;
0098
0099
0100
0101 unsigned long long bitzerocount() const;
0102
0103
0104
0105
0106
0107
0108 float deadFrac() const;
0109
0110
0111
0112
0113
0114
0115 float liveFrac() const;
0116
0117
0118
0119 float lumiSectionLength() const;
0120 unsigned int lsNumber() const;
0121 unsigned int startOrbit() const;
0122 unsigned int numOrbit() const;
0123
0124
0125 bool isValid() const;
0126
0127 L1 l1info(unsigned int idx) const;
0128 HLT hltinfo(unsigned int idx) const;
0129 size_t nTriggerLine() const;
0130 size_t nHLTPath() const;
0131
0132 float avgInsRecLumi() const;
0133
0134 float avgInsRecLumiErr() const;
0135
0136 float intgRecLumi() const;
0137 bool isProductEqual(LumiSummary const& next) const;
0138
0139
0140
0141
0142 std::string lumiVersion() const;
0143
0144
0145
0146 void setLumiVersion(const std::string& lumiversion);
0147 void setLumiData(float instlumi, float instlumierr, short lumiquality);
0148 void setDeadCount(unsigned long long deadcount);
0149 void setBitZeroCount(unsigned long long bitzerocount);
0150 void setlsnumber(unsigned int lsnumber);
0151 void setOrbitData(unsigned int startorbit, unsigned int numorbit);
0152 void swapL1Data(std::vector<L1>& l1data);
0153 void swapHLTData(std::vector<HLT>& hltdata);
0154 void copyL1Data(const std::vector<L1>& l1data);
0155 void copyHLTData(const std::vector<HLT>& hltdata);
0156
0157 private:
0158 std::string lumiversion_;
0159
0160 float avginsdellumi_;
0161
0162 float avginsdellumierr_;
0163
0164 short lumisecqual_;
0165 unsigned long long deadcount_;
0166 unsigned long long bitzerocount_;
0167 unsigned int lsnumber_;
0168
0169 std::vector<HLT> hltdata_;
0170
0171 std::vector<L1> l1data_;
0172
0173 unsigned int startorbit_;
0174
0175 unsigned int numorbit_;
0176 };
0177
0178 std::ostream& operator<<(std::ostream& s, const LumiSummary& lumiSummary);
0179
0180 #endif