Re: [ROOT] Adding one more element to a tree

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Tue Sep 03 2002 - 17:28:58 MEST


Hi Francois-Xavier, 

Make a friend tree.   (see docs on how to do that). 

Yours, 

 ____ |  Christian Holm Christensen 
  |_| |	 -------------------------------------------------------------
    | |	 Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|	          DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|	          Denmark                    Office: (+45) 353  25 305
 ____|	 Email:   cholm@nbi.dk               Web:    www.nbi.dk/~cholm
 | |


On Tue, 3 Sep 2002 16:19:32 +0200 
GENTIT Francois-Xavier  DAPNIA <GENTIT@dapnia.cea.fr> wrote
concerning "[ROOT] Adding one more element to a tree":
>   Dear Rooters,
>   What is the trick to add more elements to an already existing tree?
>   To try to find it myself, I have taken the example "staff.C" in the
> tutorials. I have split cernstaff.dat into cernstaff1.dat and
> cernsatff2.dat, cernstaff1.dat being without the last element of
> cernstaff.dat, and cernstaff2.dat containing only this last element.
>   I have then run "staff.C", obtaining correctly a tree of 3353 elements.
>   Then I have run a script "staff2.C", which is identical with staff.C,
> except for these 3 lines:
> 
>    FILE *fp = fopen("cernstaff2.dat","r");
> 
>    TFile *f = new TFile("staff.root","UPDATE");     [instead of "RECREATE"]
>    TTree *tree = (TTree *)f->Get("T");        [instead of new TTree]
> 
>   But instead of obtaining a tree with 3354 elements, I obtain 2 trees, the
> first T;1 one with 3353 elements, and a second one, T;2 with 1 element!!
> 
>   Thanks for your help
> 
> François-Xavier Gentit
> DAPNIA/SPP CEA Saclay
> http://gentit.home.cern.ch/gentit/
> 
> 



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