File indexing completed on 2023-03-17 11:01:02
0001 #include "FastSimulation/Utilities/interface/HistogramGenerator.h"
0002
0003
0004
0005 double HistogramGenerator::ersatzt(double x) {
0006 int ibin = theXaxis->FindBin(x);
0007
0008 double x1 = myHisto->GetBinLowEdge(ibin);
0009 double x2 = x1 + myHisto->GetBinWidth(ibin);
0010 double y1 = myHisto->GetBinContent(ibin);
0011 double y2;
0012 if (ibin < nbins)
0013 y2 = myHisto->GetBinContent(ibin + 1);
0014 else
0015 y2 = y1;
0016
0017 return y2 + (y1 - y2) * (x2 - x) / (x2 - x1);
0018 }