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::HcalPulseShape ( )

Definition at line 3 of file HcalPulseShape.cc.

References nbin_.

3  {
4  nbin_=0;
5 }
HcalPulseShape::HcalPulseShape ( const std::vector< double > &  shape,
unsigned  nbin 
)

Definition at line 7 of file HcalPulseShape.cc.

7  :
8  shape_(shape.begin(),shape.begin()+nbin),
9  nbin_(nbin)
10 {
11 }
std::vector< float > shape_

Member Function Documentation

float HcalPulseShape::at ( double  time) const

Definition at line 28 of file HcalPulseShape.cc.

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

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

28  {
29  // shape is in 1 ns steps
30  int i=(int)(t+0.5);
31  float rv=0;
32  if (i>=0 && i<nbin_) rv=shape_[i];
33  return rv;
34 }
std::vector< float > shape_
std::vector<float> const& HcalPulseShape::data ( ) const
inline
float HcalPulseShape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 36 of file HcalPulseShape.cc.

References at(), and lumiQTWidget::t.

36  {
37  static const float int_delta_ns = 0.05f;
38  double intval = 0.0;
39 
40  for (double t = t1; t < t2; t+= int_delta_ns) {
41  float loedge = at(t);
42  float hiedge = at(t+int_delta_ns);
43  intval += (loedge+hiedge)*int_delta_ns/2.0;
44  }
45  return (float)intval;
46 }
float at(double time) const
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 23 of file HcalPulseShape.cc.

References at().

23  {
24  // shape is in 1 ns steps
25  return at(t);
26 }
float at(double time) const
void HcalPulseShape::setNBin ( int  n)
void HcalPulseShape::setShapeBin ( int  i,
float  f 
)

Member Data Documentation

int HcalPulseShape::nbin_
private

Definition at line 19 of file HcalPulseShape.h.

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

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

Definition at line 18 of file HcalPulseShape.h.

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