#include <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 detailsBasic3DVector::y.
{ unsigned int nBins = histo.GetNbinsX(); std::vector<double> y; y.reserve(nBins); double xMin = histo.GetXaxis()->GetXmin(); double xMax = histo.GetXaxis()->GetXmax(); double deltaX =(xMax - xMin) / nBins; for(unsigned int i = 0; i != nBins; ++i) { double x = xMin + (i + .5) * deltaX; if(x > fMin && x < fMax) { y.push_back(histo.GetBinContent(i+1)); } } init(fMin, fMax, y.begin(), y.end()); }