Histogram filling pb with THStack

Hi all,

I am facing a problem with a particular histogram ( the “multijet” component ) held within
a THStack. Attached is a ROOT file with that stack. Doing:
root > ->Draw(“hist”)

the first ( i.e xx_multijet ) doesn’t show-up, maybe a hint is by doing:

Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
Error in TCanvas::Range: illegal world coordinates range: x1=-37.500003, y1=0.000000, x2=337.500003, y2=0.000000
Error in TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.000000, ymin=0.000000, xmax=300.000000, ymax=0.000000

the histo has either >= 0. bins’ content and SetMinimum(10e-8), that’s it

What is wrong with that particular histogram ? Is there a way to anticipate the canvas error before drawing the
object so that I could provide a fix

test.root (8.23 KB)

I did:


which gives me the following image. It looks good to me …


thanks for looking into this, in fact if you’ll list the histograms in the stack you’ll notice there is
a missing one named “multijet” which is not displayed. I think I’ve found the cause of it: the size
of pad is set by using the Maximum value of the first histogram displayed, for some reason that
one has been set to 0. I think a better behaviour would be to set the pad size using the value returned
by the THStack::GetMaximum() instead of the first stacked histo one.


The size of the pad is set by computed the range containing all the histograms…
That’s the idea of THstack