Re: TH1 ranges

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 13 1997 - 12:10:27 MEST


Laurent Mirabito wrote:
> 
>         Hello,
> 
> I use TH1F histograms with huge number of bins (>30000) and I have
> some problems/remarks:
> 
> - Is there any way to set the range in axis value instead of  bins
>   value ( like H/PL 100(58.3:60.2) in PAW, I had to create a function
>   to do it with ROOT)?
> 
> - When I use TAxis::SetRange with bins numbers above 100000, it failed .
> 

This problem is now fixed in version 1.03.
In version 1.02, the first and last bin of the range are encoded
in 16 bits words.

> Finally when using a TTree with huge number of entries, the Draw
> function seems to consider only the first 10000 entries:
> 
> Example:
> 
> TTree* h1 contains 990000 entries with 2 branches one with the time T
> (every 2 ms) of measuremnt the other with the current I:
> 
>  h1->Draw("T","T>20","E",100000)
> 
> draws the time between 20 and 40 s only
> 
> If I book a TH1F with the good range (0,2000 s) it is filled
> properly.

By default, the estimation of the bins range is done on the
first 10000 events of the Tree. This is in general OK.
However, if your Tree contains data in increasing order,
this simple algorithm will not work.
You can change the default value of 10000 via TTree::SetEstimate.
for example h1->SetEstimate(100000);

Thanks for reporting the first problem.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:20 MET