CMS 3D CMS Logo

CaloCachedShapeIntegrator.cc
Go to the documentation of this file.
2 
3 const int NBINS = 281; // 256, plus 25 before
4 
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 }
15 
17 
19 
20 double CaloCachedShapeIntegrator::operator()(double startTime) const {
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 }
double timeToRise() const override
CaloCachedShapeIntegrator(const CaloVShape *aShape)
Electronic response of the preamp.
Definition: CaloVShape.h:11
double operator()(double startTime) const override
const int NBINS