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
15 from enum
import IntEnum
24 def xAODReadCfg(flags, AccessMode=xAODAccessMode.CLASS_ACCESS):
26 Creates a ComponentAccumulator instance containing the
27 athena services required for xAOD file reading
30 msg = Logging.logging.getLogger(
'ReadAthenaxAODHybrid' )
31 msg.debug(
"Configuring Athena for reading xAOD files (via TEvent, with POOL for Metadata)...")
36 result.addService(CompFactory.EvtPersistencySvc(
"EventPersistencySvc",))
39 result.addService(CompFactory.StoreGateSvc(
"MetaDataStore"))
41 result.addService(CompFactory.PoolSvc(
"PoolSvc",OutputLevel=Constants.WARNING))
44 result.addService(CompFactory.Athena.xAODCnvSvc())
46 result.addService(CompFactory.ProxyProviderSvc(
"ProxyProviderSvc",ProviderNames=[
"MetaDataSvc"]))
48 CompFactory.Athena.xAODEventSelector(
50 InputCollections=flags.Input.Files,
51 SkipEvents=flags.Exec.SkipEvents,
52 AccessMode=AccessMode,
53 ReadMetaDataWithPool=
True,
54 printEventProxyWarnings=
False,
56 evSel = result.getService(
"EventSelector")
58 result.setAppProperty(
"EvtSel",evSel.getFullJobOptName())
60 msg.debug(
"Configuring Athena for reading ROOT files (via TEvent, with POOL for Metadata)... [OK]")
66 if __name__==
"__main__":
67 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
69 asg_test_file_mc = os.environ[
'ASG_TEST_FILE_MC']
71 flags.Input.Files=[asg_test_file_mc]
75 flags.Input.Files=[sys.argv[1]]
78 AccessMode = xAODAccessMode.CLASS_ACCESS
82 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg