Accessing overflows in a histogram


Can anyone please suggest some way to access overflows in a histogram so as to get the correct integral value of the histogram?



That would work with “histo.GetBinContent(N+1)”, for a histogram with N bins.

If you create a histogram with N bins, then the histogram object will contain N+2 bins. n=0 is the bin of the underflow, n={1, … N} are the defined bins (which you can see if you draw the histogram etc) and n=(N+1) gives the entries beyond the defined upper border of the histogram, therefore the overflow.

As for integrals, you can explicitly call “histo.Integral(0,N+1)”, then the return value will equal the total number of entries (the default is: “histo.Integral()” is identical to “histo.Integral(1,N)”).

I think the TH1 page in the class index (especially the description header) contains some additional information on this, but I guess the first line should adress your question.

Cheers, Wolfgang