Hi!
I have a complicated tree where. As you can see in the photo, there are a bunch of leaves in each branch. I want to create histograms from the events in a particular leaf from a particular branch, let’s say branch: Photon1, and leaf: eta.
I tried to write the following code to access that branch. But it doesn’t return the right plot when I compare to the plot in TBrowser.
br = tree.GetBranch("Photon1")
print br
#hpt = TH1D("pt", "Histogram of pt", 100, -1000, 2500)
heta = TH1D("Photon1_eta", "Histogram of eta", 100, -11000, 0)
for event in tree:
#print event.eta #prints out but i don't know which branch it comes from
tree.GetLeaf("eta")
heta = event.eta
#ptfi= event.pt
hstar.Fill(heta)
c = ROOT.TCanvas()
#hpt.Draw("same")
hstar.Draw("same")
c.Draw()
Any suggestion would be appreciated!