CMS 3D CMS Logo

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

#include <HcalPulseShape.h>

Public Member Functions

float at (double time) const
 
float getTpeak () const
 
 HcalPulseShape ()
 
float integrate (double tmin, double tmax) const
 
int nbins () const
 
float operator() (double time) const
 
void setNBin (int n)
 
void setShapeBin (int i, float f)
 

Private Attributes

int nbin_
 
std::vector< float > shape_
 
float tpeak_
 

Detailed Description

Definition at line 6 of file HcalPulseShape.h.

Constructor & Destructor Documentation

HcalPulseShape::HcalPulseShape ( )

Definition at line 3 of file HcalPulseShape.cc.

References nbin_, and tpeak_.

3  {
4  nbin_=0;
5  tpeak_=0;
6 }

Member Function Documentation

float HcalPulseShape::at ( double  time) const

Definition at line 22 of file HcalPulseShape.cc.

References mps_fire::i, createfilelist::int, nbin_, and shape_.

Referenced by getTpeak(), HcalShapeIntegrator::HcalShapeIntegrator(), HBHEPulseShapeFlagSetter::Initialize(), integrate(), operator()(), HFShape::operator()(), and HcalShape::operator()().

22  {
23  // shape is in 1 ns steps
24  int i=(int)(t+0.5);
25  float rv=0;
26  if (i>=0 && i<nbin_) rv=shape_[i];
27  return rv;
28 }
std::vector< float > shape_
float HcalPulseShape::getTpeak ( ) const
inline

Definition at line 11 of file HcalPulseShape.h.

References at(), integrate(), operator()(), ntuplemaker::time, tmax, and tpeak_.

11 { return tpeak_; }
float HcalPulseShape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 30 of file HcalPulseShape.cc.

References at(), lumiQTWidget::t, and reco::t2.

Referenced by getTpeak().

30  {
31  static const float int_delta_ns = 0.05f;
32  double intval = 0.0;
33 
34  for (double t = t1; t < t2; t+= int_delta_ns) {
35  float loedge = at(t);
36  float hiedge = at(t+int_delta_ns);
37  intval += (loedge+hiedge)*int_delta_ns/2.0;
38  }
39  return (float)intval;
40 }
float at(double time) const
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
int HcalPulseShape::nbins ( ) const
inline

Definition at line 15 of file HcalPulseShape.h.

References nbin_.

15 {return nbin_;}
float HcalPulseShape::operator() ( double  time) const

Definition at line 17 of file HcalPulseShape.cc.

References at().

Referenced by getTpeak().

17  {
18  // shape is in 1 ns steps
19  return at(t);
20 }
float at(double time) const
void HcalPulseShape::setNBin ( int  n)

Definition at line 8 of file HcalPulseShape.cc.

References gen::n, nbin_, and shape_.

Referenced by HcalPulseShapes::computeHFShape(), HcalPulseShapes::computeHPDShape(), HcalPulseShapes::computeSiPMShape(), and HcalPulseShapes::computeSiPMShape2017().

8  {
9  nbin_=n;
10  shape_=std::vector<float>(n,0.0f);
11 }
std::vector< float > shape_
void HcalPulseShape::setShapeBin ( int  i,
float  f 
)

Definition at line 13 of file HcalPulseShape.cc.

References f, mps_fire::i, nbin_, and shape_.

Referenced by HcalPulseShapes::computeHFShape(), HcalPulseShapes::computeHPDShape(), HcalPulseShapes::computeSiPMShape(), and HcalPulseShapes::computeSiPMShape2017().

13  {
14  if (i>=0 && i<nbin_) shape_[i]=f;
15 }
std::vector< float > shape_
double f[11][100]

Member Data Documentation

int HcalPulseShape::nbin_
private

Definition at line 18 of file HcalPulseShape.h.

Referenced by at(), HcalPulseShape(), nbins(), setNBin(), and setShapeBin().

std::vector<float> HcalPulseShape::shape_
private

Definition at line 17 of file HcalPulseShape.h.

Referenced by at(), setNBin(), and setShapeBin().

float HcalPulseShape::tpeak_
private

Definition at line 19 of file HcalPulseShape.h.

Referenced by getTpeak(), and HcalPulseShape().