CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalSiPMnonlinearity.h
Go to the documentation of this file.
1 #ifndef CALIBCALORIMETRY_HCALALGOS_HCALSIPMNONLINEARITY_H
2 #define CALIBCALORIMETRY_HCALALGOS_HCALSIPMNONLINEARITY_H 1
3 
4 #include <vector>
5 #include <cassert>
6 
8 public:
9  HcalSiPMnonlinearity(const std::vector<float>& pars) {
10  assert (pars.size() == 3);
11  c0=(double)pars[0]; b1=(double)pars[1]; a2=(double)pars[2];
12  }
13 
14  // for Reco
15  inline double getRecoCorrectionFactor(double inpixelsfired) const {
16  double x=inpixelsfired; return (a2*x*x + b1*x + c0);
17  }
18 
19  // for Sim
20  int getPixelsFired(int inpes) const;
21 
22 private:
23  // quadratic coefficients
24  double a2,b1,c0;
25 };
26 
27 #endif
assert(m_qm.get())
int getPixelsFired(int inpes) const
double getRecoCorrectionFactor(double inpixelsfired) const
HcalSiPMnonlinearity(const std::vector< float > &pars)