ATLAS Offline Software
AthenaPool.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 
14 
16  """Loads the basic services for AthenaPool"""
17 
18  from AthenaCommon import CfgMgr
19 
20  import AthenaCommon.AtlasUnixStandardJob # noqa: F401
21 
22  from AthenaCommon.Logging import logging
23  from AthenaCommon.AppMgr import ServiceMgr as svcMgr
24 
25  msg = logging.getLogger( 'loadBasicAthenaPool' )
26  msg.debug( "Loading basic services for AthenaPool..." )
27 
28  if not hasattr (svcMgr, 'PoolSvc'):
29  svcMgr += CfgMgr.PoolSvc()
30  svcMgr.PoolSvc.MaxFilesOpen = 0
31  #if in AthAnalysisBase, we will set the outputlevel of PoolSvc to ERROR, to silence warnings about missing reflex types
32  #detect AthAnalysisBase by looking at the CMTEXTRATAGS env var, if it contains 'ManaCore' then we are in AthAnalysisBase
33  import os
34  from AthenaCommon.Constants import ERROR
35  if "ManaCore" in os.environ.get('CMTEXTRATAGS',""): svcMgr.PoolSvc.OutputLevel=ERROR
36 
37  svcMgr += CfgMgr.AthenaPoolCnvSvc()
38 
39  if not hasattr (svcMgr, 'EventPersistencySvc'):
40  svcMgr += CfgMgr.EvtPersistencySvc( "EventPersistencySvc" )
41  svcMgr.EventPersistencySvc.CnvServices += [ "AthenaPoolCnvSvc" ]
42  if not hasattr (svcMgr, 'ProxyProviderSvc'):
43  svcMgr += CfgMgr.ProxyProviderSvc()
44 
45  # Add in MetaDataSvc
46  svcMgr += CfgMgr.MetaDataSvc( "MetaDataSvc" )
47 
48  # Make MetaDataSvc an AddressProvider
49  svcMgr.ProxyProviderSvc.ProviderNames += [ "MetaDataSvc" ]
50  if not hasattr (svcMgr, 'MetaDataStore'):
51  svcMgr += CfgMgr.StoreGateSvc( "MetaDataStore" )
52 
53  msg.debug( "Loading basic services for AthenaPool... [DONE]" )
54  return
55 
56 
58 
59 
60 del _loadBasicAthenaPool
61 
Constants
some useful constants -------------------------------------------------—
python.AthenaPool._loadBasicAthenaPool
def _loadBasicAthenaPool()
Definition: AthenaPool.py:15