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();
11  it != instLumiByBX_.end(); ++it) {
12  totLum += *it;
13  }
14  return totLum;
15 }
16 
19 }
20 
23 }
24 
27 }
28 
30  // numorbits (262144)*numBX/orbit (3564)*bx spacing (24.95e-09)
32 }
33 
35  return (deadtimeFraction_ == next.deadtimeFraction_ &&
37 }
38 
39 void LumiInfo::setInstLumiAllBX(std::vector<float>& instLumiByBX) {
40  instLumiByBX_.assign(instLumiByBX.begin(), instLumiByBX.end());
41 }
42 
43 void LumiInfo::setErrorLumiAllBX(std::vector<float>& errLumiByBX){
44  instLumiStatErrByBX_.assign(errLumiByBX.begin(),errLumiByBX.end());
45 }
46 
47 std::ostream& operator<<(std::ostream& s, const LumiInfo& lumiInfo) {
48  s << "\nDumping LumiInfo\n\n";
49  s << " getTotalInstLumi = " << lumiInfo.getTotalInstLumi() << "\n";
50  s << " integLuminosity = " << lumiInfo.integLuminosity() << "\n";
51  s << " recordedLuminosity = " << lumiInfo.recordedLuminosity() << "\n";
52  s << " deadtimeFraction = " << lumiInfo.getDeadFraction() << "\n";
53  s << " instLumiByBX = ";
54  const std::vector<float>& lumiBX = lumiInfo.getInstLumiAllBX();
55  for (unsigned int i=0; i<10 && i<lumiBX.size(); ++i) {
56  s << lumiBX.at(i) << " ";
57  }
58  s << " ...\n";
59 
60  return s << "\n";
61 }
float getTotalInstLumi() const
Definition: LumiInfo.h:92
bool isProductEqual(LumiInfo const &next) const
Definition: LumiInfo.cc:34
float recordedLuminosity() const
Definition: LumiInfo.cc:25
float lumiSectionLength() const
Definition: LumiInfo.cc:29
static const unsigned int numOrbits
Definition: LumiConstants.h:8
static const unsigned int numBX
Definition: LumiConstants.h:9
void setInstLumiAllBX(std::vector< float > &instLumiByBX)
Definition: LumiInfo.cc:39
void setTotalInstToBXSum()
Definition: LumiInfo.cc:21
float integLuminosity() const
Definition: LumiInfo.cc:17
std::ostream & operator<<(std::ostream &s, const LumiInfo &lumiInfo)
Definition: LumiInfo.cc:47
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:130
static const float bxSpacingExact
Definition: LumiConstants.h:10
const std::vector< float > & getInstLumiAllBX() const
Definition: LumiInfo.h:100
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
float deadtimeFraction_
Definition: LumiInfo.h:177
float getDeadFraction() const
Definition: LumiInfo.h:112
void setErrorLumiAllBX(std::vector< float > &errLumiByBX)
Definition: LumiInfo.cc:43
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180