Re: [ROOT] possible bug in TTree::Draw: can't draw array elements

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Jun 02 2000 - 18:14:58 MEST


Hi Matt,
I have reported a few times to this list the restrictions in TTree::Draw
regarding multi-dim arrays.
Philippe Canal is currently working on a new algorithm in TTreeFormula
to support 2-d arrays with fix or dynamic size.

Rene Brun

On Wed, 31 May 2000, Matthew D. Langston wrote:

> There seems to be a bug in the "Draw" mechanism of the TTree and TChain
> classes when drawing elements of a multidimensional array.
> 
> The problem is that the "Draw" member function of both TTree and TChain
> produce histograms filled with zeroes when one tries to Draw the
> elements of an array.
> 
> For example, consider a tree with a branch of type "Float_t E[2][4]".
> The command
> 
>   root [0] tree->Draw("E[0][0]")
> 
> produces a histogram filled with zeroes for all entries.  However, after
> I then do this:
> 
>   root [1] tree->Draw("E")
> 
> (i.e. just "histogram the entire array"), then I can index the first
> dimension of the array, but still not the second, i.e.  TTree::Draw()
> can discriminate between different indices for the first dimension, but
> seems to ignore the second index of an array.  For example, both
> tree->Draw("E[0][0]") and tree->Draw("E[0][1]"), produce the same
> histogram.
> 
> The situation is even worse for a TChain, as there doesn't seem to be
> any way to index even the fist dimension of the array.
> 
> --
> Matthew D. Langston
> SLD, Stanford Linear Accelerator Center
> langston@SLAC.Stanford.EDU
> 650.926.3279
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:27 MET