10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory
import CompFactory
12 from AthenaCommon
import Logging
13 from AthenaCommon
import Constants
14 from AthenaServices.MetaDataSvcConfig
import MetaDataSvcCfg
27 from enum
import IntEnum
35 def xAODReadCfg(flags, AccessMode=xAODAccessMode.CLASS_ACCESS):
37 Creates a ComponentAccumulator instance containing the
38 athena services required for xAOD file reading
41 msg = Logging.logging.getLogger(
'ReadAthenaxAODHybrid' )
42 msg.debug(
"Configuring Athena for reading xAOD files (via TEvent, with POOL for Metadata)...")
47 result.addService(CompFactory.EvtPersistencySvc(
"EventPersistencySvc",))
50 result.addService(CompFactory.StoreGateSvc(
"MetaDataStore"))
52 result.addService(CompFactory.PoolSvc(
"PoolSvc",OutputLevel=Constants.WARNING))
55 result.addService(CompFactory.Athena.xAODCnvSvc())
57 result.addService(CompFactory.ProxyProviderSvc(
"ProxyProviderSvc",ProviderNames=[
"MetaDataSvc"]))
59 CompFactory.Athena.xAODEventSelector(
61 InputCollections=flags.Input.Files,
62 SkipEvents=flags.Exec.SkipEvents,
63 AccessMode=AccessMode,
64 ReadMetaDataWithPool=
True,
65 printEventProxyWarnings=
False,
67 evSel = result.getService(
"EventSelector")
69 result.setAppProperty(
"EvtSel",evSel.getFullJobOptName())
71 msg.debug(
"Configuring Athena for reading ROOT files (via TEvent, with POOL for Metadata)... [OK]")
77 if __name__==
"__main__":
78 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
80 asg_test_file_mc = os.environ[
'ASG_TEST_FILE_MC']
82 flags.Input.Files=[asg_test_file_mc]
86 flags.Input.Files=[sys.argv[1]]
89 AccessMode = xAODAccessMode.CLASS_ACCESS
93 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg