20def _configureReadAthenaPool():
21 """ Helper method to configure Athena to read back POOL files """
22
23 from AthenaCommon.Logging import logging
24 msg = logging.getLogger( 'configureReadAthenaPool' )
25 msg.debug( "Configuring Athena for reading POOL files..." )
26
27 from AthenaCommon import CfgMgr
28 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
29 from AthenaCommon.AppMgr import theApp
30
31
32 import AthenaPoolCnvSvc.AthenaPool
33
34
35 svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'" ]
36
37
38 if not hasattr (svcMgr, 'ProxyProviderSvc'):
39 svcMgr += CfgMgr.ProxyProviderSvc()
40
41
42 if not hasattr (svcMgr, 'MetaDataSvc'):
43 svcMgr += CfgMgr.MetaDataSvc ("MetaDataSvc")
44 svcMgr.ProxyProviderSvc.ProviderNames += [ "MetaDataSvc" ]
45
46
47 if not hasattr (svcMgr, 'InputMetaDataStore'):
48 svcMgr += CfgMgr.StoreGateSvc ("InputMetaDataStore")
49 if not hasattr (svcMgr, 'MetaDataStore'):
50 svcMgr += CfgMgr.StoreGateSvc ("MetaDataStore")
51
52
53 svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr"
54 svcMgr.MetaDataSvc.MetaDataTools += [ "IOVDbMetaDataTool" ]
55 if not hasattr (svcMgr.ToolSvc, 'IOVDbMetaDataTool'):
56 svcMgr.ToolSvc += CfgMgr.IOVDbMetaDataTool()
57
58
59 svcMgr += CfgMgr.EventSelectorAthenaPool ("EventSelector")
60
61 from AthenaCommon.AthenaCommonFlags import jobproperties as jps
62 svcMgr.EventSelector.InputCollections = jps.AthenaCommonFlags.FilesInput()
63
64 _n = svcMgr.EventSelector.getFullJobOptName()
65 theApp.EvtSel = _n
66 del _n
67
68
69 import os
70 if "AthAnalysisBase" in os.environ.get('CMTEXTRATAGS',""):
71
72
73 if not hasattr(svcMgr, theApp.EventLoop):
74 svcMgr += getattr(CfgMgr, theApp.EventLoop)()
75 evtloop = getattr(svcMgr, theApp.EventLoop)
76 try:
77 evtloop.EventPrintoutInterval = 10000
78 except Exception:
79 msg.info('failed suppressing event loop heartbeat. performances might be sub-par... sorry.')
80 pass
81
82
83 if not hasattr (svcMgr, 'AthenaPoolAddressProviderSvc'):
84 svcMgr += CfgMgr.AthenaPoolAddressProviderSvc ("AthenaPoolAddressProviderSvc")
85 svcMgr.ProxyProviderSvc.ProviderNames += [ "AthenaPoolAddressProviderSvc" ]
86
87
88
89 svcMgr += CfgMgr.DataModelCompatSvc()
90
91
92
93 from SGComps.AddressRemappingSvc import getAddressRemappingSvc
94 getAddressRemappingSvc()
95
96 msg.debug( "Configuring Athena for reading POOL files... [DONE]" )
97 return
98