Re: TTree problem

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Mon, 6 Mar 2006 17:59:33 +0100 (MET)


The problem is due to the fact that all cycles have the same name. When importing t2, t1 with name "isgr_src__lcr" is replaced by t2. You can workaround this problem by calling

   t1->SetName("t1");

Rene Brun

6 Mar 2006, PRODUIT Nicolas wrote:

> Hi,
>
> I have a problem accessing two different cycles of a TREE in a TFile.
> I open a root file (there are some warning due to the fact that class
> used to write the file is not known to root, but this is not a problem)
> Access a cycle of a tree and then access another cycle,
> it seems then that I loose access to first cycle.
>
>
> isdcsf3:0053 495> root
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 4.03/02 10 August 2005 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> FreeType Engine v2.1.3 used to render TrueType fonts.
> Compiled for solarisCC5.
>
> CINT/ROOT C/C++ Interpreter version 5.15.159, Nov 14 2004
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] a = new TFile("005300010010.root")
> Warning in <TClass::TClass>: no dictionary for class TFIOElement is available
> Warning in <TClass::TClass>: no dictionary for class TFHeader is available
> Warning in <TClass::TClass>: no dictionary for class TFAttr<int,IntFormat> is
> available
> Warning in <TClass::TClass>: no dictionary for class TFBaseAttr is available
> Warning in <TClass::TClass>: no dictionary for class
> TFAttr<TString,StringFormat> is available
> Warning in <TClass::TClass>: no dictionary for class
> TFAttr<double,DoubleFormat> is available
> Warning in <TClass::TClass>: no dictionary for class TFAttr<bool,BoolFormat>
> is available
> (class TFile*)0xbbfee8
> root [1] a->ls()
> TFile** 005300010010.root
> TFile* 005300010010.rooisgr_src__lcrt
> KEY: TFIOElement isgr_src__lcr_idx_h;1 header
> KEY: TFIOElement isgr_src__lcr_h;6 header
> KEY: TFIOElement isgr_src__lcr_h;5 header
> KEY: TFIOElement isgr_src__lcr_h;4 header
> KEY: TFIOElement isgr_src__lcr_h;3 header
> KEY: TFIOElement isgr_src__lcr_h;2 header
> KEY: TFIOElement isgr_src__lcr_h;1 header
> KEY: TTree isgr_src__lcr_idx;1 isgr_src__lcr_idx
> KEY: TTree isgr_src__lcr;6 isgr_src__lcr
> KEY: TTree isgr_src__lcr;5 isgr_src__lcr
> KEY: TTree isgr_src__lcr;4 isgr_src__lcr
> KEY: TTree isgr_src__lcr;3 isgr_src__lcr
> KEY: TTree isgr_src__lcr;2 isgr_src__lcr
> KEY: TTree isgr_src__lcr;1 isgr_src__lcr
> root [2] TTree *t1=(TTree *)a->Get("isgr_src__lcr;1")
> root [3] t1->Scan("rate","","",1)
> ************************
> * Row * rate *
> ************************
> * 0 * 0.1858241 *
> ************************
> (long long)1
> root [4] TTree *t2=(TTree *)a->Get("isgr_src__lcr;2")
> root [5] t2->Scan("rate","","",1)
> ************************
> * Row * rate *
> ************************
> * 0 * 0.2331506 *
> ************************
> (long long)1
> root [6] t1->Scan("rate","","",1)
> ************************
> * Row * rate *
> ************************
> * 0 * 0.2331506 *
> ************************
> (long long)1
>
>
>
>
>
>
Received on Mon Mar 06 2006 - 17:59:37 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET