#!/usr/bin/env python # Set up ROOT and RootCore: import ROOT ROOT.gROOT.Macro( '$ROOTCOREDIR/scripts/load_packages.C' ) ROOT.xAOD.Init() # Initialize the xAOD infrastructure fileName="AOD.01482225._000140.pool.root" # Set up the input files treeName = "CollectionTree" # default when making transient tree anyway f = ROOT.TFile.Open(fileName) t = ROOT.xAOD.MakeTransientTree( f, treeName) # Make the "transient tree" # Print some information: print( "Number of input events: %s" % t.GetEntries() ) for entry in xrange( t.GetEntries() ): t.GetEntry( entry ) print( "Processing run #%i, event #%i" % ( t.EventInfo.runNumber(), t.EventInfo.eventNumber() ) ) print( "Number of electrons: %i" % len( t.ElectronCollection ) ) for el in t.ElectronCollection: # loop over electron collection print( " Electron trackParticle eta = %g, phi = %g" % ( el.trackParticle().eta(), el.trackParticle().phi() ) ) pass # end for loop over electron collection pass # end loop over entries f.Close()