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
float getLiveFraction() const
Definition: LumiInfo.h:109
float totalInstLuminosity_
Definition: LumiInfo.h:168
float getTotalInstStatError() const
Definition: LumiInfo.h:89
bool isProductEqual(LumiInfo const &next) const
Definition: LumiInfo.cc:27
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
static const unsigned int numBX
Definition: LumiConstants.h:8
const std::vector< float > & getInstLumiAllBX() const
Definition: LumiInfo.h:93
void setInstLumiAllBX(std::vector< float > &instLumiByBX)
Definition: LumiInfo.cc:31
~LumiInfo()
Definition: LumiInfo.h:76
float getInstLumiBX(int bx) const
Definition: LumiInfo.h:101
void setTotalInstToBXSum()
Definition: LumiInfo.cc:18
const std::vector< float > & getErrorLumiAllBX() const
Definition: LumiInfo.h:97
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:122
LumiInfo()
Definition: LumiInfo.h:33
float totalInstLumiStatErr_
Definition: LumiInfo.h:169
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi, const std::vector< float > &instLumiErrByBX, float totalInstLumiErr)
Definition: LumiInfo.h:62
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi)
Definition: LumiInfo.h:53
void setTotalInstStatError(float statError)
Definition: LumiInfo.h:126
float deadtimeFraction_
Definition: LumiInfo.h:167
void setDeadFraction(float deadtimeFraction)
Definition: LumiInfo.h:118
float lumiSectionLength() const
Definition: LumiInfo.cc:22
float integLuminosity() const
Definition: LumiInfo.cc:16
void setErrorLumiAllBX(std::vector< float > &errLumiByBX)
Definition: LumiInfo.cc:35
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX)
Definition: LumiInfo.h:43
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:171
float getDeadFraction() const
Definition: LumiInfo.h:105
std::ostream & operator<<(std::ostream &s, const LumiInfo &lumiInfo)
Definition: LumiInfo.cc:39
float getTotalInstLumi() const
Definition: LumiInfo.h:85
float recordedLuminosity() const
Definition: LumiInfo.cc:20
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:170