CMS 3D CMS Logo

Public Member Functions | Private Attributes

CaloCachedShapeIntegrator Class Reference

#include <CaloCachedShapeIntegrator.h>

Inheritance diagram for CaloCachedShapeIntegrator:
CaloVShape

List of all members.

Public Member Functions

 CaloCachedShapeIntegrator (const CaloVShape *aShape)
virtual double operator() (double startTime) const
virtual double timeToRise () const
virtual ~CaloCachedShapeIntegrator ()

Private Attributes

double timeToRise_
std::vector< double > v_

Detailed Description

This class takes an existing Shape, and integrates it, summing up all the values, each nanosecond, up to the bunch spacing

Definition at line 12 of file CaloCachedShapeIntegrator.h.


Constructor & Destructor Documentation

CaloCachedShapeIntegrator::CaloCachedShapeIntegrator ( const CaloVShape aShape)

Definition at line 5 of file CaloCachedShapeIntegrator.cc.

References matplotRender::t, and v_.

                                                                               :
  v_(NBINS, 0.),
  timeToRise_(aShape->timeToRise())
{
  for(int t = 0; t < 256; ++t) 
  {
    double amount = (*aShape)(t);
    for(int istep = 0; istep < 25; ++istep) 
    {
      int ibin = t + istep;
      v_[ibin] += amount;
    }
  }
}
CaloCachedShapeIntegrator::~CaloCachedShapeIntegrator ( ) [virtual]

Definition at line 20 of file CaloCachedShapeIntegrator.cc.

{
}

Member Function Documentation

double CaloCachedShapeIntegrator::operator() ( double  startTime) const [virtual]

Implements CaloVShape.

Definition at line 31 of file CaloCachedShapeIntegrator.cc.

References NBINS, and v_.

{
  // round up, and account for the -25 ns offset 
  int ibin = static_cast<int>(startTime+25.0);
  return (ibin<0 || ibin >= NBINS) ? 0. : v_[ibin];
}
double CaloCachedShapeIntegrator::timeToRise ( ) const [virtual]

Implements CaloVShape.

Definition at line 25 of file CaloCachedShapeIntegrator.cc.

References timeToRise_.

{
   return timeToRise_;
}

Member Data Documentation

Definition at line 26 of file CaloCachedShapeIntegrator.h.

Referenced by timeToRise().

std::vector<double> CaloCachedShapeIntegrator::v_ [private]

Definition at line 25 of file CaloCachedShapeIntegrator.h.

Referenced by CaloCachedShapeIntegrator(), and operator()().