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 
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
FitterFuncs::PulseShapeFunctor::diff25nsItvlVec
const std::vector< float > & diff25nsItvlVec() const
Definition: PulseShapeFunctor.h:63
FitterFuncs::PulseShapeFunctor::accVarLenIdxZEROVec_
std::vector< float > accVarLenIdxZEROVec_
Definition: PulseShapeFunctor.h:74
FitterFuncs::PulseShapeFunctor::accVarLenIdxMinusOneVec_
std::vector< float > accVarLenIdxMinusOneVec_
Definition: PulseShapeFunctor.h:75
FitterFuncs::PulseShapeFunctor::diffVarItvlIdxZEROVec
const std::vector< float > & diffVarItvlIdxZEROVec() const
Definition: PulseShapeFunctor.h:65
FitterFuncs::PulseShapeFunctor::nSamplesToFit_
unsigned nSamplesToFit_
Definition: PulseShapeFunctor.h:86
FitterFuncs::PulseShapeFunctor::setDefaultcntNANinfit
void setDefaultcntNANinfit()
Definition: PulseShapeFunctor.h:24
FitterFuncs::PulseShapeFunctor::unConstrainedFit_
bool unConstrainedFit_
Definition: PulseShapeFunctor.h:90
FitterFuncs::PulseShapeFunctor::psFit_slew
double psFit_slew[hcal::constants::maxSamples]
Definition: PulseShapeFunctor.h:82
mps_fire.i
i
Definition: mps_fire.py:428
FitterFuncs::PulseShapeFunctor::setinvertpedSig2
void setinvertpedSig2(double x)
Definition: PulseShapeFunctor.h:49
FitterFuncs::PulseShapeFunctor::pulse_hist
std::array< float, hcal::constants::maxPSshapeBin > pulse_hist
Definition: PulseShapeFunctor.h:70
FitterFuncs::PulseShapeFunctor::pedestalConstraint_
bool pedestalConstraint_
Definition: PulseShapeFunctor.h:87
FitterFuncs::PulseShapeFunctor::singlePulseShapeFuncMahi
void singlePulseShapeFuncMahi(const float *x)
Definition: PulseShapeFunctor.h:52
FitterFuncs::PulseShapeFunctor::acc25nsVec_
std::vector< float > acc25nsVec_
Definition: PulseShapeFunctor.h:73
HcalPulseShapes.h
FitterFuncs::PulseShapeFunctor
Definition: PulseShapeFunctor.h:9
FitterFuncs::PulseShapeFunctor::timeConstraint_
bool timeConstraint_
Definition: PulseShapeFunctor.h:88
pulse
double pulse(double x, double y, double z, double t)
Definition: SiStripPulseShape.cc:49
FitterFuncs::PulseShapeFunctor::doublePulseShapeFunc
double doublePulseShapeFunc(const double *x)
Definition: PulseShapeFunctor.h:54
FitterFuncs::PulseShapeFunctor::setinverttimeSig2
void setinverttimeSig2(double x)
Definition: PulseShapeFunctor.h:50
FitterFuncs::PulseShapeFunctor::diffVarItvlIdxMinusOneVec
const std::vector< float > & diffVarItvlIdxMinusOneVec() const
Definition: PulseShapeFunctor.h:67
FitterFuncs::PulseShapeFunctor::psFit_x
double psFit_x[hcal::constants::maxSamples]
Definition: PulseShapeFunctor.h:82
FitterFuncs::PulseShapeFunctor::setpsFiterry
void setpsFiterry(double *erry)
Definition: PulseShapeFunctor.h:35
FitterFuncs::PulseShapeFunctor::EvalPulse
void EvalPulse(const float *pars)
Definition: PulseShapeFunctor.cc:126
FitterFuncs::PulseShapeFunctor::pulse_shape_sum_
std::array< double, hcal::constants::maxSamples > pulse_shape_sum_
Definition: PulseShapeFunctor.h:100
FitterFuncs::PulseShapeFunctor::diff25nsItvlVec_
std::vector< float > diff25nsItvlVec_
Definition: PulseShapeFunctor.h:73
FitterFuncs::PulseShapeFunctor::cntNANinfit
int cntNANinfit
Definition: PulseShapeFunctor.h:72
FitterFuncs::PulseShapeFunctor::psFit_erry
double psFit_erry[hcal::constants::maxSamples]
Definition: PulseShapeFunctor.h:82
FitterFuncs::PulseShapeFunctor::setpsFitslew
void setpsFitslew(double *slew)
Definition: PulseShapeFunctor.h:43
HcalResponse_cfi.nPar
nPar
Definition: HcalResponse_cfi.py:33
FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc
double singlePulseShapeFunc(const double *x)
Definition: PulseShapeFunctor.h:53
FitterFuncs::PulseShapeFunctor::inverttimeSig2_
double inverttimeSig2_
Definition: PulseShapeFunctor.h:97
FitterFuncs::PulseShapeFunctor::pulse_shape_
std::array< double, hcal::constants::maxSamples > pulse_shape_
Definition: PulseShapeFunctor.h:99
FitterFuncs::PulseShapeFunctor::setpsFitx
void setpsFitx(double *x)
Definition: PulseShapeFunctor.h:27
FitterFuncs::PulseShapeFunctor::EvalPulseM2
double EvalPulseM2(const double *pars, const unsigned nPar)
Definition: PulseShapeFunctor.cc:133
FitterFuncs::PulseShapeFunctor::funcShape
void funcShape(std::array< double, hcal::constants::maxSamples > &ntmpbin, const double pulseTime, const double pulseHeight, const double slew, bool scalePulse)
Definition: PulseShapeFunctor.cc:72
FitterFuncs::PulseShapeFunctor::getPulseShape
void getPulseShape(std::array< double, hcal::constants::maxSamples > &fillPulseShape)
Definition: PulseShapeFunctor.h:57
FitterFuncs::PulseShapeFunctor::psFit_y
double psFit_y[hcal::constants::maxSamples]
Definition: PulseShapeFunctor.h:82
FitterFuncs::PulseShapeFunctor::triplePulseShapeFunc
double triplePulseShapeFunc(const double *x)
Definition: PulseShapeFunctor.h:55
FitterFuncs::PulseShapeFunctor::pedMean_
double pedMean_
Definition: PulseShapeFunctor.h:94
FitterFuncs::PulseShapeFunctor::addPulseJitter_
bool addPulseJitter_
Definition: PulseShapeFunctor.h:89
FitterFuncs::PulseShapeFunctor::diffVarItvlIdxMinusOneVec_
std::vector< float > diffVarItvlIdxMinusOneVec_
Definition: PulseShapeFunctor.h:75
FitterFuncs::PulseShapeFunctor::acc25nsVec
const std::vector< float > & acc25nsVec() const
Definition: PulseShapeFunctor.h:62
hcal::constants::maxSamples
constexpr int maxSamples
Definition: HcalConstants.h:6
FitterFuncs::PulseShapeFunctor::timeSig_
double timeSig_
Definition: PulseShapeFunctor.h:93
FitterFuncs
Definition: PulseShapeFunctor.h:7
HcalConstants.h
FitterFuncs::PulseShapeFunctor::timeShift_
double timeShift_
Definition: PulseShapeFunctor.h:95
FitterFuncs::PulseShapeFunctor::~PulseShapeFunctor
~PulseShapeFunctor()
Definition: PulseShapeFunctor.cc:124
FitterFuncs::PulseShapeFunctor::pulseJitter_
double pulseJitter_
Definition: PulseShapeFunctor.h:91
HcalPulseShape
Definition: HcalPulseShape.h:6
FitterFuncs::PulseShapeFunctor::invertpedSig2_
double invertpedSig2_
Definition: PulseShapeFunctor.h:98
FitterFuncs::PulseShapeFunctor::getcntNANinfit
int getcntNANinfit()
Definition: PulseShapeFunctor.h:25
FitterFuncs::PulseShapeFunctor::diffVarItvlIdxZEROVec_
std::vector< float > diffVarItvlIdxZEROVec_
Definition: PulseShapeFunctor.h:74
FitterFuncs::PulseShapeFunctor::accVarLenIdxMinusOneVec
const std::vector< float > & accVarLenIdxMinusOneVec() const
Definition: PulseShapeFunctor.h:66
FitterFuncs::PulseShapeFunctor::setpsFiterry2
void setpsFiterry2(double *erry2)
Definition: PulseShapeFunctor.h:39
FitterFuncs::PulseShapeFunctor::PulseShapeFunctor
PulseShapeFunctor(const HcalPulseShapes::Shape &pulse, bool iPedestalConstraint, bool iTimeConstraint, bool iAddPulseJitter, double iPulseJitter, double iTimeMean, double iPedMean, unsigned int nSamplesToFit)
Definition: PulseShapeFunctor.cc:10
FitterFuncs::PulseShapeFunctor::setpsFity
void setpsFity(double *y)
Definition: PulseShapeFunctor.h:31
FitterFuncs::PulseShapeFunctor::psFit_erry2
double psFit_erry2[hcal::constants::maxSamples]
Definition: PulseShapeFunctor.h:82
FitterFuncs::PulseShapeFunctor::getSiPMDarkCurrent
double getSiPMDarkCurrent(double darkCurrent, double fcByPE, double lambda)
FitterFuncs::PulseShapeFunctor::timeMean_
double timeMean_
Definition: PulseShapeFunctor.h:92
FitterFuncs::PulseShapeFunctor::accVarLenIdxZEROVec
const std::vector< float > & accVarLenIdxZEROVec() const
Definition: PulseShapeFunctor.h:64