Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:55

0001 #include "FastSimulation/Utilities/interface/HistogramGenerator.h"
0002 
0003 //#include "TAxis.h"
0004 
0005 double HistogramGenerator::ersatzt(double x) {
0006   int ibin = theXaxis->FindBin(x);
0007   //  std::cout << x << " Bin " << ibin << std::endl;
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   // std::cout << " X1 " << x1 <<" X2 " << x2 << " Y1 " <<y1 << " Y2 " << y2 << std::endl;
0017   return y2 + (y1 - y2) * (x2 - x) / (x2 - x1);
0018 }