CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CaloCachedShapeIntegrator Class Reference

#include <CaloCachedShapeIntegrator.h>

Inheritance diagram for CaloCachedShapeIntegrator:
CaloVShape

Public Member Functions

 CaloCachedShapeIntegrator (const CaloVShape *aShape)
 
virtual double operator() (double startTime) const
 
virtual double timeToRise () const
 
virtual ~CaloCachedShapeIntegrator ()
 
- Public Member Functions inherited from CaloVShape
 CaloVShape ()
 
virtual ~CaloVShape ()
 

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 lumiQTWidget::t, and v_.

5  :
6  v_(NBINS, 0.),
7  timeToRise_(aShape->timeToRise())
8 {
9  for(int t = 0; t < 256; ++t)
10  {
11  double amount = (*aShape)(t);
12  for(int istep = 0; istep < 25; ++istep)
13  {
14  int ibin = t + istep;
15  v_[ibin] += amount;
16  }
17  }
18 }
virtual double timeToRise() const =0
const int NBINS
CaloCachedShapeIntegrator::~CaloCachedShapeIntegrator ( )
virtual

Definition at line 20 of file CaloCachedShapeIntegrator.cc.

21 {
22 }

Member Function Documentation

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

Implements CaloVShape.

Definition at line 31 of file CaloCachedShapeIntegrator.cc.

References NBINS, and v_.

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

Implements CaloVShape.

Definition at line 25 of file CaloCachedShapeIntegrator.cc.

References timeToRise_.

26 {
27  return timeToRise_;
28 }

Member Data Documentation

double CaloCachedShapeIntegrator::timeToRise_
private

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()().