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)
 
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::CaloCachedShapeIntegrator ( const CaloVShape aShape)

Definition at line 5 of file CaloCachedShapeIntegrator.cc.

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 }

References submitPVValidationJobs::t, and v_.

◆ ~CaloCachedShapeIntegrator()

CaloCachedShapeIntegrator::~CaloCachedShapeIntegrator ( )
override

Definition at line 16 of file CaloCachedShapeIntegrator.cc.

16 {}

Member Function Documentation

◆ operator()()

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

Implements CaloVShape.

Definition at line 20 of file CaloCachedShapeIntegrator.cc.

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 }

References NBINS, and v_.

◆ timeToRise()

double CaloCachedShapeIntegrator::timeToRise ( ) const
overridevirtual

Implements CaloVShape.

Definition at line 18 of file CaloCachedShapeIntegrator.cc.

18 { return timeToRise_; }

References timeToRise_.

Member Data Documentation

◆ timeToRise_

double CaloCachedShapeIntegrator::timeToRise_
private

Definition at line 23 of file CaloCachedShapeIntegrator.h.

Referenced by timeToRise().

◆ v_

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

Definition at line 22 of file CaloCachedShapeIntegrator.h.

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

NBINS
const int NBINS
Definition: CaloCachedShapeIntegrator.cc:3
CaloCachedShapeIntegrator::v_
std::vector< double > v_
Definition: CaloCachedShapeIntegrator.h:22
CaloVShape::timeToRise
virtual double timeToRise() const =0
CaloCachedShapeIntegrator::timeToRise_
double timeToRise_
Definition: CaloCachedShapeIntegrator.h:23
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644