10def _configure():
11 """Install the Athena-based xAOD event selector and correctly configure
12 a few other services.
13 """
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
20
21
22 msg = logging.getLogger( 'ReadAthenaxAODHybrid' )
23 msg.debug("Configuring Athena for reading xAOD files (via TEvent, with POOL for Metadata)...")
24
25
26
27 if hasattr(svcMgr, 'EventSelector'):
28 err = "svcMgr already configured with another EventSelector: [%s]"%\
29 svcMgr.EventSelector.getFullJobOptName()
30 msg.error( err )
31 raise RuntimeError( err )
32
33
34
35
36 svcMgr += CfgMgr.Athena__xAODEventSelector( "EventSelector" )
37
38
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()
46
47
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
54
55
56 svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput()
57
58
59
60
61 if not hasattr(svcMgr, theApp.EventLoop): svcMgr += getattr(CfgMgr, theApp.EventLoop)()
62 evtloop = getattr(svcMgr, theApp.EventLoop)
63 try:
64 evtloop.EventPrintoutInterval = 10000
65 except Exception:
66 msg.info('disabling event loop heartbeat... [failed]')
67 msg.info('performances might be sub-par... sorry.')
68 pass
69
70
71 msg.debug("Configuring Athena for reading ROOT files (via TEvent, with POOL for Metadata)... [OK]")
72 return
73
74