CMS 3D CMS Logo

LumiInfo.cc
Go to the documentation of this file.
2 
3 #include <vector>
4 #include <iomanip>
5 #include <ostream>
6 #include <iostream>
7 
9  float totLum = 0;
10  for (std::vector<float>::const_iterator it = instLumiByBX_.begin(); it != instLumiByBX_.end(); ++it) {
11  totLum += *it;
12  }
13  return totLum;
14 }
15 
17 
19 
21 
23  // numorbits (262144)*numBX/orbit (3564)*bx spacing (24.95e-09)
25 }
26 
29 }
30 
31 void LumiInfo::setInstLumiAllBX(std::vector<float>& instLumiByBX) {
32  instLumiByBX_.assign(instLumiByBX.begin(), instLumiByBX.end());
33 }
34 
35 void LumiInfo::setErrorLumiAllBX(std::vector<float>& errLumiByBX) {
36  instLumiStatErrByBX_.assign(errLumiByBX.begin(), errLumiByBX.end());
37 }
38 
39 std::ostream& operator<<(std::ostream& s, const LumiInfo& lumiInfo) {
40  s << "\nDumping LumiInfo\n\n";
41  s << " getTotalInstLumi = " << lumiInfo.getTotalInstLumi() << "\n";
42  s << " integLuminosity = " << lumiInfo.integLuminosity() << "\n";
43  s << " recordedLuminosity = " << lumiInfo.recordedLuminosity() << "\n";
44  s << " deadtimeFraction = " << lumiInfo.getDeadFraction() << "\n";
45  s << " instLumiByBX = ";
46  const std::vector<float>& lumiBX = lumiInfo.getInstLumiAllBX();
47  for (unsigned int i = 0; i < 10 && i < lumiBX.size(); ++i) {
48  s << lumiBX.at(i) << " ";
49  }
50  s << " ...\n";
51 
52  return s << "\n";
53 }
float getTotalInstLumi() const
Definition: LumiInfo.h:85
bool isProductEqual(LumiInfo const &next) const
Definition: LumiInfo.cc:27
float recordedLuminosity() const
Definition: LumiInfo.cc:20
float lumiSectionLength() const
Definition: LumiInfo.cc:22
static const unsigned int numOrbits
Definition: LumiConstants.h:7
static const unsigned int numBX
Definition: LumiConstants.h:8
void setInstLumiAllBX(std::vector< float > &instLumiByBX)
Definition: LumiInfo.cc:31
void setTotalInstToBXSum()
Definition: LumiInfo.cc:18
float integLuminosity() const
Definition: LumiInfo.cc:16
std::ostream & operator<<(std::ostream &s, const LumiInfo &lumiInfo)
Definition: LumiInfo.cc:39
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:122
static const float bxSpacingExact
Definition: LumiConstants.h:9
const std::vector< float > & getInstLumiAllBX() const
Definition: LumiInfo.h:93
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
float deadtimeFraction_
Definition: LumiInfo.h:167
float getDeadFraction() const
Definition: LumiInfo.h:105
void setErrorLumiAllBX(std::vector< float > &errLumiByBX)
Definition: LumiInfo.cc:35
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170