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:44
HcalSiPMShape::computeShape
void computeShape(unsigned int signalShape)
Definition: HcalSiPMShape.cc:20
HcalSiPMShape::nBins_
int nBins_
Definition: HcalSiPMShape.h:23
HcalPulseShapes
Definition: HcalPulseShapes.h:21
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
HcalSiPMShape::operator()
double operator()(double time) const override
Definition: HcalSiPMShape.cc:13
HcalPulseShapes::deltaTSiPM_
static constexpr float deltaTSiPM_
Definition: HcalPulseShapes.h:43
HcalShapes::HE2017
Definition: HcalShapes.h:20
HcalSiPMShape
Definition: HcalSiPMShape.h:8
trackingPlots.other
other
Definition: trackingPlots.py:1465
HcalPulseShapes::analyticPulseShapeSiPMHE
static double analyticPulseShapeSiPMHE(double t)
Definition: HcalPulseShapes.cc:523
HcalShapes::ZECOTEK
Definition: HcalShapes.h:20
CaloVShape
Electronic response of the preamp.
Definition: CaloVShape.h:11
HcalShapes::HE2018
Definition: HcalShapes.h:20
HcalSiPMShape.h
HcalShapes::HAMAMATSU
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
ntuplemaker.time
time
Definition: ntuplemaker.py:310
HcalPulseShapes::analyticPulseShapeSiPMHO
static double analyticPulseShapeSiPMHO(double t)
Definition: HcalPulseShapes.cc:516