CMS 3D CMS Logo

funct::RootHistoPdf Class Reference

#include <PhysicsTools/Utilities/interface/HistoPdf.h>

Inheritance diagram for funct::RootHistoPdf:

funct::HistoPdf

List of all members.

Public Member Functions

 RootHistoPdf (const TH1 &histo, double fMin, double fMax)


Detailed Description

Definition at line 71 of file HistoPdf.h.


Constructor & Destructor Documentation

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     }


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:47:03 2009 for CMSSW by  doxygen 1.5.4