How to get run number and event number
Python Code
import ROOT
import ATLASWatchMan.Bindings
#open the .root file
f = ROOT.TFile( "OutputD3PD.root" )
#open the TTree
tree = f.Get( "MyAnalysisTree" )
#loading the number of events stored in the TTree
nEntries = tree.GetEntries()
#loop over all events
for ev in range( nEntries ):
#load the event
tree.GetEntry( ev )
#print the run number and event number:
print "run n.: %s - ev n.: %s" % (tree.runNumber[0], tree.eventNumber[0]) #there are stored as vector but they have only one entry
C++ Code
(coming soon)
--
RiccardoMariaBianchi - 23-Oct-2009