Read TTree from file

From: Thomas Lauf <thl_at_hll.mpg.de>
Date: Tue, 12 Jan 2010 12:31:58 +0100


Hello,

if I apply this little script

{

   TTree* Tree = new TTree( "Test", "Test" );    Long64_t RetVal = Tree->ReadFile( "Array1.txt" );    gROOT->ProcessLine("Tree->Print(\"toponly\"); > Array3.dat"); }

on the file Array1.txt which looks like this

Len/I:Array[2]/D

2 1.1 2.1
2 3.1 4.1
2 5.1 6.1

I would expect the resulting tree to have 2 branches named 'Len' and 'Array' of which the second one is an array of doubles with length 2 and the file Array3.dat should look like this:



*Tree :Test : Test *
*Entries : 3 : Total = 1601 bytes File Size = 0 *

The script passes with no errors but the branch containing the array does not have the expected name, it is named 'Array[2]' as one can see in the real output:



*Tree :Test : Test *
*Entries : 3 : Total = 1601 bytes File Size = 0 *

What went wrong? How can I get ROOT to name the branch 'Array'? My research in the documentation so far was futile...

I am using ROOT 5.20/00 on linux. I have tested this example also under ROOT 5.25/02, but it failed there too.

Thanks for any advice

Thomas Received on Tue Jan 12 2010 - 12:32:29 CET

This archive was generated by hypermail 2.2.0 : Tue Jan 12 2010 - 17:50:01 CET