#include <HcalShapeIntegrator.h>
Public Member Functions | |
HcalShapeIntegrator (const HcalPulseShapes::Shape *aShape) | |
float | operator() (double startTime, double stopTime) const |
Private Member Functions | |
float | at (double time) const |
Private Attributes | |
int | nbin_ |
std::vector< float > | v_ |
This class takes an existing Shape, and integrates it, summing up all the values, each nanosecond
Definition at line 12 of file HcalShapeIntegrator.h.
HcalShapeIntegrator::HcalShapeIntegrator | ( | const HcalPulseShapes::Shape * | aShape | ) |
Definition at line 4 of file HcalShapeIntegrator.cc.
References HcalPulseShape::at(), nbin_, lumiQTWidget::t, and v_.
float HcalShapeIntegrator::at | ( | double | time | ) | const [private] |
Definition at line 19 of file HcalShapeIntegrator.cc.
References f, i, nbin_, and v_.
Referenced by operator()().
{ // shape is in 1 ns steps // I round down to match the old algorithm int i=(int)(t-0.5); float rv=0; if(i<0) { rv = 0.; } else if(i >= nbin_) { rv = v_.back(); } else { rv=v_[i]; // maybe interpolate // assume 1 ns bins float f = (t-0.5-i); if(++i < nbin_ && f > 0) { rv = rv*(1.-f)+ v_[i]*f; } } return rv; }
float HcalShapeIntegrator::operator() | ( | double | startTime, |
double | stopTime | ||
) | const |
Definition at line 41 of file HcalShapeIntegrator.cc.
References at().
int HcalShapeIntegrator::nbin_ [private] |
Definition at line 21 of file HcalShapeIntegrator.h.
Referenced by at(), and HcalShapeIntegrator().
std::vector<float> HcalShapeIntegrator::v_ [private] |
Definition at line 22 of file HcalShapeIntegrator.h.
Referenced by at(), and HcalShapeIntegrator().