Many of the different ways mentioned in that posts are not correct, e.g. using histogram entries, only SetBinContent and not SetBinError, etc…
I think for this reason is worth having a function which calls TH1::Scale in the correct way.
There are only 2 cases:
- normalise by the total counts (integral) to show the frequency probability in each bin
- normalise by the total counts * bin width to show the estimated probability density function
If we want to be more precise there is also the question of underflow/overflow.
When normalizing by the total counts we could in principle include underflow/overflow, while we cannot do in the second case because we don’t know the underflow/overflow bin width.