Below is an image produced by a drawing macro. The bottom pad histogram appears to be drawn incorrectly.
This histogram has uniform bin widths except for the two highest energy bins, which are larger.
The axis are created using TH1F *hr1 = pad->DrawFrame(0.0, -3.0, 5.0, 3.0);.
A TLine object is then drawn followed by a histogram with the option "histsame".
I don’t know why ROOT would draw the two ends of the histogram with these vertical lines. I don’t know where they go to, but I assume it is -infinity.
I tried drawing with the option ][histsame. But that looked strange because the edges were missing.
Is there some kind of workaround?
I’ve not noticed this before, but I only recently changed my code to use non-uniform binning. Previously the histogram was defined with bins over the full x-axis range: 0.0 to 5.0. Now it is defined fom 0.3 to 3.5.
I would assume this has nothing to do with the over/underflow bins since these should contain zero.
Here is a list of corresponding bin content values.
The workaround I am using is to add an additional bin either side which extends to the axis limit. This may require an update to other analysis code to ignore the two empty bins at either extreme.
@couet but why do we draw a line towards -inf here, in case these bins are empty? Or are they not empty? What’s the bin content of the X^2 pull hist at bin 3.5…5?