Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:05

0001 #ifndef CALIBCALORIMETRY_HCALALGOS_HCALSIPMNONLINEARITY_H
0002 #define CALIBCALORIMETRY_HCALALGOS_HCALSIPMNONLINEARITY_H 1
0003 
0004 #include <vector>
0005 #include <cassert>
0006 
0007 class HcalSiPMnonlinearity {
0008 public:
0009   HcalSiPMnonlinearity(const std::vector<float>& pars) {
0010     assert(pars.size() == 3);
0011     c0 = (double)pars[0];
0012     b1 = (double)pars[1];
0013     a2 = (double)pars[2];
0014   }
0015 
0016   // for Reco
0017   inline double getRecoCorrectionFactor(double inpixelsfired) const {
0018     double x = inpixelsfired;
0019     return (a2 * x * x + b1 * x + c0);
0020   }
0021 
0022   // for Sim
0023   int getPixelsFired(int inpes) const;
0024 
0025 private:
0026   // quadratic coefficients
0027   double a2, b1, c0;
0028 };
0029 
0030 #endif