CMS 3D CMS Logo

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];
12  b1 = (double)pars[1];
13  a2 = (double)pars[2];
14  }
15 
16  // for Reco
17  inline double getRecoCorrectionFactor(double inpixelsfired) const {
18  double x = inpixelsfired;
19  return (a2 * x * x + b1 * x + c0);
20  }
21 
22  // for Sim
23  int getPixelsFired(int inpes) const;
24 
25 private:
26  // quadratic coefficients
27  double a2, b1, c0;
28 };
29 
30 #endif
double getRecoCorrectionFactor(double inpixelsfired) const
assert(be >=bs)
int getPixelsFired(int inpes) const
HcalSiPMnonlinearity(const std::vector< float > &pars)