CMS 3D CMS Logo

Public Member Functions | Private Attributes

CastorPulseShapes::Shape Class Reference

#include <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_.

                              {
  nbin_=0;
  tpeak_=0;
}

Member Function Documentation

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

Definition at line 61 of file CastorPulseShapes.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;
}
float CastorPulseShapes::Shape::getTpeak ( ) const [inline]

Definition at line 19 of file CastorPulseShapes.h.

References tpeak_.

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

Definition at line 69 of file CastorPulseShapes.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 CastorPulseShapes::Shape::operator() ( double  time) const

Definition at line 53 of file CastorPulseShapes.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 CastorPulseShapes::Shape::setNBin ( int  n)

Definition at line 44 of file CastorPulseShapes.cc.

References n.

Referenced by CastorPulseShapes::computeCastorShape().

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

Definition at line 49 of file CastorPulseShapes.cc.

References f, and i.

Referenced by CastorPulseShapes::computeCastorShape().

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

Member Data Documentation

Definition at line 25 of file CastorPulseShapes.h.

Referenced by Shape().

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

Definition at line 24 of file CastorPulseShapes.h.

Definition at line 26 of file CastorPulseShapes.h.

Referenced by getTpeak(), and Shape().