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" ]
26flags.lock()
27
28# Main services
29from AthenaConfiguration.MainServicesConfig import MainServicesCfg
30acc = MainServicesCfg( flags )
31
32# Configure AthenaPool reading
33from AthenaPoolExampleAlgorithms.AthenaPoolExampleConfig import AthenaPoolExampleReadCfg
34acc.merge( AthenaPoolExampleReadCfg(flags, readCatalogs = ["file:Catalog1.xml"]) )
35
36# Create and attach the reading algorithm for the ExampleElectron and its decorations
37acc.addEventAlgo( CompFactory.AthPoolEx.ReadExampleElectron("ReadExampleElectron", OutputLevel = DEBUG) )
38
39# Run
40import sys
41sc = acc.run(flags.Exec.MaxEvents)
42sys.exit(sc.isFailure())