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

This topic: Main > TWikiUsers > RiccardoMariaBianchi > ATLASWatchMan > ATLASWatchManExamples > ATLASWatchManExamplesGetRunNumberEventNumber
Topic revision: r1 - 2009-10-23 - RiccardoMariaBianchi
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback