CMS 3D CMS Logo

PulseShapeFunctor.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_HcalRecAlgos_PulseShapeFunctor_h
2 #define RecoLocalCalo_HcalRecAlgos_PulseShapeFunctor_h
3 
5 
6 namespace HcalConst{
7 
8  constexpr int maxSamples = 10;
10  constexpr int nsPerBX = 25;
11  constexpr float iniTimeShift = 92.5f;
12  constexpr double invertnsPerBx = 0.04;
13  constexpr int shiftTS = 4;
14 
15 }
16 
17 namespace FitterFuncs{
18 
20  public:
21  PulseShapeFunctor(const HcalPulseShapes::Shape& pulse,bool iPedestalConstraint, bool iTimeConstraint,bool iAddPulseJitter,
22  double iPulseJitter,double iTimeMean,double iPedMean,
23  unsigned int nSamplesToFit);
25 
26  void EvalPulse(const double *pars);
27  double EvalPulseM2(const double *pars, const unsigned nPar);
28 
29  void setDefaultcntNANinfit(){ cntNANinfit =0; }
30  int getcntNANinfit(){ return cntNANinfit; }
31 
32  void setpsFitx(double *x ){ for(int i=0; i<HcalConst::maxSamples; ++i) psFit_x[i] = x[i]; }
33  void setpsFity(double *y ){ for(int i=0; i<HcalConst::maxSamples; ++i) psFit_y[i] = y[i]; }
34  void setpsFiterry (double *erry ){ for(int i=0; i<HcalConst::maxSamples; ++i) psFit_erry [i] = erry [i]; }
35  void setpsFiterry2(double *erry2 ){ for(int i=0; i<HcalConst::maxSamples; ++i) psFit_erry2 [i] = erry2[i]; }
36  void setpsFitslew (double *slew ){ for(int i=0; i<HcalConst::maxSamples; ++i) {psFit_slew [i] = slew [i]; } }
37  double getSiPMDarkCurrent(double darkCurrent, double fcByPE, double lambda);
38  void setinvertpedSig2(double x) { invertpedSig2_ = x; }
39  void setinverttimeSig2(double x) { inverttimeSig2_ = x; }
40 
41  void singlePulseShapeFuncMahi( const double *x );
42  double singlePulseShapeFunc( const double *x );
43  double doublePulseShapeFunc( const double *x );
44  double triplePulseShapeFunc( const double *x );
45 
46  void getPulseShape(std::array<double,HcalConst::maxSamples>& fillPulseShape) {
47  fillPulseShape = pulse_shape_;
48  }
49 
50  private:
51  std::array<float,HcalConst::maxPSshapeBin> pulse_hist;
52 
54  std::vector<float> acc25nsVec, diff25nsItvlVec;
55  std::vector<float> accVarLenIdxZEROVec, diffVarItvlIdxZEROVec;
56  std::vector<float> accVarLenIdxMinusOneVec, diffVarItvlIdxMinusOneVec;
57 
58  void funcShape(std::array<double,HcalConst::maxSamples> & ntmpbin, const double pulseTime, const double pulseHeight,const double slew);
59  double psFit_x[HcalConst::maxSamples], psFit_y[HcalConst::maxSamples], psFit_erry[HcalConst::maxSamples], psFit_erry2[HcalConst::maxSamples], psFit_slew[HcalConst::maxSamples];
60 
61  unsigned nSamplesToFit_;
66  double pulseJitter_;
67  double timeMean_;
68  double timeSig_;
69  double pedMean_;
70  double timeShift_;
71 
74  std::array<double,HcalConst::maxSamples> pulse_shape_;
75  std::array<double,HcalConst::maxSamples> pulse_shape_sum_;
76 
77  };
78 
79 }
80 
81 #endif // PulseShapeFunctor_h
std::array< double, HcalConst::maxSamples > pulse_shape_
float iniTimeShift
std::vector< float > diffVarItvlIdxZEROVec
void getPulseShape(std::array< double, HcalConst::maxSamples > &fillPulseShape)
std::array< float, HcalConst::maxPSshapeBin > pulse_hist
std::vector< float > diff25nsItvlVec
std::vector< float > diffVarItvlIdxMinusOneVec
double invertnsPerBx
double pulse(double x, double y, double z, double t)
std::array< double, HcalConst::maxSamples > pulse_shape_sum_
void setpsFiterry2(double *erry2)
#define constexpr