CMS 3D CMS Logo

HcalSiPMShape.cc
Go to the documentation of this file.
4 #include <iostream>
5 
6 HcalSiPMShape::HcalSiPMShape(unsigned int signalShape) : CaloVShape(), nBins_(HcalPulseShapes::nBinsSiPM_*HcalPulseShapes::invDeltaTSiPM_), nt_(nBins_, 0.) {
7  computeShape(signalShape);
8 }
9 
11 
12 double HcalSiPMShape::operator () (double time) const {
13  int jtime(time*HcalPulseShapes::invDeltaTSiPM_ + 0.5);
14  if (jtime>=0 && jtime<nBins_)
15  return nt_[jtime];
16  return 0.;
17 }
18 
19 void HcalSiPMShape::computeShape(unsigned int signalShape) {
20  //grab correct function pointer based on shape
21  double (*analyticPulseShape)(double);
22  if(signalShape==HcalShapes::ZECOTEK || signalShape==HcalShapes::HAMAMATSU) analyticPulseShape = &HcalPulseShapes::analyticPulseShapeSiPMHO;
23  else if(signalShape==HcalShapes::HE2017) analyticPulseShape = &HcalPulseShapes::analyticPulseShapeSiPMHE;
24  else return;
25 
26  double norm = 0.;
27  for (int j = 0; j < nBins_; ++j) {
28  nt_[j] = analyticPulseShape(j*HcalPulseShapes::deltaTSiPM_);
29  norm += (nt_[j]>0) ? nt_[j] : 0.;
30  }
31 
32  for (int j = 0; j < nBins_; ++j) {
33  nt_[j] /= norm;
34  }
35 }
36 
HcalSiPMShape(unsigned int signalShape=203)
Definition: HcalSiPMShape.cc:6
Electronic response of the preamp.
Definition: CaloVShape.h:11
static double analyticPulseShapeSiPMHE(double t)
std::vector< double > nt_
Definition: HcalSiPMShape.h:26
void computeShape(unsigned int signalShape)
static constexpr float invDeltaTSiPM_
static constexpr float deltaTSiPM_
double operator()(double time) const override
static double analyticPulseShapeSiPMHO(double t)