10     """Install the Athena-based TTree event selector and correctly configure 
   13     from AthenaCommon 
import CfgMgr
 
   14     from AthenaCommon.AppMgr 
import theApp
 
   15     from AthenaCommon.AppMgr 
import ServiceMgr 
as svcMgr
 
   16     from AthenaCommon.Logging 
import logging
 
   17     from AthenaCommon.AthenaCommonFlags 
import athenaCommonFlags
 
   18     msg = logging.getLogger( 
'ReadAthenaxAOD' )
 
   19     msg.debug(
"Configuring Athena for reading xAOD files (via TEvent)...")
 
   22     if hasattr(svcMgr, 
'EventSelector'):
 
   23         err = 
"svcMgr already configured with another EventSelector: [%s]"%\
 
   24             svcMgr.EventSelector.getFullJobOptName()
 
   26         raise RuntimeError( err )
 
   31     svcMgr += CfgMgr.Athena__xAODEventSelector( 
"EventSelector" )
 
   34     if not hasattr(svcMgr, 
'THistSvc'): svcMgr += CfgMgr.THistSvc()
 
   35     if not hasattr (svcMgr, 
'ProxyProviderSvc'): svcMgr += CfgMgr.ProxyProviderSvc()
 
   36     if not hasattr (svcMgr, 
'InputMetaDataStore'): svcMgr += CfgMgr.StoreGateSvc(
"InputMetaDataStore")
 
   37     if not hasattr (svcMgr, 
'Athena::xAODCnvSvc'): svcMgr += CfgMgr.Athena__xAODCnvSvc()
 
   40     theApp.ExtSvc += [ svcMgr.EventSelector.getFullName() ]
 
   41     theApp.EvtSel = 
"EventSelector" 
   44     svcMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() 
 
   49     if not hasattr(svcMgr, theApp.EventLoop): svcMgr += getattr(CfgMgr, theApp.EventLoop)()
 
   50     evtloop = getattr(svcMgr, theApp.EventLoop)
 
   52         evtloop.EventPrintoutInterval = 10000
 
   54         msg.info(
'disabling event loop heartbeat... [failed]')
 
   55         msg.info(
'performances might be sub-par... sorry.')
 
   60     msg.debug(
"Configuring Athena for reading ROOT files (via xAOD)... [OK]")