52 const double maxel ( *max_element( shapeArray.begin(), shapeArray.end() ) ) ;
54 const double maxelt ( 1.
e-5 < maxel ? maxel : 1 ) ;
56 for(
unsigned int i ( 0 ) ;
i != shapeArray.size(); ++
i )
58 shapeArray[
i] = shapeArray[
i]/maxelt ;
82 shapeArray.size() == 1 + ibin )
84 value = shapeArray[ibin];
89 const double x ( xb - ( ibin + 0.5 ) ) ;
90 const double f1 ( shapeArray[ ibin - 1 ] ) ;
91 const double f2 ( shapeArray[ ibin ] ) ;
92 const double f3 ( shapeArray[ ibin + 1 ] ) ;
93 const double a ( f2 ) ;
94 const double b ( ( f3 - f1 )/2. ) ;
95 const double c ( ( f1 + f3 )/2. - f2 ) ;
96 value = a + b*x + c*x*
x;
97 deriv = ( b + 2*c*
x )/delta ;
101 if( 0 !=
m_derivPtr ) (*m_derivPtr)[ j ] = deriv;
134 LogDebug(
"EcalShapeBase") <<
" ECAL MGPA shape requested for out of range time " << aTime ;
double operator()(double aTime) const
double derivative(double time) const
virtual double threshold() const =0
static const double qNSecPerBin
EcalShapeBase(bool aSaveDerivative)
std::vector< double > DVec
unsigned int timeIndex(double aTime) const
double m_firstTimeOverThreshold
virtual void fillShape(DVec &aVec) const =0
unsigned int m_indexOfMax
unsigned int m_firstIndexOverThreshold
virtual double timeToRise() const