CMS 3D CMS Logo

LumiInfo.h
Go to the documentation of this file.
1 #ifndef DataFormats_Luminosity_LumiInfo_h
2 #define DataFormats_Luminosity_LumiInfo_h
3 
23 #include <vector>
24 #include <iosfwd>
25 #include <string>
27 
28 class LumiInfo {
29 public:
38  }
39 
43  LumiInfo(float deadtimeFraction, const std::vector<float>& instLumiByBX)
44  : deadtimeFraction_(deadtimeFraction), instLumiByBX_(instLumiByBX) {
48  }
49 
53  LumiInfo(float deadtimeFraction, const std::vector<float>& instLumiByBX, float totalInstLumi)
54  : deadtimeFraction_(deadtimeFraction), totalInstLuminosity_(totalInstLumi), instLumiByBX_(instLumiByBX) {
57  }
58 
62  LumiInfo(float deadtimeFraction,
63  const std::vector<float>& instLumiByBX,
64  float totalInstLumi,
65  const std::vector<float>& instLumiErrByBX,
66  float totalInstLumiErr)
67  : deadtimeFraction_(deadtimeFraction),
68  totalInstLuminosity_(totalInstLumi),
69  totalInstLumiStatErr_(totalInstLumiErr),
70  instLumiByBX_(instLumiByBX),
71  instLumiStatErrByBX_(instLumiErrByBX) {}
72 
76  ~LumiInfo() {}
77 
78  //
79  // all getters
80  //
81 
85  float getTotalInstLumi() const { return totalInstLuminosity_; }
89  float getTotalInstStatError() const { return totalInstLumiStatErr_; }
93  const std::vector<float>& getInstLumiAllBX() const { return instLumiByBX_; }
97  const std::vector<float>& getErrorLumiAllBX() const { return instLumiStatErrByBX_; }
101  float getInstLumiBX(int bx) const { return instLumiByBX_.at(bx); }
105  float getDeadFraction() const { return deadtimeFraction_; }
109  float getLiveFraction() const { return 1 - deadtimeFraction_; }
110 
111  //
112  // all setters
113  //
114 
118  void setDeadFraction(float deadtimeFraction) { deadtimeFraction_ = deadtimeFraction; }
122  void setTotalInstLumi(float totalLumi) { totalInstLuminosity_ = totalLumi; }
126  void setTotalInstStatError(float statError) { totalInstLumiStatErr_ = statError; }
130  void setInstLumiAllBX(std::vector<float>& instLumiByBX);
134  void setErrorLumiAllBX(std::vector<float>& errLumiByBX);
135 
140  void setTotalInstToBXSum();
141 
146  float instLuminosityBXSum() const;
150  float integLuminosity() const;
155  float recordedLuminosity() const;
159  float lumiSectionLength() const;
164  bool isProductEqual(LumiInfo const& next) const;
165 
166 private:
170  std::vector<float> instLumiByBX_;
171  std::vector<float> instLumiStatErrByBX_;
172 };
173 
174 std::ostream& operator<<(std::ostream& s, const LumiInfo& lumiInfo);
175 
176 #endif // DataFormats_Luminosity_LumiInfo_h
LumiInfo
Definition: LumiInfo.h:28
LumiConstants::numBX
static const unsigned int numBX
Definition: LumiConstants.h:8
pileupCalc.lumiInfo
lumiInfo
Definition: pileupCalc.py:236
LumiInfo::setDeadFraction
void setDeadFraction(float deadtimeFraction)
Definition: LumiInfo.h:118
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
LumiInfo::getInstLumiBX
float getInstLumiBX(int bx) const
Definition: LumiInfo.h:101
LumiInfo::LumiInfo
LumiInfo()
Definition: LumiInfo.h:33
LumiConstants.h
LumiInfo::deadtimeFraction_
float deadtimeFraction_
Definition: LumiInfo.h:167
LumiInfo::getLiveFraction
float getLiveFraction() const
Definition: LumiInfo.h:109
LumiInfo::LumiInfo
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX)
Definition: LumiInfo.h:43
LumiInfo::~LumiInfo
~LumiInfo()
Definition: LumiInfo.h:76
LumiInfo::setTotalInstLumi
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:122
alignCSCRings.s
s
Definition: alignCSCRings.py:92
LumiInfo::totalInstLuminosity_
float totalInstLuminosity_
Definition: LumiInfo.h:168
LumiInfo::setInstLumiAllBX
void setInstLumiAllBX(std::vector< float > &instLumiByBX)
Definition: LumiInfo.cc:31
LumiInfo::getDeadFraction
float getDeadFraction() const
Definition: LumiInfo.h:105
LumiInfo::getTotalInstLumi
float getTotalInstLumi() const
Definition: LumiInfo.h:85
LumiInfo::integLuminosity
float integLuminosity() const
Definition: LumiInfo.cc:16
LumiInfo::lumiSectionLength
float lumiSectionLength() const
Definition: LumiInfo.cc:22
LumiInfo::totalInstLumiStatErr_
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
LumiInfo::recordedLuminosity
float recordedLuminosity() const
Definition: LumiInfo.cc:20
LumiInfo::LumiInfo
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi, const std::vector< float > &instLumiErrByBX, float totalInstLumiErr)
Definition: LumiInfo.h:62
LumiInfo::getInstLumiAllBX
const std::vector< float > & getInstLumiAllBX() const
Definition: LumiInfo.h:93
LumiInfo::isProductEqual
bool isProductEqual(LumiInfo const &next) const
Definition: LumiInfo.cc:27
LumiInfo::setTotalInstToBXSum
void setTotalInstToBXSum()
Definition: LumiInfo.cc:18
LumiInfo::setTotalInstStatError
void setTotalInstStatError(float statError)
Definition: LumiInfo.h:126
LumiInfo::instLumiByBX_
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170
LumiInfo::instLumiStatErrByBX_
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
LumiInfo::getTotalInstStatError
float getTotalInstStatError() const
Definition: LumiInfo.h:89
LumiInfo::getErrorLumiAllBX
const std::vector< float > & getErrorLumiAllBX() const
Definition: LumiInfo.h:97
LumiInfo::LumiInfo
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi)
Definition: LumiInfo.h:53
LumiInfo::instLuminosityBXSum
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
operator<<
std::ostream & operator<<(std::ostream &s, const LumiInfo &lumiInfo)
Definition: LumiInfo.cc:39
LumiInfo::setErrorLumiAllBX
void setErrorLumiAllBX(std::vector< float > &errLumiByBX)
Definition: LumiInfo.cc:35
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31