Skip to content

Instantly share code, notes, and snippets.

@kratsg
Created May 25, 2015 14:19
Show Gist options
  • Save kratsg/30c4809cb0bfb29cc476 to your computer and use it in GitHub Desktop.
Save kratsg/30c4809cb0bfb29cc476 to your computer and use it in GitHub Desktop.
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
import AthenaPoolCnvSvc.ReadAthenaPool
svcMgr.EventSelector.InputCollections = ['input.root']
from GaudiSequencer.PyComps import PyEvtFilter
filterseq = CfgMgr.AthSequencer("AthFilterSeq")
#filterseq += PyEvtFilter("MyFilter",evt_list=[18559067]) #will execute main sequence only for these eventnumbers
# Create a POOL output file with the StoreGate contents:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
xaodStream = MSMgr.NewPoolRootStream( "StreamXAOD", "xAOD.root" )
DetDescrVersion = 'ATLAS-R2-2015-01-01-00'
include("RecExCond/AllDet_detDescr.py")
# Set up its contents:
#xaodStream.AcceptAlgs(["MyFilter"])
xaodStream.GetEventStream().TakeItemsFromInput = True
#needed to have xAOD readable outside athena (but I thought this is not needed any more?)
#theApp.CreateSvc += [ "xAODMaker::EventFormatSvc" ]
xaodStream.AddMetaDataItem(["EventBookkeeperCollection#*"])
#xaodStream.AddMetaDataItem(["xAOD::EventFormat#EventFormat"])
theApp.EvtMax=5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment