hello Pyroot support,
This seems like a very basic question, but could not find the answer anywhere. I have a TTree in a TFile that contains a few branches. Each branch name is just an identifier, and within each branch are several variables.
Structure looks like:
Tree
Branch1
-mass
-pt
Branch2
-mass
-pt
To access the mass and pt for each branch I tried:
[code]# Set the branch address of TTree in Tfile
evt = file.Get(“tree”)
Loop over over events in TFile
for iEvt in range(evt.GetEntries()):
print evt.Branch1.mass[/code]
I get the error:
TTree’ object has no attribute ‘Branch1’
Any idea how to access the leaves within the branches? Thanks in advance