12 : m_useDBShape(useDBShape),
13 m_firstIndexOverThreshold(0),
14 m_firstTimeOverThreshold(0.0),
32 float time_interval = 0;
48 const double maxel(*max_element(shapeArray.begin(), shapeArray.end()));
50 const double maxelt(1.
e-5 < maxel ? maxel : 1);
53 for (
unsigned int i(0);
i != shapeArray.size(); ++
i) {
54 shapeArray[
i] = shapeArray[
i] / maxelt;
62 for (
unsigned int denseIndex(0); denseIndex !=
m_denseArraySize; ++denseIndex) {
65 const unsigned int ibin(denseIndex / 10);
70 if (0 == ibin || shapeArray.size() == 1 + ibin)
72 value = shapeArray[ibin];
75 const double x(xb - (ibin + 0.5) * time_interval);
76 const double f1(shapeArray[ibin - 1]);
77 const double f2(shapeArray[ibin]);
78 const double f3(shapeArray[ibin + 1]);
80 const double b((f3 -
f1) / (2. * time_interval));
81 const double c(((
f1 + f3) / 2. -
f2) / (time_interval * time_interval));
107 LogDebug(
"EcalShapeBase") <<
" ECAL MGPA shape requested for out of range time " << aTime;
129 fs <<
"vec.push_back(" <<
i <<
");\n";
double derivative(double time) const
virtual void fillShape(float &time_interval, double &m_thresh, EcalShapeBase::DVec &aVec, const edm::EventSetup *es) const =0
double timeToRise() const override
unsigned int m_denseArraySize
~EcalShapeBase() override
std::vector< double > DVec
double m_firstTimeOverThreshold
void setEventSetup(const edm::EventSetup &evtSetup, bool normalize=true)
unsigned int m_indexOfMax
float normalize(float in)
unsigned int m_firstIndexOverThreshold
void m_shape_print(const char *fileName) const
unsigned int timeIndex(double aTime) const
void buildMe(const edm::EventSetup *=nullptr, bool normalize=true)
unsigned int m_kNBinsPerNSec
double operator()(double aTime) const override