ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
Hi,
I have a root file to analyze.
The root file has a tree with some branch with the name “F.” and its leaves, “F.mName”, “F.mOpenTime”.
If I access the tree in pyROOT like so:
for i in xrange(entries):
tree.GetEntry(i)
for l in tree.GetListOfLeaves():
print l.GetName(), tree.GetLeaf(l.GetName()).GetValue(i), tree.GetLeaf(l.GetName()).GetTypeName()
, the output looks like:
F. 0.0 SXrdFileInfo
F.mName 0.0 TString
F.mOpenTime 1554101997.0 Long64_t
F.mName is supposed to be some file name like ‘/store/user/…’, a TString, instead it print 0.
Instead of GetValue(), I think it should be accessed using GetValuePointer() method.
That seems the only relevant method.
In root C, this may be achieved by
sprintf(val,"%s",(char*)leaf->GetValuePointer());
But In pyROOT python, how can I typecast this with (char *) to obtain the correct TString value:
tree.GetLeaf(“F.mName”).GetValuePointer()
Should there be a method similar to GetValue(i) for TString?
Thanks,
Bockjoo