#include <PhysicsTools/Utilities/interface/HistoPdf.h>
Public Member Functions | |
RootHistoPdf (const TH1 &histo, double fMin, double fMax) |
Definition at line 71 of file HistoPdf.h.
funct::RootHistoPdf::RootHistoPdf | ( | const TH1 & | histo, | |
double | fMin, | |||
double | fMax | |||
) | [inline, explicit] |
Definition at line 73 of file HistoPdf.h.
References i, funct::HistoPdf::init(), x, and y.
00073 { 00074 unsigned int nBins = histo.GetNbinsX(); 00075 std::vector<double> y; 00076 y.reserve(nBins); 00077 double xMin = histo.GetXaxis()->GetXmin(); 00078 double xMax = histo.GetXaxis()->GetXmax(); 00079 double deltaX =(xMax - xMin) / nBins; 00080 for(unsigned int i = 0; i != nBins; ++i) { 00081 double x = xMin + (i + .5) * deltaX; 00082 if(x > fMin && x < fMax) { 00083 y.push_back(histo.GetBinContent(i+1)); 00084 } 00085 } 00086 init(fMin, fMax, y.begin(), y.end()); 00087 }