To my understanding, I believe this is incorrect behavior because the normalization will be wrong.

In general, I believe each event should be normalized by w/(sum of w) where w = event weight. The sum of weights should include weights from all events filled regardless of whether it went into under/overflow. This can be seen in the extreme case where e.g. events only enter the overflow, where otherwise the supposed normalization factor has a 0 in the denominator i.e. is infinite.

Hi,
the histogram normalization is computed normally using only the entries in the histogram range (i.e. excluding underflow and overflow).
TH1::GetSumOfWeights does not consider the underflow and overflows.
This is documented in root.cern.ch/root/htmldoc/TH1.ht … mOfWeights

[quote=“moneta”]Hi,
the histogram normalization is computed normally using only the entries in the histogram range (i.e. excluding underflow and overflow).
TH1::GetSumOfWeights does not consider the underflow and overflows.
This is documented in root.cern.ch/root/htmldoc/TH1.ht … mOfWeights

Best Regards
Lorenzo[/quote]

Hi Lorenzo,

Thanks, I see that now in the documentation. But why is that the case? I believe the argument I gave about that the sum of weights should include underflow and overflow bins was correct.

your argument does not make much sense to me, because if the are are no events in the histograms, there is nothing to normalize.
I remind you that also all the histogram statistics, sum of weights, sum of weights square, mean , standard deviation, etc… it is computed using only the events in the histogram range.
See root.cern.ch/root/htmldoc/TH1.html#TH1:GetStats