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 }
HcalPulseShapes::invDeltaTSiPM_
static constexpr float invDeltaTSiPM_
Definition: HcalPulseShapes.h:47
HcalSiPMShape::computeShape
void computeShape(unsigned int signalShape)
Definition: HcalSiPMShape.cc:20
HcalShapes::HE2017
Definition: HcalShapes.h:20
HcalSiPMShape::nBins_
int nBins_
Definition: HcalSiPMShape.h:23
HcalPulseShapes
Definition: HcalPulseShapes.h:22
HcalSiPMShape::HcalSiPMShape
HcalSiPMShape(unsigned int signalShape=206)
Definition: HcalSiPMShape.cc:6
HcalPulseShapes.h
HcalSiPMShape::nt_
std::vector< double > nt_
Definition: HcalSiPMShape.h:24
HcalShapes.h
protons_cff.time
time
Definition: protons_cff.py:39
HcalSiPMShape::operator()
double operator()(double time) const override
Definition: HcalSiPMShape.cc:13
HcalPulseShapes::deltaTSiPM_
static constexpr float deltaTSiPM_
Definition: HcalPulseShapes.h:46
HcalSiPMShape
Definition: HcalSiPMShape.h:8
trackingPlots.other
other
Definition: trackingPlots.py:1460
HcalShapes::HE2018
Definition: HcalShapes.h:20
HcalPulseShapes::analyticPulseShapeSiPMHE
static double analyticPulseShapeSiPMHE(double t)
Definition: HcalPulseShapes.cc:575
CaloVShape
Electronic response of the preamp.
Definition: CaloVShape.h:11
HcalSiPMShape.h
HcalShapes::HAMAMATSU
Definition: HcalShapes.h:20
HcalShapes::ZECOTEK
Definition: HcalShapes.h:20
or
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
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HcalPulseShapes::analyticPulseShapeSiPMHO
static double analyticPulseShapeSiPMHO(double t)
Definition: HcalPulseShapes.cc:568