CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
HcalSiPMShape Class Reference

#include <HcalSiPMShape.h>

Inheritance diagram for HcalSiPMShape:
CaloVShape

Public Member Functions

 HcalSiPMShape (unsigned int signalShape=203)
 
 HcalSiPMShape (const HcalSiPMShape &other)
 
virtual double operator() (double time) const
 
virtual double timeToRise () const
 
virtual ~HcalSiPMShape ()
 
- Public Member Functions inherited from CaloVShape
 CaloVShape ()
 
virtual ~CaloVShape ()
 

Protected Member Functions

void computeShape (unsigned int signalShape)
 

Private Attributes

int nBins_
 
std::vector< double > nt_
 

Detailed Description

Definition at line 8 of file HcalSiPMShape.h.

Constructor & Destructor Documentation

HcalSiPMShape::HcalSiPMShape ( unsigned int  signalShape = 203)

Definition at line 6 of file HcalSiPMShape.cc.

References computeShape().

7  computeShape(signalShape);
8 }
static const int nBinsSiPM_
std::vector< double > nt_
Definition: HcalSiPMShape.h:26
void computeShape(unsigned int signalShape)
static constexpr float invDeltaTSiPM_
HcalSiPMShape::HcalSiPMShape ( const HcalSiPMShape other)

Definition at line 10 of file HcalSiPMShape.cc.

10 : CaloVShape(other), nBins_(other.nBins_), nt_(other.nt_) {}
std::vector< double > nt_
Definition: HcalSiPMShape.h:26
virtual HcalSiPMShape::~HcalSiPMShape ( )
inlinevirtual

Definition at line 14 of file HcalSiPMShape.h.

References operator()(), and ntuplemaker::time.

14 {}

Member Function Documentation

void HcalSiPMShape::computeShape ( unsigned int  signalShape)
protected

Definition at line 19 of file HcalSiPMShape.cc.

References HcalPulseShapes::analyticPulseShapeSiPMHE(), HcalPulseShapes::analyticPulseShapeSiPMHO(), HcalPulseShapes::deltaTSiPM_, HcalShapes::HAMAMATSU, HcalShapes::HE2017, nBins_, nt_, and HcalShapes::ZECOTEK.

Referenced by HcalSiPMShape(), and timeToRise().

19  {
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 }
static double analyticPulseShapeSiPMHE(double t)
std::vector< double > nt_
Definition: HcalSiPMShape.h:26
static constexpr float deltaTSiPM_
static double analyticPulseShapeSiPMHO(double t)
double HcalSiPMShape::operator() ( double  time) const
virtual

Implements CaloVShape.

Definition at line 12 of file HcalSiPMShape.cc.

References HcalPulseShapes::invDeltaTSiPM_, nBins_, and nt_.

Referenced by ~HcalSiPMShape().

12  {
13  int jtime(time*HcalPulseShapes::invDeltaTSiPM_ + 0.5);
14  if (jtime>=0 && jtime<nBins_)
15  return nt_[jtime];
16  return 0.;
17 }
std::vector< double > nt_
Definition: HcalSiPMShape.h:26
static constexpr float invDeltaTSiPM_
virtual double HcalSiPMShape::timeToRise ( ) const
inlinevirtual

Implements CaloVShape.

Definition at line 18 of file HcalSiPMShape.h.

References computeShape().

18 {return 0.0;}

Member Data Documentation

int HcalSiPMShape::nBins_
private

Definition at line 25 of file HcalSiPMShape.h.

Referenced by computeShape(), and operator()().

std::vector<double> HcalSiPMShape::nt_
private

Definition at line 26 of file HcalSiPMShape.h.

Referenced by computeShape(), and operator()().