ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaPoolExample_ReadxAODElectrons.py
Go to the documentation of this file.
1#!/env/python
2
3# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4
5
14
15from AthenaConfiguration.AllConfigFlags import initConfigFlags
16from AthenaConfiguration.ComponentFactory import CompFactory
17from AthenaCommon.Constants import DEBUG
18
19# Setup flags
20flags = initConfigFlags()
21flags.Input.Files = [ "SimplePoolFile_xAOD.root" ]
22flags.Exec.MaxEvents = -1
23flags.Common.MsgSuppression = False
24flags.Exec.DebugMessageComponents = [ "ReadExampleElectron", "PoolSvc", "AthenaPoolCnvSvc",
25 "AthenaPoolAddressProviderSvc", "MetaDataSvc", "EventSelector" ]
26
27#Run3 for now
28from AthenaConfiguration.TestDefaults import defaultGeometryTags
29flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
30
31flags.lock()
32
33# Main services
34from AthenaConfiguration.MainServicesConfig import MainServicesCfg
35acc = MainServicesCfg( flags )
36
37# Configure AthenaPool reading
38from AthenaPoolExampleAlgorithms.AthenaPoolExampleConfig import AthenaPoolExampleReadCfg
39acc.merge( AthenaPoolExampleReadCfg(flags, readCatalogs = ["file:Catalog1.xml"]) )
40
41# Create and attach the reading algorithm for the ExampleElectron and its decorations
42acc.addEventAlgo( CompFactory.AthPoolEx.ReadExampleElectron("ReadExampleElectron", OutputLevel = DEBUG) )
43
44# Run
45import sys
46sc = acc.run(flags.Exec.MaxEvents)
47sys.exit(sc.isFailure())