I just stumbled across something strange. When drawing a TH1 with the “BAR” option, error bars appear on top of it when Sumw2() is also used. If Sumw2() is never called for the histogram, no error bars are shown. Also, when drawing with the “HBAR” option no error bars appear.
This probably is not intentional, is it? If it is, should I have found this documented somewhere?
This behaviour occurs in v5.12.00 and still in v5.16.00. The snippet below reproduces it.
Well, not really. The effect of drawing with “BAR hist” is that the “hist” option is used to draw the histogram, and it looks like the “BAR” option is skipped completely. This means that one does not obtain bars with width and offset ruled by SetBarWidth() and SetBarOffset(), but just a bar over the full bin width.
Apart from that the real questions are:
Why only draw errors (and the markers, by the way) if Sumw2() is called? Without this, the errors still exist.
Why not draw errors for the “HBAR” option? They would make just as much sense as for the “BAR” case.
I don’t remember if it ever behaved differently actually. I just checked with v4.04/02 on my laptop (OS X 10.4.10) and there the behaviour is exactly the same. I probably just never ran into the `right’ combination of settings to see this.