Hi,
I am trying to read events from an ntuple. I have the tree “mytree”, and want to loop over it’s entries, extract all the variables, do some calculations and fill a histogram based on some cuts, which may involve calculations on the ntuple variables.
Here is a simple snippet of code, for example:
from ROOT import TStyle, TF1, TFile, TCanvas, gDirectory, TTree, TH1F, TH2F, TBrowser, gStyle, gMinuit, TText, TCut
f = TFile(‘brunel_ntuple.root’, ‘read’)
mytree=f.Get(‘myAlg2/101’)
nentry = mytree.GetEntries()
dx = TH1F(“dx”, ‘Delta X’, 500, -5.0, 5.0)
How do I loop over “mytree” and extract the variables for calculations to be made on them and then fill the histogram “dx”?
Thanks,
Steve