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
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):
The output of eventTree->Print(); :
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 *
Even an input like
gives the same output from Print().
Could someone tell me which is the correct input format to have string branches work?
Thanks a lot!