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:
35  {
40  }
41 
42 
46  LumiInfo(float deadtimeFraction, const std::vector<float>& instLumiByBX):
47  deadtimeFraction_(deadtimeFraction),
48  instLumiByBX_(instLumiByBX)
49  {
53  }
54 
58  LumiInfo(float deadtimeFraction, const std::vector<float>& instLumiByBX, float totalInstLumi):
59  deadtimeFraction_(deadtimeFraction),
60  totalInstLuminosity_(totalInstLumi),
61  instLumiByBX_(instLumiByBX)
62  {
65  }
66 
70  LumiInfo(float deadtimeFraction, const std::vector<float>& instLumiByBX, float totalInstLumi,
71  const std::vector<float>& instLumiErrByBX, float totalInstLumiErr):
72  deadtimeFraction_(deadtimeFraction),
73  totalInstLuminosity_(totalInstLumi),
74  totalInstLumiStatErr_(totalInstLumiErr),
75  instLumiByBX_(instLumiByBX),
76  instLumiStatErrByBX_(instLumiErrByBX)
77  {
78  }
79 
84 
85  //
86  // all getters
87  //
88 
92  float getTotalInstLumi() const{return totalInstLuminosity_;}
100  const std::vector<float>& getInstLumiAllBX() const { return instLumiByBX_; }
104  const std::vector<float>& getErrorLumiAllBX() const { return instLumiStatErrByBX_; }
108  float getInstLumiBX(int bx) const { return instLumiByBX_.at(bx); }
112  float getDeadFraction() const { return deadtimeFraction_; }
116  float getLiveFraction() const { return 1-deadtimeFraction_; }
117 
118 
119  //
120  // all setters
121  //
122 
126  void setDeadFraction(float deadtimeFraction) { deadtimeFraction_ = deadtimeFraction; }
130  void setTotalInstLumi(float totalLumi){ totalInstLuminosity_=totalLumi;}
134  void setTotalInstStatError(float statError){ totalInstLumiStatErr_=statError;}
138  void setInstLumiAllBX(std::vector<float>& instLumiByBX);
142  void setErrorLumiAllBX(std::vector<float>& errLumiByBX);
143 
144 
149  void setTotalInstToBXSum() ;
150 
151 
156  float instLuminosityBXSum() const;
160  float integLuminosity() const;
165  float recordedLuminosity() const;
169  float lumiSectionLength() const;
174  bool isProductEqual(LumiInfo const& next) const;
175 
176  private:
180  std::vector<float> instLumiByBX_;
181  std::vector<float> instLumiStatErrByBX_;
182 };
183 
184 std::ostream& operator<<(std::ostream& s, const LumiInfo& lumiInfo);
185 
186 #endif // DataFormats_Luminosity_LumiInfo_h
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 totalInstLuminosity_
Definition: LumiInfo.h:178
float getTotalInstStatError() const
Definition: LumiInfo.h:96
float lumiSectionLength() const
Definition: LumiInfo.cc:29
static const unsigned int numBX
Definition: LumiConstants.h:9
const std::vector< float > & getErrorLumiAllBX() const
Definition: LumiInfo.h:104
void setInstLumiAllBX(std::vector< float > &instLumiByBX)
Definition: LumiInfo.cc:39
~LumiInfo()
Definition: LumiInfo.h:83
void setTotalInstToBXSum()
Definition: LumiInfo.cc:21
float integLuminosity() const
Definition: LumiInfo.cc:17
void setTotalInstLumi(float totalLumi)
Definition: LumiInfo.h:130
LumiInfo()
Definition: LumiInfo.h:33
const std::vector< float > & getInstLumiAllBX() const
Definition: LumiInfo.h:100
float totalInstLumiStatErr_
Definition: LumiInfo.h:179
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi, const std::vector< float > &instLumiErrByBX, float totalInstLumiErr)
Definition: LumiInfo.h:70
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX, float totalInstLumi)
Definition: LumiInfo.h:58
float instLuminosityBXSum() const
Definition: LumiInfo.cc:8
void setTotalInstStatError(float statError)
Definition: LumiInfo.h:134
float deadtimeFraction_
Definition: LumiInfo.h:177
float getLiveFraction() const
Definition: LumiInfo.h:116
float getInstLumiBX(int bx) const
Definition: LumiInfo.h:108
void setDeadFraction(float deadtimeFraction)
Definition: LumiInfo.h:126
float getDeadFraction() const
Definition: LumiInfo.h:112
void setErrorLumiAllBX(std::vector< float > &errLumiByBX)
Definition: LumiInfo.cc:43
LumiInfo(float deadtimeFraction, const std::vector< float > &instLumiByBX)
Definition: LumiInfo.h:46
std::vector< float > instLumiStatErrByBX_
Definition: LumiInfo.h:181
std::ostream & operator<<(std::ostream &s, const LumiInfo &lumiInfo)
Definition: LumiInfo.cc:47
std::vector< float > instLumiByBX_
Definition: LumiInfo.h:180