RE: [ROOT] TLeaf->GetName() gets title ?

From: Philippe Canal (pcanal@fnal.gov)
Date: Thu Jun 19 2003 - 22:09:29 MEST


Hi Markus,

In the description:
    *Br    0 :varname   : this is its description/F
the correct semantics is:
    *Br    0 :branchName: leafName/F

Note that you could have:
    *Br    0 :branchName: leafName/F:otherLeafName/F

To be able to use TTree::Draw you need to have leafNames that have NO space
in them.

Your code to automatically draw each leaves is correct but you would need to
renamed the leaf (what you called "this is its description") into a word
without any spaces.

Cheers,
Philippe.



-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Markus Cristinziani
Sent: Thursday, June 19, 2003 2:03 PM
To: roottalk@pcroot.cern.ch
Subject: Re: [ROOT] TLeaf->GetName() gets title ?


Hi Rene,

yes I forgot to copy and paste the line
leaf = (TLeaf*)next().

when I do
tree->GetListOfLeaves()->ls();

I get
root [8] selectedtree->GetListOfLeaves()->ls()
OBJ: TLeafF    this is its description    this is its description : 0 at:
0x8b9eb78
...

instead of the (expected?)
OBJ: TLeafF    variablename   this is its description : 0 at:
0x8b9eb78
...

regards
Markus


   ____________________________________________
  /  Markus Cristinziani, Research Associate  /
 /    Stanford Linear Accelerator Center     /
/ ++1(650)926-3886 markus@slac.stanford.edu /
--------------------------------------------

On Thu, 19 Jun 2003, Rene Brun wrote:

> Hi Markus,
>
> In your example, you have omitted the most critical part: how you get
> the leaf pointer?
> The following should work:
>
> TLeaf *leaf;
> TIter next (tree->GetListOfLeaves());
> while ((leaf = (TLeaf*)next())) {
>    tree->Draw(leaf->GetName());
> }
>
> I would need your code to figure out the problem.
> What is the ouput of:
>   tree->GetListOfLeaves()->ls(); ?
>
> Rene Brun
>
> Markus Cristinziani wrote:
> >
> > Hello,
> >
> > I have a simple tree and I would like to histogram all variables in an
> > automatic way. I do the following in 3.03/09
> >
> > TFile f("myfile.root");
> > tree->Print;
> >
> > ...
> >
****************************************************************************
**
> > *Br    0 :varname   : this is its description/F
> > *
> > *Entries :     8877 : Total  Size=      48065 bytes  File Size  =
28030 *
> > *Baskets :        1 : Basket Size=      32000 bytes  Compression=   1.14
> > *
> >
*...........................................................................
.*
> > ...
> >
> > TLeaf *leaf;
> > TIter next (tree->GetListOfLeaves());
> > leaf->GetTitle(); -> "this is its description"
> > leaf->GetName();  -> "this is its description"
> >
> > i.e. I don't get its name, so I can't do tree->Draw(leaf->GetName());
> >
> > *ERROR 26 :
> >  Unknown name : "thisisitsdescription"
> >
> > Any suggestions ?
> >
> >                                         Thanks,
> >                                         Markus
> >
> >    ____________________________________________
> >   /  Markus Cristinziani, Research Associate  /
> >  /    Stanford Linear Accelerator Center     /
> > / ++1(650)926-3886 markus@slac.stanford.edu /
> > --------------------------------------------
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET