58 float time_interval = 0;
68 const double maxel ( *max_element( shapeArray.begin(), shapeArray.end() ) ) ;
70 const double maxelt ( 1.
e-5 < maxel ? maxel : 1 ) ;
72 for(
unsigned int i ( 0 ) ;
i != shapeArray.size(); ++
i )
74 shapeArray[
i] = shapeArray[
i]/maxelt ;
83 for(
unsigned int denseIndex ( 0 ) ; denseIndex !=
m_denseArraySize ; ++denseIndex )
87 const unsigned int ibin ( denseIndex/10 ) ;
93 shapeArray.size() == 1 + ibin )
95 value = shapeArray[ibin];
100 const double x ( xb - ( ibin + 0.5 )*time_interval ) ;
101 const double f1 ( shapeArray[ ibin - 1 ] ) ;
102 const double f2 ( shapeArray[ ibin ] ) ;
103 const double f3 ( shapeArray[ ibin + 1 ] ) ;
104 const double a ( f2 ) ;
105 const double b ( ( f3 - f1 )/(2.*time_interval) ) ;
106 const double c ( (( f1 + f3 )/2. - f2 )/(time_interval*time_interval) );
107 value = a + b*x + c*x*
x;
108 deriv = ( b + 2*c*
x )/delta ;
114 if( 0 < denseIndex &&
143 LogDebug(
"EcalShapeBase") <<
" ECAL MGPA shape requested for out of range time " << aTime ;
virtual void fillShape(float &time_interval, double &m_thresh, EcalShapeBase::DVec &aVec, const edm::EventSetup *es) const =0
double derivative(double time) const
unsigned int m_denseArraySize
~EcalShapeBase() override
std::vector< double > DVec
unsigned int timeIndex(double aTime) const
double m_firstTimeOverThreshold
void m_shape_print(const char *fileName)
double operator()(double aTime) const override
unsigned int m_indexOfMax
unsigned int m_firstIndexOverThreshold
void setEventSetup(const edm::EventSetup &evtSetup)
const edm::EventSetup * m_es
unsigned int m_kNBinsPerNSec
double timeToRise() const override