CMS 3D CMS Logo

LumiSummary.cc
Go to the documentation of this file.
1 
2 
4 
5 #include <iomanip>
6 #include <ostream>
7 #include <iostream>
9  size_t iIndex = lumiversion_.rfind('v');
10  //i.e. not "-1" and not "DIP", "-1" and "DIP" lumi are already corrected and unit conversion included in the raw data.
11  if (iIndex != std::string::npos) {
12  return avginsdellumi_ * 1000.0;
13  }
14  return avginsdellumi_;
15 }
16 float LumiSummary::intgDelLumi() const { return this->avgInsDelLumi() * float(this->lumiSectionLength()); }
18 float LumiSummary::intgRecLumi() const { return this->avgInsRecLumi() * float(this->lumiSectionLength()); }
19 short LumiSummary::lumiSecQual() const { return lumisecqual_; }
20 unsigned long long LumiSummary::deadcount() const { return deadcount_; }
21 unsigned long long LumiSummary::bitzerocount() const { return bitzerocount_; }
22 float LumiSummary::deadFrac() const {
23  //definition: deadcount/bitzerocount
24  //if no trigger data, return deadfraction 1.0,mask out this LS
25  //if bitzerocount=0, return -1.0 meaning no beam
26  if (lumiversion_ == "DIP") {
28  }
29  if (l1data_.empty())
30  return 1.0;
31  if (bitzerocount_ == 0)
32  return -1.0;
34 }
35 float LumiSummary::liveFrac() const {
36  //1-deadfraction
37  //else if deadfraction<0 meaning no beam, live fraction=0
38  //
39  if (deadFrac() < 0)
40  return 0;
41  return 1 - deadFrac();
42 }
44  //numorbits*3564*24.95e-09
45  return numorbit_ * 3564.0 * 24.95e-9;
46 }
47 unsigned int LumiSummary::lsNumber() const { return lsnumber_; }
48 unsigned int LumiSummary::startOrbit() const { return startorbit_; }
49 unsigned int LumiSummary::numOrbit() const { return numorbit_; }
50 bool LumiSummary::isValid() const { return avginsdellumi_ > 0; }
51 LumiSummary::L1 LumiSummary::l1info(unsigned int idx) const { return l1data_.at(idx); }
52 LumiSummary::HLT LumiSummary::hltinfo(unsigned int idx) const { return hltdata_.at(idx); }
53 size_t LumiSummary::nTriggerLine() const { return l1data_.size(); }
54 size_t LumiSummary::nHLTPath() const { return hltdata_.size(); }
55 float LumiSummary::avgInsRecLumi() const { return this->avgInsDelLumi() * liveFrac(); }
58  return (avginsdellumi_ == next.avginsdellumi_ && avginsdellumierr_ == next.avginsdellumierr_ &&
59  lumisecqual_ == next.lumisecqual_ && deadcount_ == next.deadcount_ && lsnumber_ == next.lsnumber_ &&
60  startorbit_ == next.startorbit_ && numorbit_ == next.numorbit_ && l1data_.size() == next.l1data_.size() &&
61  hltdata_.size() == next.hltdata_.size() && lumiversion_ == next.lumiversion_);
62 }
65 void LumiSummary::setLumiData(float instlumi, float instlumierr, short lumiquality) {
66  avginsdellumi_ = instlumi;
67  avginsdellumierr_ = instlumierr;
68  lumisecqual_ = lumiquality;
69 }
70 void LumiSummary::setDeadCount(unsigned long long deadcount) { deadcount_ = deadcount; }
71 void LumiSummary::setBitZeroCount(unsigned long long bitzerocount) { bitzerocount_ = bitzerocount; }
72 void LumiSummary::setlsnumber(unsigned int lsnumber) { lsnumber_ = lsnumber; }
73 void LumiSummary::setOrbitData(unsigned int startorbit, unsigned int numorbit) {
74  startorbit_ = startorbit;
75  numorbit_ = numorbit;
76 }
77 void LumiSummary::swapL1Data(std::vector<L1>& l1data) { l1data_.swap(l1data); }
78 void LumiSummary::swapHLTData(std::vector<HLT>& hltdata) { hltdata_.swap(hltdata); }
79 void LumiSummary::copyL1Data(const std::vector<L1>& l1data) { l1data_.assign(l1data.begin(), l1data.end()); }
80 void LumiSummary::copyHLTData(const std::vector<HLT>& hltdata) { hltdata_.assign(hltdata.begin(), hltdata.end()); }
81 std::ostream& operator<<(std::ostream& s, const LumiSummary& lumiSummary) {
82  s << "\nDumping LumiSummary\n\n";
83  if (!lumiSummary.isValid()) {
84  s << " === Invalid Lumi values === \n";
85  }
86  s << " lumiVersion = " << lumiSummary.lumiVersion() << "\n";
87  s << " avgInsDelLumi = " << lumiSummary.avgInsDelLumi() << "\n";
88  s << " avgIntgDelLumi = " << lumiSummary.intgDelLumi() << "\n";
89  s << " avgInsDelLumiErr = " << lumiSummary.avgInsDelLumiErr() << "\n";
90  s << " lumiSecQual = " << lumiSummary.lumiSecQual() << "\n";
91  s << " deadCount = " << lumiSummary.deadcount() << "\n";
92  s << " bitZeroCount = " << lumiSummary.bitzerocount() << "\n";
93  s << " deadFrac = " << (float)lumiSummary.deadFrac() << "\n";
94  s << " liveFrac = " << (float)lumiSummary.liveFrac() << "\n";
95  s << " lsNumber = " << lumiSummary.lsNumber() << "\n";
96  s << " startOrbit = " << lumiSummary.startOrbit() << "\n";
97  s << " numOrbit = " << lumiSummary.numOrbit() << "\n";
98  s << " avgInsRecLumi = " << lumiSummary.avgInsRecLumi() << "\n";
99  s << " avgInsRecLumiErr = " << lumiSummary.avgInsRecLumiErr() << "\n\n";
100  s << std::setw(15) << "l1nameidx";
101  s << std::setw(15) << "l1prescale";
102  s << "\n";
103  size_t nTriggers = lumiSummary.nTriggerLine();
104  size_t nHLTPath = lumiSummary.nHLTPath();
105  for (unsigned int i = 0; i < nTriggers; ++i) {
106  s << std::setw(15);
107  s << lumiSummary.l1info(i).triggernameidx;
108  s << std::setw(15);
109  s << lumiSummary.l1info(i).prescale;
110  s << "\n";
111  }
112  s << std::setw(15) << "hltpathidx";
113  s << std::setw(15) << "hltprescale";
114  s << "\n";
115  for (unsigned int i = 0; i < nHLTPath; ++i) {
116  s << std::setw(15);
117  s << lumiSummary.hltinfo(i).pathnameidx;
118  s << std::setw(15);
119  s << lumiSummary.hltinfo(i).prescale;
120  s << "\n";
121  }
122  return s << "\n";
123 }
LumiSummary::nHLTPath
size_t nHLTPath() const
Definition: LumiSummary.cc:54
LumiSummary::deadFrac
float deadFrac() const
Definition: LumiSummary.cc:22
LumiSummary::intgDelLumi
float intgDelLumi() const
Definition: LumiSummary.cc:16
FastTimerService_cff.lumiversion
lumiversion
Definition: FastTimerService_cff.py:13
LumiSummary::numOrbit
unsigned int numOrbit() const
Definition: LumiSummary.cc:49
operator<<
std::ostream & operator<<(std::ostream &s, const LumiSummary &lumiSummary)
Definition: LumiSummary.cc:81
LumiSummary::lumiversion_
std::string lumiversion_
Definition: LumiSummary.h:158
mps_fire.i
i
Definition: mps_fire.py:428
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
LumiSummary::hltinfo
HLT hltinfo(unsigned int idx) const
Definition: LumiSummary.cc:52
LumiSummary::lumiSectionLength
float lumiSectionLength() const
Definition: LumiSummary.cc:43
LumiSummary::bitzerocount
unsigned long long bitzerocount() const
Definition: LumiSummary.cc:21
LumiSummary::isProductEqual
bool isProductEqual(LumiSummary const &next) const
Definition: LumiSummary.cc:57
LumiSummary::setOrbitData
void setOrbitData(unsigned int startorbit, unsigned int numorbit)
Definition: LumiSummary.cc:73
LumiSummary::avgInsDelLumi
float avgInsDelLumi() const
Definition: LumiSummary.cc:8
LumiSummary::deadcount
unsigned long long deadcount() const
Definition: LumiSummary.cc:20
LumiSummary::avgInsDelLumiErr
float avgInsDelLumiErr() const
Definition: LumiSummary.cc:17
LumiSummary::swapHLTData
void swapHLTData(std::vector< HLT > &hltdata)
Definition: LumiSummary.cc:78
LumiSummary::liveFrac
float liveFrac() const
Definition: LumiSummary.cc:35
LumiSummary::L1
Definition: LumiSummary.h:22
LumiSummary::hltdata_
std::vector< HLT > hltdata_
Definition: LumiSummary.h:169
LumiSummary::avginsdellumierr_
float avginsdellumierr_
Definition: LumiSummary.h:162
LumiSummary::setlsnumber
void setlsnumber(unsigned int lsnumber)
Definition: LumiSummary.cc:72
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
LumiSummary::isValid
bool isValid() const
Definition: LumiSummary.cc:50
LumiSummary::nTriggerLine
size_t nTriggerLine() const
Definition: LumiSummary.cc:53
alignCSCRings.s
s
Definition: alignCSCRings.py:92
LumiSummary::lumiSecQual
short lumiSecQual() const
Definition: LumiSummary.cc:19
LumiSummary::setLumiData
void setLumiData(float instlumi, float instlumierr, short lumiquality)
Definition: LumiSummary.cc:65
LumiSummary::copyL1Data
void copyL1Data(const std::vector< L1 > &l1data)
Definition: LumiSummary.cc:79
LumiSummary
Definition: LumiSummary.h:20
LumiSummary::copyHLTData
void copyHLTData(const std::vector< HLT > &hltdata)
Definition: LumiSummary.cc:80
LumiSummary::avgInsRecLumi
float avgInsRecLumi() const
Definition: LumiSummary.cc:55
LumiSummary::startOrbit
unsigned int startOrbit() const
Definition: LumiSummary.cc:48
LumiSummary::setLumiVersion
void setLumiVersion(const std::string &lumiversion)
Definition: LumiSummary.cc:64
LumiSummary::swapL1Data
void swapL1Data(std::vector< L1 > &l1data)
Definition: LumiSummary.cc:77
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LumiSummary::setDeadCount
void setDeadCount(unsigned long long deadcount)
Definition: LumiSummary.cc:70
LumiSummary::avginsdellumi_
float avginsdellumi_
Definition: LumiSummary.h:160
LumiSummary::numorbit_
unsigned int numorbit_
Definition: LumiSummary.h:175
LumiSummary::lumisecqual_
short lumisecqual_
Definition: LumiSummary.h:164
LumiSummary::intgRecLumi
float intgRecLumi() const
Definition: LumiSummary.cc:18
LumiSummary::lsNumber
unsigned int lsNumber() const
Definition: LumiSummary.cc:47
LumiSummary::setBitZeroCount
void setBitZeroCount(unsigned long long bitzerocount)
Definition: LumiSummary.cc:71
bphysicsOniaDQM_cfi.lumiSummary
lumiSummary
Definition: bphysicsOniaDQM_cfi.py:8
LumiSummary::l1data_
std::vector< L1 > l1data_
Definition: LumiSummary.h:171
LumiSummary::lsnumber_
unsigned int lsnumber_
Definition: LumiSummary.h:167
LumiSummary.h
LumiSummary::bitzerocount_
unsigned long long bitzerocount_
Definition: LumiSummary.h:166
LumiSummary::HLT
Definition: LumiSummary.h:28
LumiSummary::avgInsRecLumiErr
float avgInsRecLumiErr() const
Definition: LumiSummary.cc:56
LumiSummary::deadcount_
unsigned long long deadcount_
Definition: LumiSummary.h:165
LumiSummary::startorbit_
unsigned int startorbit_
Definition: LumiSummary.h:173
LumiSummary::l1info
L1 l1info(unsigned int idx) const
Definition: LumiSummary.cc:51
LumiSummary::lumiVersion
std::string lumiVersion() const
Definition: LumiSummary.cc:63
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31