Re: [ROOT] Inconsistency in ROOT documentation for Branch def

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Apr 27 2001 - 12:42:44 MEST


Hi Eddy,

In case of an array, f or &f have the same value.
So both forms will produce the same result.

Suzanne, for consistency in all examples, change:

   tree->Branch("fBranch",&f,"f[10]/F");
to
   tree->Branch("fBranch",f,"f[10]/F");

I take this opportunity to mention that there are many new tutorials
in version 3.01. In particular, we have added several examples showing
how to build Trees with different techniques. The examples show the
creation of the Tree and also examples how to read a tree.
This work is still not finished.
The previous tutorial tree1 has been renamed tree3.

Rene Brun

Eddy Offermann wrote:
> 
> Hi Susan,
> 
> Please have a look at http://www-pat.fnal.gov/root/Persistence/Persistence_v1.1.htm,
> section 2.1.3:
> 
> "With this Branch method, you can also add a leaf that holds an entire array of
> variables. To add an array of floats use the f[n] notation when describing the
> leaf.
> 
>    Float_t f[10];
>    tree->Branch("fBranch",&f,"f[10]/F");
> "
> and and the tutorial example tree1.C
> 
>    Float_t px[kMaxTrack];
>    t1->Branch("px",px,"px[ntrack]/F");
> 
> In the first one the address of the pointer is given ("&f") while
> in the second one ("px") just the pointer. The second definition
> is in agreement with case "A" in the tree description.
> 
> It is interesting to note that BOTH cases work !! Rene, how can that be ?
> 
> best regards, Eddy



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET