CMS 3D CMS Logo

HcalSiPMShape.cc
Go to the documentation of this file.
4 #include <iostream>
5 
6 HcalSiPMShape::HcalSiPMShape(unsigned int signalShape)
7  : CaloVShape(), nBins_(HcalPulseShapes::nBinsSiPM_ * HcalPulseShapes::invDeltaTSiPM_), nt_(nBins_, 0.) {
8  computeShape(signalShape);
9 }
10 
12 
13 double HcalSiPMShape::operator()(double time) const {
14  int jtime(time * HcalPulseShapes::invDeltaTSiPM_ + 0.5);
15  if (jtime >= 0 && jtime < nBins_)
16  return nt_[jtime];
17  return 0.;
18 }
19 
20 void HcalSiPMShape::computeShape(unsigned int signalShape) {
21  //grab correct function pointer based on shape
22  double (*analyticPulseShape)(double);
23  if (signalShape == HcalShapes::ZECOTEK || signalShape == HcalShapes::HAMAMATSU)
24  analyticPulseShape = &HcalPulseShapes::analyticPulseShapeSiPMHO;
25  else if (signalShape == HcalShapes::HE2017 or signalShape == HcalShapes::HE2018)
26  analyticPulseShape = &HcalPulseShapes::analyticPulseShapeSiPMHE;
27  else
28  return;
29 
30  double norm = 0.;
31  for (int j = 0; j < nBins_; ++j) {
32  nt_[j] = analyticPulseShape(j * HcalPulseShapes::deltaTSiPM_);
33  norm += (nt_[j] > 0) ? nt_[j] : 0.;
34  }
35 
36  for (int j = 0; j < nBins_; ++j) {
37  nt_[j] /= norm;
38  }
39 }
Electronic response of the preamp.
Definition: CaloVShape.h:11
static double analyticPulseShapeSiPMHE(double t)
std::vector< double > nt_
Definition: HcalSiPMShape.h:24
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
HcalSiPMShape(unsigned int signalShape=206)
Definition: HcalSiPMShape.cc:6
static float invDeltaTSiPM_
void computeShape(unsigned int signalShape)
double operator()(double time) const override
static float deltaTSiPM_
static double analyticPulseShapeSiPMHO(double t)