CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PulseShapeFunctor.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_HcalRecAlgos_PulseShapeFunctor_h
2 #define RecoLocalCalo_HcalRecAlgos_PulseShapeFunctor_h
3 
6 
7 namespace FitterFuncs {
8 
10  public:
12  bool iPedestalConstraint,
13  bool iTimeConstraint,
14  bool iAddPulseJitter,
15  double iPulseJitter,
16  double iTimeMean,
17  double iPedMean,
18  unsigned int nSamplesToFit);
20 
21  void EvalPulse(const float *pars);
22  double EvalPulseM2(const double *pars, const unsigned nPar);
23 
25  int getcntNANinfit() { return cntNANinfit; }
26 
27  void setpsFitx(double *x) {
28  for (int i = 0; i < hcal::constants::maxSamples; ++i)
29  psFit_x[i] = x[i];
30  }
31  void setpsFity(double *y) {
32  for (int i = 0; i < hcal::constants::maxSamples; ++i)
33  psFit_y[i] = y[i];
34  }
35  void setpsFiterry(double *erry) {
36  for (int i = 0; i < hcal::constants::maxSamples; ++i)
37  psFit_erry[i] = erry[i];
38  }
39  void setpsFiterry2(double *erry2) {
40  for (int i = 0; i < hcal::constants::maxSamples; ++i)
41  psFit_erry2[i] = erry2[i];
42  }
43  void setpsFitslew(double *slew) {
44  for (int i = 0; i < hcal::constants::maxSamples; ++i) {
45  psFit_slew[i] = slew[i];
46  }
47  }
48  double getSiPMDarkCurrent(double darkCurrent, double fcByPE, double lambda);
49  void setinvertpedSig2(double x) { invertpedSig2_ = x; }
50  void setinverttimeSig2(double x) { inverttimeSig2_ = x; }
51 
52  inline void singlePulseShapeFuncMahi(const float *x) { return EvalPulse(x); }
53  inline double singlePulseShapeFunc(const double *x) { return EvalPulseM2(x, 3); }
54  inline double doublePulseShapeFunc(const double *x) { return EvalPulseM2(x, 5); }
55  inline double triplePulseShapeFunc(const double *x) { return EvalPulseM2(x, 7); }
56 
57  void getPulseShape(std::array<double, hcal::constants::maxSamples> &fillPulseShape) {
58  fillPulseShape = pulse_shape_;
59  }
60 
61  // getters
62  inline std::vector<float> const &acc25nsVec() const { return acc25nsVec_; }
63  inline std::vector<float> const &diff25nsItvlVec() const { return diff25nsItvlVec_; }
64  inline std::vector<float> const &accVarLenIdxZEROVec() const { return accVarLenIdxZEROVec_; }
65  inline std::vector<float> const &diffVarItvlIdxZEROVec() const { return diffVarItvlIdxZEROVec_; }
66  inline std::vector<float> const &accVarLenIdxMinusOneVec() const { return accVarLenIdxMinusOneVec_; }
67  inline std::vector<float> const &diffVarItvlIdxMinusOneVec() const { return diffVarItvlIdxMinusOneVec_; }
68 
69  private:
70  std::array<float, hcal::constants::maxPSshapeBin> pulse_hist;
71 
73  std::vector<float> acc25nsVec_, diff25nsItvlVec_;
76 
77  void funcShape(std::array<double, hcal::constants::maxSamples> &ntmpbin,
78  const double pulseTime,
79  const double pulseHeight,
80  const double slew,
81  bool scalePulse);
85 
86  unsigned nSamplesToFit_;
91  double pulseJitter_;
92  double timeMean_;
93  double timeSig_;
94  double pedMean_;
95  double timeShift_;
96 
99  std::array<double, hcal::constants::maxSamples> pulse_shape_;
100  std::array<double, hcal::constants::maxSamples> pulse_shape_sum_;
101  };
102 
103 } // namespace FitterFuncs
104 
105 #endif // PulseShapeFunctor_h
double psFit_x[hcal::constants::maxSamples]
void EvalPulse(const float *pars)
double psFit_erry2[hcal::constants::maxSamples]
std::vector< float > const & acc25nsVec() const
std::vector< float > accVarLenIdxMinusOneVec_
void singlePulseShapeFuncMahi(const float *x)
double singlePulseShapeFunc(const double *x)
void getPulseShape(std::array< double, hcal::constants::maxSamples > &fillPulseShape)
std::vector< float > const & diffVarItvlIdxZEROVec() const
std::vector< float > const & diff25nsItvlVec() const
double psFit_slew[hcal::constants::maxSamples]
std::vector< float > const & diffVarItvlIdxMinusOneVec() const
double getSiPMDarkCurrent(double darkCurrent, double fcByPE, double lambda)
double psFit_erry[hcal::constants::maxSamples]
PulseShapeFunctor(const HcalPulseShapes::Shape &pulse, bool iPedestalConstraint, bool iTimeConstraint, bool iAddPulseJitter, double iPulseJitter, double iTimeMean, double iPedMean, unsigned int nSamplesToFit)
std::vector< float > diff25nsItvlVec_
std::array< double, hcal::constants::maxSamples > pulse_shape_
std::vector< float > acc25nsVec_
std::vector< float > const & accVarLenIdxZEROVec() const
std::array< float, hcal::constants::maxPSshapeBin > pulse_hist
double psFit_y[hcal::constants::maxSamples]
double pulse(double x, double y, double z, double t)
double triplePulseShapeFunc(const double *x)
void funcShape(std::array< double, hcal::constants::maxSamples > &ntmpbin, const double pulseTime, const double pulseHeight, const double slew, bool scalePulse)
constexpr int maxSamples
Definition: HcalConstants.h:6
double doublePulseShapeFunc(const double *x)
void setpsFiterry2(double *erry2)
std::array< double, hcal::constants::maxSamples > pulse_shape_sum_
std::vector< float > accVarLenIdxZEROVec_
std::vector< float > diffVarItvlIdxZEROVec_
std::vector< float > const & accVarLenIdxMinusOneVec() const
std::vector< float > diffVarItvlIdxMinusOneVec_
double EvalPulseM2(const double *pars, const unsigned nPar)