Re: [ROOT] Draw a leaf of tree (leaf is array)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Dec 11 2002 - 14:40:30 MET


Hi,

What you do is illegal C++. TTree::Draw expects a valid string.
You can do:

 res->Draw(Form("diff_E_p4[%d]",i));

Rene Brun

On Wed, 11 Dec 2002, Perfetto Francesco wrote:

> Hi all,
> 
> I have a tree with any variables; any of these variables are array, I
> would like to know if there is an easy mode for draw it (for example in a
> cycle for).
> I make this but it don't work
> 
> TFile *f = new TFile("analisi_mc_prova.root","r");
> 
> for(Int_t i=0;i<7;i++)
>   res->Draw("diff_E_p4[i]");   <<---diff_E_p4 is an array of double
> 
> when run .x prova.C root tell me:
> ERROR 26 :
>  Unknown name : "i"
> 
> Ciao, Francesco.
> 



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