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
 
std::vector< float > const & data () const
 
 HcalPulseShape ()
 
 HcalPulseShape (const std::vector< double > &, unsigned)
 
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_
 

Detailed Description

Definition at line 6 of file HcalPulseShape.h.

Constructor & Destructor Documentation

◆ HcalPulseShape() [1/2]

HcalPulseShape::HcalPulseShape ( )

Definition at line 3 of file HcalPulseShape.cc.

3 { nbin_ = 0; }

References nbin_.

◆ HcalPulseShape() [2/2]

HcalPulseShape::HcalPulseShape ( const std::vector< double > &  shape,
unsigned  nbin 
)

Definition at line 5 of file HcalPulseShape.cc.

6  : shape_(shape.begin(), shape.begin() + nbin), nbin_(nbin) {}

Member Function Documentation

◆ at()

float HcalPulseShape::at ( double  time) const

Definition at line 23 of file HcalPulseShape.cc.

23  {
24  // shape is in 1 ns steps
25  int i = (int)(t + 0.5);
26  float rv = 0;
27  if (i >= 0 && i < nbin_)
28  rv = shape_[i];
29  return rv;
30 }

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

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

◆ data()

std::vector<float> const& HcalPulseShape::data ( ) const
inline

◆ integrate()

float HcalPulseShape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 32 of file HcalPulseShape.cc.

32  {
33  static const float int_delta_ns = 0.05f;
34  double intval = 0.0;
35 
36  for (double t = t1; t < t2; t += int_delta_ns) {
37  float loedge = at(t);
38  float hiedge = at(t + int_delta_ns);
39  intval += (loedge + hiedge) * int_delta_ns / 2.0;
40  }
41  return (float)intval;
42 }

References at(), submitPVValidationJobs::t, RandomServiceHelper::t1, and RandomServiceHelper::t2.

◆ nbins()

int HcalPulseShape::nbins ( ) const
inline

Definition at line 15 of file HcalPulseShape.h.

15 { return nbin_; }

References nbin_.

◆ operator()()

float HcalPulseShape::operator() ( double  time) const

Definition at line 18 of file HcalPulseShape.cc.

18  {
19  // shape is in 1 ns steps
20  return at(t);
21 }

References at(), and submitPVValidationJobs::t.

◆ setNBin()

void HcalPulseShape::setNBin ( int  n)

◆ setShapeBin()

void HcalPulseShape::setShapeBin ( int  i,
float  f 
)

Member Data Documentation

◆ nbin_

int HcalPulseShape::nbin_
private

Definition at line 20 of file HcalPulseShape.h.

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

◆ shape_

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

Definition at line 19 of file HcalPulseShape.h.

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

RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HcalPulseShape::nbin_
int nbin_
Definition: HcalPulseShape.h:20
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
HcalPulseShape::shape_
std::vector< float > shape_
Definition: HcalPulseShape.h:19
createfilelist.int
int
Definition: createfilelist.py:10
HcalPulseShape::at
float at(double time) const
Definition: HcalPulseShape.cc:23
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644