00001 #include "FastSimulation/Utilities/interface/HistogramGenerator.h" 00002 00003 //#include "TAxis.h" 00004 00005 double HistogramGenerator::ersatzt(double x) 00006 { 00007 int ibin=theXaxis->FindBin(x); 00008 // std::cout << x << " Bin " << ibin << std::endl; 00009 double x1=myHisto->GetBinLowEdge(ibin); 00010 double x2=x1+myHisto->GetBinWidth(ibin); 00011 double y1=myHisto->GetBinContent(ibin); 00012 double y2; 00013 if(ibin<nbins) 00014 y2=myHisto->GetBinContent(ibin+1); 00015 else 00016 y2=y1; 00017 // std::cout << " X1 " << x1 <<" X2 " << x2 << " Y1 " <<y1 << " Y2 " << y2 << std::endl; 00018 return y2 + (y1-y2)*(x2-x)/(x2-x1); 00019 }