CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
 
double operator() (double startTime) const override
 
double timeToRise () const override
 
 ~CaloCachedShapeIntegrator () override
 
- 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 relval_steps::istep, submitPVValidationJobs::t, and v_.

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

Definition at line 16 of file CaloCachedShapeIntegrator.cc.

16 {}

Member Function Documentation

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

Implements CaloVShape.

Definition at line 20 of file CaloCachedShapeIntegrator.cc.

References NBINS, and v_.

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

Implements CaloVShape.

Definition at line 18 of file CaloCachedShapeIntegrator.cc.

References timeToRise_.

Member Data Documentation

double CaloCachedShapeIntegrator::timeToRise_
private

Definition at line 23 of file CaloCachedShapeIntegrator.h.

Referenced by timeToRise().

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

Definition at line 22 of file CaloCachedShapeIntegrator.h.

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