CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalPulseShapes::Shape Class Reference

#include <HcalPulseShapes.h>

List of all members.

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 16 of file HcalPulseShapes.h.


Constructor & Destructor Documentation

HcalPulseShapes::Shape::Shape ( )

Definition at line 139 of file HcalPulseShapes.cc.

References nbin_, and tpeak_.

                            {
  nbin_=0;
  tpeak_=0;
}

Member Function Documentation

float HcalPulseShapes::Shape::at ( double  time) const

Definition at line 161 of file HcalPulseShapes.cc.

References i.

Referenced by HBHEPulseShapeFlagSetter::Initialize(), and HcalNoiseMonitor::ReadHcalPulse().

                                             {
  // shape is in 1 ns steps
  int i=(int)(t+0.5);
  float rv=0;
  if (i>=0 && i<nbin_) rv=shape_[i];
  return rv;
}
float HcalPulseShapes::Shape::getTpeak ( ) const [inline]

Definition at line 21 of file HcalPulseShapes.h.

References tpeak_.

{ return tpeak_; }
float HcalPulseShapes::Shape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 169 of file HcalPulseShapes.cc.

References asciidump::at, and matplotRender::t.

                                                                {
  static const float int_delta_ns = 0.05f; 
  double intval = 0.0;

  for (double t = t1; t < t2; t+= int_delta_ns) {
    float loedge = at(t);
    float hiedge = at(t+int_delta_ns);
    intval += (loedge+hiedge)*int_delta_ns/2.0;
  }

  return (float)intval;
}
float HcalPulseShapes::Shape::operator() ( double  time) const

Definition at line 153 of file HcalPulseShapes.cc.

References i.

                                                     {
  // shape is in 1 ns steps
  int i=(int)(t+0.5);
  float rv=0;
  if (i>=0 && i<nbin_) rv=shape_[i];
  return rv;
}
void HcalPulseShapes::Shape::setNBin ( int  n)

Definition at line 144 of file HcalPulseShapes.cc.

References n.

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

                                        {
  nbin_=n;
  shape_=std::vector<float>(n,0.0f);
}
void HcalPulseShapes::Shape::setShapeBin ( int  i,
float  f 
)

Definition at line 149 of file HcalPulseShapes.cc.

References f, and i.

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

                                                     {
  if (i>=0 && i<nbin_) shape_[i]=f;
}

Member Data Documentation

Definition at line 27 of file HcalPulseShapes.h.

Referenced by Shape().

std::vector<float> HcalPulseShapes::Shape::shape_ [private]

Definition at line 26 of file HcalPulseShapes.h.

Definition at line 28 of file HcalPulseShapes.h.

Referenced by getTpeak(), and Shape().