CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
11 HcalSiPMShape::HcalSiPMShape(const HcalSiPMShape& other) : CaloVShape(other), nBins_(other.nBins_), nt_(other.nt_) {}
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 }
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Electronic response of the preamp.
Definition: CaloVShape.h:11
static double analyticPulseShapeSiPMHE(double t)
double operator()(double time) const override
std::vector< double > nt_
Definition: HcalSiPMShape.h:24
HcalSiPMShape(unsigned int signalShape=206)
Definition: HcalSiPMShape.cc:6
void computeShape(unsigned int signalShape)
static constexpr float invDeltaTSiPM_
static constexpr float deltaTSiPM_
static double analyticPulseShapeSiPMHO(double t)