Normalization of RooHistPdf

Hi everyone,

Happy New Year 2020!

I created a RooHistPdf by passing a TH1 object to a RooDataHist and then using the RooDataHist to create a RooHistPdf. I am curious about 1) how the normalization is calculated in this basic case and 2) how to correctly get this normalization value. At least to my understanding, when converting a histogram to a pdf in regular ROOT, one can scale the histogram by hist->Integral(“width”) to make the histogram have unit area. Is this connected to how RooFit does it? Any explanation is appreciated!

Thanks you!


RooFit automatically calculates the normalisation when it’s necessary (e.g. when you fit).
You can read a bit about normalisation of all RooFit PDFs here:

To see what’s being used to normalise, you can to three things:

  • getVal() returns the bare unnormalised value
  • getVal(x) returns the normalised value assuming the the PDF integrated over the variable x has to have unit norm
  • getNorm(x) returns the integral of the PDF over x that you need to divide the result of getVal() by to get a normalised PDF.

In the case a of a histogram, the normalisation should simply be the total entry count. If the entries are weighted, it should be the effective entries, i.e. Sum(weight).

Hi StephanH,

Ah. I see. That clears things up for me. Thanks!