Re: [ROOT] TTree 2-d plot problem

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 21 2002 - 20:19:03 MEST


Hi Peter,

Thanks for giving me your file. The problem is easy to explain.
Your tree has 9.4 million entries and one of your variable "frame"
grows with the entry number.

By default, Root creates buffers to store the intermediate results
before histograming (see TTree::SetEstimate). Root creates a buffer
with a size corresponding to the number of entries if the number of
entries is smaller than one million. Above one million, the binning
is based on the buffer info in case of 2-d histograms. Binning
is fully automatic in case of 1-d histograms. The same algorithm should
in principle also be used for 2-d, but apparently it is not activated
in your example (I have to understand why).
You have two solutions to this problem
 - call T.SetEstimate(9400000), then
  T.Draw("adc:frame"); //will be slow to render 9.4 million dots
  or better T.Draw("adc:frame","","box");

 - simply do
  T.Draw("adc:frame>>h2(50,0,150,20,0,10000)","","box");
   (see TTree::Draw documentation)

I have a remark about your Tree structure. You have one single branch
*Br    0 :br        : tframe/I:adc:minderCh:masterCh:errc:tstamp
*Entries :  9434355 : Total  Size=  226956198 bytes  File Size  =
48059912 *
*Baskets :     7093 : Basket Size=      32000 bytes  Compression=   4.72

You better create a Tree with one branch per variable. Your Tree will be
smaller and you will gain at least  a factor 2 in TTree::Draw.

Rene Brun

On Wed, 21 Aug 2002, Peter Shanahan wrote:

> Hi Rene,
> 
>    The root file location is in my previous message to you.
> 
>    The root version is 3.03/07.  I made the tree within our minos
> version of root, and get the same bad result whether I analyse with
> the minos version or root proper.  The draw command that doesn't work
> is simply
> 
>   T->Draw("adc:tframe")
> 
>   It immediately sets the X axis from 0. to 50., and depending on the
> machine, the root session may or may not seize.
> 
>   On the contrary,
> 
>   T->Draw("tframe") works just fins, with the correct range of about
> (0.,100.)
> 
>   Many thanks,
> 
> Peter Shanahan
> 
> On Sat, 17 Aug 2002, Rene Brun wrote:
> 
> > Hi Peter,
> >
> > Could you put your file in some public area/web server
> > and let me know the address as well as the TTree::Draw
> > command that shows this problem?
> > Which version of Root are you using?
> >
> > Rene Brun
> >
> >
> > On Fri, 16 Aug 2002, Peter Shanahan wrote:
> >
> > > Dear Root Experts,
> > >
> > >      I am having trouble with a simple, 1 branch TTree.  Since the problem
> > > doesn't occur for smaller TTrees (less than 5-10 Mb), the debugging loop
> > > is very slow.
> > >
> > >      So, my first and main question is, is there a way to check the sanity
> > > of a tree, beyond TTree::Print()?
> > >
> > >      My second question is, does the odd behavior described below ring
> > > a bell with anyone?  Is there something about how TTree::Draw() gets
> > > variable ranges for 2-D plots that offers a clue to what I might be
> > > doing wrong?
> > >
> > >      I write the tree to a file, close the file, and open it in a
> > > completely new session, which knows nothing of the macro I used to create
> > > and fill the tree.  TTree::Print() looks fine.  1-D plots are fine, with
> > > or without cuts on other variables.   TTree::Scan() is also fine.
> > >
> > >      When I try to do a 2-D plot, however, axes are drawn almost
> > > immediately, with too small a range for one of the variables, in at
> > > least one case.  (That case involves a variable that is monotonic in
> > > entry number).  The memory usage of the root process goes to 3 times the
> > > normal level, and it takes much, much longer to draw than a 1-D plot.
> > >
> > >      Any ideas?  Many Thanks,
> > >
> > > Peter Shanahan
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:05 MET