CMS 3D CMS Logo

HcalPulseShapes::Shape Class Reference

#include <CalibCalorimetry/HcalAlgos/interface/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_.

00139                             {
00140   nbin_=0;
00141   tpeak_=0;
00142 }


Member Function Documentation

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

Definition at line 161 of file HcalPulseShapes.cc.

References i, int, nbin_, and shape_.

Referenced by integrate().

00161                                              {
00162   // shape is in 1 ns steps
00163   int i=(int)(t+0.5);
00164   float rv=0;
00165   if (i>=0 && i<nbin_) rv=shape_[i];
00166   return rv;
00167 }

float HcalPulseShapes::Shape::getTpeak (  )  const [inline]

Definition at line 21 of file HcalPulseShapes.h.

References tpeak_.

00021 { return tpeak_; }

float HcalPulseShapes::Shape::integrate ( double  tmin,
double  tmax 
) const

Definition at line 169 of file HcalPulseShapes.cc.

References at(), and t.

00169                                                                 {
00170   static const float int_delta_ns = 0.05f; 
00171   double intval = 0.0;
00172 
00173   for (double t = t1; t < t2; t+= int_delta_ns) {
00174     float loedge = at(t);
00175     float hiedge = at(t+int_delta_ns);
00176     intval += (loedge+hiedge)*int_delta_ns/2.0;
00177   }
00178 
00179   return (float)intval;
00180 }

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

Definition at line 153 of file HcalPulseShapes.cc.

References i, int, nbin_, and shape_.

00153                                                      {
00154   // shape is in 1 ns steps
00155   int i=(int)(t+0.5);
00156   float rv=0;
00157   if (i>=0 && i<nbin_) rv=shape_[i];
00158   return rv;
00159 }

void HcalPulseShapes::Shape::setNBin ( int  n  ) 

Definition at line 144 of file HcalPulseShapes.cc.

References nbin_, and shape_.

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

00144                                         {
00145   nbin_=n;
00146   shape_=std::vector<float>(n,0.0f);
00147 }

void HcalPulseShapes::Shape::setShapeBin ( int  i,
float  f 
)

Definition at line 149 of file HcalPulseShapes.cc.

References nbin_, and shape_.

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

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


Member Data Documentation

int HcalPulseShapes::Shape::nbin_ [private]

Definition at line 27 of file HcalPulseShapes.h.

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

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

Definition at line 26 of file HcalPulseShapes.h.

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

float HcalPulseShapes::Shape::tpeak_ [private]

Definition at line 28 of file HcalPulseShapes.h.

Referenced by getTpeak(), and Shape().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:49 2009 for CMSSW by  doxygen 1.5.4