CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloCachedShapeIntegrator.cc
Go to the documentation of this file.
2 
3 const int NBINS = 281; // 256, plus 25 before
4 
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 }
19 
21 {
22 }
23 
24 double
26 {
27  return timeToRise_;
28 }
29 
30 double
31 CaloCachedShapeIntegrator::operator() ( double startTime ) const
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 }
37 
38 
CaloCachedShapeIntegrator(const CaloVShape *aShape)
Electronic response of the preamp.
Definition: CaloVShape.h:11
virtual double operator()(double startTime) const
const int NBINS
virtual double timeToRise() const