CMS 3D CMS Logo

List of all members | Public Member Functions
funct::RootHistoPdf Class Reference

#include <HistoPdf.h>

Inheritance diagram for funct::RootHistoPdf:
funct::HistoPdf

Public Member Functions

 RootHistoPdf (const TH1 &histo, double fMin, double fMax)
 
- Public Member Functions inherited from funct::HistoPdf
void dump ()
 
 HistoPdf ()
 
template<typename Iterator >
 HistoPdf (double xMin, double xMax, const Iterator &begin, const Iterator &end)
 
template<typename Iterator >
void init (double xMin, double xMax, const Iterator &begin, const Iterator &end)
 
double operator() (double x) const
 
void rebin (unsigned int r)
 

Detailed Description

Definition at line 74 of file HistoPdf.h.

Constructor & Destructor Documentation

◆ RootHistoPdf()

funct::RootHistoPdf::RootHistoPdf ( const TH1 &  histo,
double  fMin,
double  fMax 
)
inlineexplicit

Definition at line 76 of file HistoPdf.h.

76  {
77  unsigned int nBins = histo.GetNbinsX();
78  std::vector<double> y;
79  y.reserve(nBins);
80  double xMin = histo.GetXaxis()->GetXmin();
81  double xMax = histo.GetXaxis()->GetXmax();
82  double deltaX = (xMax - xMin) / nBins;
83  for (unsigned int i = 0; i != nBins; ++i) {
84  double x = xMin + (i + .5) * deltaX;
85  if (x > fMin && x < fMax) {
86  y.push_back(histo.GetBinContent(i + 1));
87  }
88  }
89  init(fMin, fMax, y.begin(), y.end());
90  }

References timingPdfMaker::histo, mps_fire::i, funct::HistoPdf::init(), seedmultiplicitymonitor_newtracking_cfi::nBins, multiplicitycorr_cfi::xMax, and photonAnalyzer_cfi::xMin.

DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:355
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
funct::HistoPdf::init
void init(double xMin, double xMax, const Iterator &begin, const Iterator &end)
Definition: HistoPdf.h:24
DDAxes::x
photonAnalyzer_cfi.xMin
xMin
Definition: photonAnalyzer_cfi.py:82
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
multiplicitycorr_cfi.xMax
xMax
Definition: multiplicitycorr_cfi.py:5