Problem drawing a tree leave

Again, another of my questions…

I have a root file that seems to be ok. then do the following:

root [0] TFile file("trouble.root");
root [1] TNtupleD* tuple = (TNtupleD*) gROOT->FindObject("angRes");
root [2] tuple->Draw("theta_theo");                                

And get pure garbage in the canvas (all entries should be in the same bin, nothing fancy. On the other hand, if I do

root [0] TFile file("trouble.root");
root [1] TNtupleD* tuple = (TNtupleD*) gROOT->FindObject("angRes");
root [2] tuple->Draw("theta - theta_theo");                                

It gives me the result I really want so I’m happy, but with the question: “what went wrong???”

I’m attaching the file and a screenshot of the canvas. I’m using Root 4.02/00, built from source, running on SuSE 9.2, gcc version 3.3.4

Your files are not yet available. We would need them in order to provide any insight.


oops, here they go.

The funny thing is that the canvas shows the right average value and a very small deviation, as it should, but it doesn’t show the right plot. With another file I wasn’t lucky enough to get the right result by plotting the difference but still the canvas was showing the right average. I hope this is simple to solve.

drawing_issue.tar.gz (18.9 KB)

I changed the TNtupleD by TNtuple and it seems to work fine.


This is a problem of numerical stability. Since you have a series of double which have approximavely the value 20, TTree::Draw is trying to give you have much precision as possible. So in this case it dimension the histogram to range from 1.99999999999998690e+001 to 1.99999999999999930e+001
with 100 bins.
You can solve the problem by pre-dimensions the histogram, for example:



right. I couldn’t read the labels, I guess because they were crowded. That also explains why when I cast the numbers into floats it works.