# Normalization of RooHistPdf

**URL:** <https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401>\
**Category:** Newbie\
**Created:** [January 3, 2020, 2:57am UTC](https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401 "2020-01-03T02:57:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ilam/32/19180_2.png) [@ilam](https://root-forum.cern.ch/u/ilam)\
**Post date:** [January 3, 2020, 2:57am UTC](https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401/1 "2020-01-03T02:57:49Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [January 6, 2020, 9:23am UTC](https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401/2 "2020-01-06T09:23:39Z")

</div>

Hi,

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:  
[https://root.cern.ch/doc/master/classRooAbsPdf.html](https://root.cern.ch/doc/master/classRooAbsPdf.html)

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)`.

---

<div class="post-metadata">

**Author:** ![ilam](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ilam/32/19180_2.png) [@ilam](https://root-forum.cern.ch/u/ilam)\
**Post date:** [January 8, 2020, 11:05pm UTC](https://root-forum.cern.ch/t/normalization-of-roohistpdf/37401/3 "2020-01-08T23:05:36Z")

</div>

Hi StephanH,

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