Problems with ntuples

Jacek M. Holeczek (holeczek@us.edu.pl)
Sat, 27 Mar 1999 14:15:22 +0100 (MET)


Hi,
I have forgotten to answer the original question.
Note that n.Draw("something") creates a "default" 100 bin histogram and
the MIN and MAX of this histogram are guessed from the FIRST 10000 EVENTS
( see the fEstimate variable in the TTree source code ).
If you want to get a REAL/TRUE MIN and MAX you need to modify your macro :
-----------------------------------------
...
printf("min = %f\n",n->GetMinimum("xs"));
printf("max = %f\n",n->GetMaximum("xs"));
n->SetEstimate(n->GetEntries());
n->Draw("xs");
...
-----------------------------------------
Note :
1. your macro works if you have nsamples <= 21 - that's fine ->
simply the total number of entries in less than 10000 ( so all
entries are taken into account during "guess" )
2. your macro works for "zs" and "ys", but does not work for "xs"
- that's fine -> both "zs" and "ys" change their values from
min. to max. very "quickly" ( inner loops over "k" and "j" ),
so the "guess" procedure sees all "possible" values in the
first 10000 events, this is not the case with "xs" which is the
"slowest" in changing values ( outer loop over "i" ), so if the
total number of "events" exceeds 10000, the "guess" procedure
does not see "big" "xs" values
3. note here - if you increase the "nsamples" a lot - you will see
the same problem for "ys", and if you increase it again a lot,
you will see the same problem for "zs"
The "guess" procedure works well if you have "random" values of events
( that is in first 10000 events all possible "values" are present ), but
if you have an "ordered" ntuple, the "guess" is stupefied.
Jacek.