11 """Install the Athena-based xAOD event selector and correctly configure
14 from AthenaCommon
import CfgMgr
15 from AthenaCommon.AppMgr
import theApp
16 from AthenaCommon.AppMgr
import ServiceMgr
as svcMgr
17 from AthenaCommon.Logging
import logging
18 from AthenaCommon.AthenaCommonFlags
import athenaCommonFlags
22 msg = logging.getLogger(
'ReadAthenaxAODHybrid' )
23 msg.debug(
"Configuring Athena for reading xAOD files (via TEvent, with POOL for Metadata)...")
27 if hasattr(svcMgr,
'EventSelector'):
28 err =
"svcMgr already configured with another EventSelector: [%s]"%\
29 svcMgr.EventSelector.getFullJobOptName()
31 raise RuntimeError( err )
36 svcMgr += CfgMgr.Athena__xAODEventSelector(
"EventSelector" )
39 if not hasattr(svcMgr,
'THistSvc'): svcMgr += CfgMgr.THistSvc()
40 if not hasattr (svcMgr,
'ProxyProviderSvc'): svcMgr += CfgMgr.ProxyProviderSvc()
41 if not hasattr (svcMgr,
'InputMetaDataStore'): svcMgr += CfgMgr.StoreGateSvc(
"InputMetaDataStore")
42 if not hasattr (svcMgr,
'Athena::xAODCnvSvc'): svcMgr += CfgMgr.Athena__xAODCnvSvc()
43 if not hasattr(svcMgr,
'EventPersistencySvc'): svcMgr += CfgMgr.EvtPersistencySvc(
"EventPersistencySvc" )
44 if not hasattr (svcMgr,
'MetaDataSvc'): svcMgr += CfgMgr.MetaDataSvc (
"MetaDataSvc")
45 if not hasattr(svcMgr,
'PoolSvc'): svcMgr += CfgMgr.PoolSvc()
48 theApp.ExtSvc += [ svcMgr.EventSelector.getFullName() ]
49 theApp.EvtSel =
"EventSelector"
50 svcMgr.MetaDataSvc.MetaDataContainer =
"MetaDataHdr"
51 svcMgr.ProxyProviderSvc.ProviderNames += [
"MetaDataSvc" ]
52 svcMgr.PoolSvc.OutputLevel = ERROR
53 svcMgr.EventSelector.ReadMetaDataWithPool=
True
56 svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput()
61 if not hasattr(svcMgr, theApp.EventLoop): svcMgr += getattr(CfgMgr, theApp.EventLoop)()
62 evtloop = getattr(svcMgr, theApp.EventLoop)
64 evtloop.EventPrintoutInterval = 10000
66 msg.info(
'disabling event loop heartbeat... [failed]')
67 msg.info(
'performances might be sub-par... sorry.')
71 msg.debug(
"Configuring Athena for reading ROOT files (via TEvent, with POOL for Metadata)... [OK]")