58 float time_interval = 0;
69 const double maxel ( *max_element( shapeArray.begin(), shapeArray.end() ) ) ;
71 const double maxelt ( 1.
e-5 < maxel ? maxel : 1 ) ;
73 for(
unsigned int i ( 0 ) ;
i != shapeArray.size(); ++
i )
75 shapeArray[
i] = shapeArray[
i]/maxelt ;
84 for(
unsigned int denseIndex ( 0 ) ; denseIndex !=
m_denseArraySize ; ++denseIndex )
88 const unsigned int ibin ( denseIndex/10 ) ;
94 shapeArray.size() == 1 + ibin )
96 value = shapeArray[ibin];
101 const double x ( xb - ( ibin + 0.5 )*time_interval ) ;
102 const double f1 ( shapeArray[ ibin - 1 ] ) ;
103 const double f2 ( shapeArray[ ibin ] ) ;
104 const double f3 ( shapeArray[ ibin + 1 ] ) ;
105 const double a ( f2 ) ;
106 const double b ( ( f3 - f1 )/(2.*time_interval) ) ;
107 const double c ( (( f1 + f3 )/2. - f2 )/(time_interval*time_interval) );
108 value = a + b*x + c*x*
x;
109 deriv = ( b + 2*c*
x )/delta ;
115 if( 0 < denseIndex &&
144 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