I have a ROOT file (let it be named “file.root”), which contains a TTree called “Event”. This TTree contains a leaf called “E.id”.
I want to access the information in E.id, but when I do the script:
import ROOT
f = ROOT.TFile(“file.root”)
tree=f.Get(“Event”)
for it in tree:
print (it.E.id)
It says that ‘TTree’ object has no attribute ‘E’. This is due to the dot in E.id, but the file.root is not mine and I can not change the branches names.
Do you know how can I manage to read the data in the E.id leaf?
Yes a “.” in a tree variable name is not a good practice.
Can you ask the author of this tree how he/she access this “dotted” variable ?
Otherwise @pcanal might have an idea.
Exactly …
And may be also ask the author what is the purpose of a variable you cannot access ?
Has he ever tried to access it himself ? It looks like a bug, a design mistake…
And it is not only E.run_id but also E.frame_index and E.trigger_counter