CMS 3D CMS Logo

CastorPulseShapes::Shape Class Reference

#include <CalibCalorimetry/CastorCalib/interface/CastorPulseShapes.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 14 of file CastorPulseShapes.h.


Constructor & Destructor Documentation

CastorPulseShapes::Shape::Shape (  ) 

Definition at line 39 of file CastorPulseShapes.cc.

References nbin_, and tpeak_.

00039                               {
00040   nbin_=0;
00041   tpeak_=0;
00042 }


Member Function Documentation

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

Definition at line 61 of file CastorPulseShapes.cc.

References i, int, nbin_, and shape_.

Referenced by integrate().

00061                                                {
00062   // shape is in 1 ns steps
00063   int i=(int)(t+0.5);
00064   float rv=0;
00065   if (i>=0 && i<nbin_) rv=shape_[i];
00066   return rv;
00067 }

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

Definition at line 19 of file CastorPulseShapes.h.

References tpeak_.

00019 { return tpeak_; }

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

Definition at line 69 of file CastorPulseShapes.cc.

References at(), and t.

Referenced by RecoFCcorFactorAlgo::calcpair(), and RecoFCcorFactorAlgo::RecoFCcorFactorAlgo().

00069                                                                   {
00070   static const float int_delta_ns = 0.05f; 
00071   double intval = 0.0;
00072 
00073   for (double t = t1; t < t2; t+= int_delta_ns) {
00074     float loedge = at(t);
00075     float hiedge = at(t+int_delta_ns);
00076     intval += (loedge+hiedge)*int_delta_ns/2.0;
00077   }
00078 
00079   return (float)intval;
00080 }

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

Definition at line 53 of file CastorPulseShapes.cc.

References i, int, nbin_, and shape_.

00053                                                        {
00054   // shape is in 1 ns steps
00055   int i=(int)(t+0.5);
00056   float rv=0;
00057   if (i>=0 && i<nbin_) rv=shape_[i];
00058   return rv;
00059 }

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

Definition at line 44 of file CastorPulseShapes.cc.

References nbin_, and shape_.

Referenced by CastorPulseShapes::computeCastorShape().

00044                                           {
00045   nbin_=n;
00046   shape_=std::vector<float>(n,0.0f);
00047 }

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

Definition at line 49 of file CastorPulseShapes.cc.

References nbin_, and shape_.

Referenced by CastorPulseShapes::computeCastorShape().

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


Member Data Documentation

int CastorPulseShapes::Shape::nbin_ [private]

Definition at line 25 of file CastorPulseShapes.h.

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

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

Definition at line 24 of file CastorPulseShapes.h.

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

float CastorPulseShapes::Shape::tpeak_ [private]

Definition at line 26 of file CastorPulseShapes.h.

Referenced by getTpeak(), and Shape().


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