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

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2009-10-23 - RiccardoMariaBianchi
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

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.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback