ATLAS Offline Software
Loading...
Searching...
No Matches
python.ReadAthenaPool Namespace Reference

Functions

 _configureReadAthenaPool ()

Function Documentation

◆ _configureReadAthenaPool()

_configureReadAthenaPool ( )
protected
Helper method to configure Athena to read back POOL files 

Definition at line 20 of file ReadAthenaPool.py.

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 # Load the basic services
32 import AthenaPoolCnvSvc.AthenaPool # noqa: F401
33
34 # Switch on TTreeCache for CollectionTree
35 svcMgr.AthenaPoolCnvSvc.InputPoolAttributes += [ "DatabaseName = '*'; ContainerName = 'CollectionTree'; TREE_CACHE = '-1'" ]
36
37 # Load ProxyProviderSvc
38 if not hasattr (svcMgr, 'ProxyProviderSvc'):
39 svcMgr += CfgMgr.ProxyProviderSvc()
40
41 # Add in MetaDataSvc
42 if not hasattr (svcMgr, 'MetaDataSvc'):
43 svcMgr += CfgMgr.MetaDataSvc ("MetaDataSvc")
44 svcMgr.ProxyProviderSvc.ProviderNames += [ "MetaDataSvc" ]
45
46 # Add in MetaData Stores
47 if not hasattr (svcMgr, 'InputMetaDataStore'):
48 svcMgr += CfgMgr.StoreGateSvc ("InputMetaDataStore")
49 if not hasattr (svcMgr, 'MetaDataStore'):
50 svcMgr += CfgMgr.StoreGateSvc ("MetaDataStore")
51
52 # Enable IOVDbSvc to read MetaData
53 svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr"
54 svcMgr.MetaDataSvc.MetaDataTools += [ "IOVDbMetaDataTool" ]
55 if not hasattr (svcMgr.ToolSvc, 'IOVDbMetaDataTool'):
56 svcMgr.ToolSvc += CfgMgr.IOVDbMetaDataTool()
57
58 # Add in EventSelector
59 svcMgr += CfgMgr.EventSelectorAthenaPool ("EventSelector")
60 #default InputCollections to FilesInput value of AthenaCommonFlags
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 # Add in AthenaPoolAddressProviderSvc
69 if not hasattr (svcMgr, 'AthenaPoolAddressProviderSvc'):
70 svcMgr += CfgMgr.AthenaPoolAddressProviderSvc ("AthenaPoolAddressProviderSvc")
71 svcMgr.ProxyProviderSvc.ProviderNames += [ "AthenaPoolAddressProviderSvc" ]
72
73 # Always want AddressRemappingSvc, since that's responsible for suppressing
74 # the read of objects that are produced by a WriteHandle.
75 from SGComps.AddressRemappingSvc import getAddressRemappingSvc
76 getAddressRemappingSvc()
77
78 msg.debug( "Configuring Athena for reading POOL files... [DONE]" )
79 return
80