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>
8 float
10  size_t iIndex=lumiversion_.rfind("v");
11  if(iIndex != std::string::npos){//i.e. not "-1" and not "DIP", "-1" and "DIP" lumi are already corrected and unit conversion included in the raw data.
12  return avginsdellumi_*1000.0;
13  }
14  return avginsdellumi_;
15 }
16 float
18  return this->avgInsDelLumi()*float(this->lumiSectionLength());
19 }
20 float
22  return avginsdellumierr_;
23 }
24 float
26  return this->avgInsRecLumi()*float(this->lumiSectionLength());
27 }
28 short
30  return lumisecqual_;
31 }
32 unsigned long long
34  return deadcount_;
35 }
36 unsigned long long
38  return bitzerocount_;
39 }
40 float
42  //definition: deadcount/bitzerocount
43  //if no trigger data, return deadfraction 1.0,mask out this LS
44  //if bitzerocount=0, return -1.0 meaning no beam
45  if(lumiversion_=="DIP"){
47  }
48  if (l1data_.empty()) return 1.0;
49  if (bitzerocount_==0) return -1.0;
51 }
52 float
54  //1-deadfraction
55  //else if deadfraction<0 meaning no beam, live fraction=0
56  //
57  if (deadFrac()<0) return 0;
58  return 1-deadFrac();
59 }
60 float
62  //numorbits*3564*24.95e-09
63  return numorbit_*3564.0*24.95e-9;
64 }
65 unsigned int
67  return lsnumber_;
68 }
69 unsigned int
71  return startorbit_;
72 }
73 unsigned int
75  return numorbit_;
76 }
77 bool
79  return avginsdellumi_>0;
80 }
82 LumiSummary::l1info(unsigned int idx)const{
83  return l1data_.at(idx);
84 }
86 LumiSummary::hltinfo(unsigned int idx) const {
87  return hltdata_.at(idx);
88 }
89 size_t
91  return l1data_.size();
92 }
93 size_t
95  return hltdata_.size();
96 }
97 float
99  return this->avgInsDelLumi() * liveFrac();
100 }
101 float
103  return avginsdellumierr_ * liveFrac();
104 }
105 bool
107  return (avginsdellumi_ == next.avginsdellumi_ &&
109  lumisecqual_ == next.lumisecqual_ &&
110  deadcount_ == next.deadcount_ &&
111  lsnumber_ == next.lsnumber_ &&
112  startorbit_== next.startorbit_ &&
113  numorbit_==next.numorbit_&&
114  l1data_.size() == next.l1data_.size() &&
115  hltdata_.size() == next.hltdata_.size() &&
116  lumiversion_ == next.lumiversion_ );
117 }
120  return lumiversion_;
121 }
122 void
125 }
126 void
127 LumiSummary::setLumiData(float instlumi,float instlumierr,short lumiquality){
128  avginsdellumi_=instlumi;
129  avginsdellumierr_=instlumierr;
130  lumisecqual_=lumiquality;
131 }
132 void
135 }
136 void
139 }
140 void
141 LumiSummary::setlsnumber(unsigned int lsnumber){
142  lsnumber_=lsnumber;
143 }
144 void
145 LumiSummary::setOrbitData(unsigned int startorbit,unsigned int numorbit){
146  startorbit_=startorbit;
147  numorbit_=numorbit;
148 }
149 void
150 LumiSummary::swapL1Data(std::vector<L1>& l1data){
151  l1data_.swap(l1data);
152 }
153 void
155  hltdata_.swap(hltdata);
156 }
157 void
158 LumiSummary::copyL1Data(const std::vector<L1>& l1data){
159  l1data_.assign(l1data.begin(),l1data.end());
160 }
161 void
162 LumiSummary::copyHLTData(const std::vector<HLT>& hltdata){
163  hltdata_.assign(hltdata.begin(),hltdata.end());
164 }
165 std::ostream& operator<<(std::ostream& s, const LumiSummary& lumiSummary) {
166  s << "\nDumping LumiSummary\n\n";
167  if(!lumiSummary.isValid()){
168  s << " === Invalid Lumi values === \n";
169  }
170  s << " lumiVersion = " << lumiSummary.lumiVersion() << "\n";
171  s << " avgInsDelLumi = " << lumiSummary.avgInsDelLumi() << "\n";
172  s << " avgIntgDelLumi = " << lumiSummary.intgDelLumi() <<"\n";
173  s << " avgInsDelLumiErr = " << lumiSummary.avgInsDelLumiErr() << "\n";
174  s << " lumiSecQual = " << lumiSummary.lumiSecQual() << "\n";
175  s << " deadCount = " << lumiSummary.deadcount() << "\n";
176  s << " bitZeroCount = " << lumiSummary.bitzerocount() << "\n";
177  s << " deadFrac = " << (float)lumiSummary.deadFrac() << "\n";
178  s << " liveFrac = " << (float)lumiSummary.liveFrac() << "\n";
179  s << " lsNumber = " << lumiSummary.lsNumber() << "\n";
180  s << " startOrbit = " << lumiSummary.startOrbit() <<"\n";
181  s << " numOrbit = " << lumiSummary.numOrbit() <<"\n";
182  s << " avgInsRecLumi = " << lumiSummary.avgInsRecLumi() << "\n";
183  s << " avgInsRecLumiErr = " << lumiSummary.avgInsRecLumiErr() << "\n\n";
184  s << std::setw(15) << "l1nameidx";
185  s << std::setw(15) << "l1prescale";
186  s << "\n";
187  size_t nTriggers=lumiSummary.nTriggerLine();
188  size_t nHLTPath=lumiSummary.nHLTPath();
189  for(unsigned int i = 0; i < nTriggers; ++i) {
190  s << std::setw(15);
191  s << lumiSummary.l1info(i).triggernameidx;
192  s << std::setw(15);
193  s << lumiSummary.l1info(i).prescale;
194  s<<"\n";
195  }
196  s << std::setw(15) << "hltpathidx";
197  s << std::setw(15) << "hltprescale";
198  s << "\n";
199  for(unsigned int i = 0; i < nHLTPath; ++i) {
200  s << std::setw(15);
201  s << lumiSummary.hltinfo(i).pathnameidx;
202  s << std::setw(15);
203  s << lumiSummary.hltinfo(i).prescale;
204  s << "\n";
205  }
206  return s << "\n";
207 }
unsigned long long bitzerocount_
Definition: LumiSummary.h:164
unsigned int startOrbit() const
Definition: LumiSummary.cc:70
std::ostream & operator<<(std::ostream &s, const LumiSummary &lumiSummary)
Definition: LumiSummary.cc:165
L1 l1info(unsigned int idx) const
Definition: LumiSummary.cc:82
void swapHLTData(std::vector< HLT > &hltdata)
Definition: LumiSummary.cc:154
float lumiSectionLength() const
Definition: LumiSummary.cc:61
unsigned int startorbit_
Definition: LumiSummary.h:171
unsigned long long deadcount() const
Definition: LumiSummary.cc:33
float avgInsRecLumi() const
Definition: LumiSummary.cc:98
float intgRecLumi() const
Definition: LumiSummary.cc:25
void setlsnumber(unsigned int lsnumber)
Definition: LumiSummary.cc:141
unsigned int lsnumber_
Definition: LumiSummary.h:165
std::vector< L1 > l1data_
Definition: LumiSummary.h:169
unsigned int prescale
Definition: LumiSummary.h:26
bool isProductEqual(LumiSummary const &next) const
Definition: LumiSummary.cc:106
void setOrbitData(unsigned int startorbit, unsigned int numorbit)
Definition: LumiSummary.cc:145
float intgDelLumi() const
Definition: LumiSummary.cc:17
def lumiSummary(schema, nlumils)
unsigned int lsNumber() const
Definition: LumiSummary.cc:66
void copyL1Data(const std::vector< L1 > &l1data)
Definition: LumiSummary.cc:158
float avginsdellumierr_
Definition: LumiSummary.h:160
unsigned int numOrbit() const
Definition: LumiSummary.cc:74
float avgInsRecLumiErr() const
Definition: LumiSummary.cc:102
float avgInsDelLumi() const
Definition: LumiSummary.cc:9
float avgInsDelLumiErr() const
Definition: LumiSummary.cc:21
float liveFrac() const
Definition: LumiSummary.cc:53
void setLumiVersion(const std::string &lumiversion)
Definition: LumiSummary.cc:123
std::string lumiversion_
Definition: LumiSummary.h:156
void setLumiData(float instlumi, float instlumierr, short lumiquality)
Definition: LumiSummary.cc:127
void setBitZeroCount(unsigned long long bitzerocount)
Definition: LumiSummary.cc:137
void copyHLTData(const std::vector< HLT > &hltdata)
Definition: LumiSummary.cc:162
void setDeadCount(unsigned long long deadcount)
Definition: LumiSummary.cc:133
size_t nTriggerLine() const
Definition: LumiSummary.cc:90
short lumisecqual_
Definition: LumiSummary.h:162
void swapL1Data(std::vector< L1 > &l1data)
Definition: LumiSummary.cc:150
HLT hltinfo(unsigned int idx) const
Definition: LumiSummary.cc:86
unsigned int numorbit_
Definition: LumiSummary.h:173
std::string lumiVersion() const
Definition: LumiSummary.cc:119
unsigned long long deadcount_
Definition: LumiSummary.h:163
float avginsdellumi_
Definition: LumiSummary.h:158
size_t nHLTPath() const
Definition: LumiSummary.cc:94
float deadFrac() const
Definition: LumiSummary.cc:41
bool isValid() const
Definition: LumiSummary.cc:78
std::vector< HLT > hltdata_
Definition: LumiSummary.h:167
unsigned long long bitzerocount() const
Definition: LumiSummary.cc:37
short lumiSecQual() const
Definition: LumiSummary.cc:29
unsigned int prescale
Definition: LumiSummary.h:32