ATLAS Offline Software
AthenaRootBase.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 # @file AthenaRootComps/python/AthenaRootBase.py
4 # @purpose make the Athena framework write a set of ROOT files
5 # @author Sebastien Binet <binet@cern.ch>
6 #
7 
8 
10  """Loads the basic services for AthenaRoot"""
11 
12  from AthenaCommon import CfgMgr
13 
14  import AthenaCommon.AtlasUnixStandardJob # noqa: F401
15 
16  from AthenaCommon.Logging import logging
17  from AthenaCommon.AppMgr import ServiceMgr as svcMgr
18 
19  msg = logging.getLogger( 'loadBasicAthenaRoot' )
20  msg.debug( "Loading basic services for AthenaRoot..." )
21 
22  svcMgr += CfgMgr.Athena__RootSvc("AthenaRootSvc")
23  svcMgr += CfgMgr.Athena__RootCnvSvc("AthenaRootCnvSvc")
24 
25  if not hasattr (svcMgr, 'EventPersistencySvc'):
26  svcMgr += CfgMgr.EvtPersistencySvc( "EventPersistencySvc" )
27  svcMgr.EventPersistencySvc.CnvServices += [ "AthenaRootCnvSvc" ]
28  if not hasattr (svcMgr, 'ProxyProviderSvc'):
29  svcMgr += CfgMgr.ProxyProviderSvc()
30 
31  # Make sure AthenaPoolServices is loaded for custom streamer
32  try:
33  svcMgr += CfgMgr.AthenaRootStreamerSvc()
34  except TypeError:
35  msg.info("could not load AthenaRootStreamerSvc")
36  pass
37 
38  if not hasattr (svcMgr, 'InputMetaDataStore'):
39  svcMgr += CfgMgr.StoreGateSvc ("InputMetaDataStore")
40  pass
41 
42  if not hasattr (svcMgr, 'MetaDataStore'):
43  svcMgr += CfgMgr.StoreGateSvc ("MetaDataStore")
44  pass
45 
46  msg.debug( "Loading basic services for AthenaRoot... [DONE]" )
47  return
48 
49 
51 
52 
53 del _loadBasicAthenaRoot
54 
55 
python.AthenaRootBase._loadBasicAthenaRoot
def _loadBasicAthenaRoot()
Definition: AthenaRootBase.py:9