Hello,
I need to create a root tree reading an ascii file, and I am using the TTree::ReadFile function.
From the documentation I learned that the branch descriptor must be of the form
A/D:Table[2]/F:Ntracks/I:astring/s
In particular, it looks like strings are supported too (astring/s).
While with integers, floats, doubles I have no problem and everything works well, when I try to create a string branch I don’t get the expected result.
My code to create and fill the tree:
TTree* eventTree = new TTree("Mytree", "My Tree");
int nlines = eventTree.ReadFile(fileName);
cout << "Lines read: " << nlines <<endl;
The input file (very simple indeed):
[ul][color=darkblue]
stringvar/s
"hello"
“bye”
[/color][/ul]
The output of eventTree->Print(); :
[color=darkblue]
Lines read: 0
*Tree :Mytree : My tree *
*Entries : 0 : Total = 913 bytes File Size = 0 *
-
: : Tree compression factor = 1.00 *
*Br 0 :stringvar : stringvar/s *
*Entries : 0 : Total Size= 650 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
…
[/color]
Even an input like
[ul][color=darkblue]
stringvar/s
hello
bye
[/color][/ul]
gives the same output from Print().
Could someone tell me which is the correct input format to have string branches work?
Thanks a lot!