ATLAS Offline Software
MetaDataSvcConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 
5 
6 def MetaDataSvcCfg(flags, toolNames=[], tools=[]):
7  result = ComponentAccumulator()
8 
9  result.addService(CompFactory.StoreGateSvc("MetaDataStore"))
10  result.addService(CompFactory.StoreGateSvc("InputMetaDataStore"))
11 
12  service = CompFactory.MetaDataSvc("MetaDataSvc",
13  MetaDataContainer="MetaDataHdr",
14  ConversionService="AthenaPoolSharedIOCnvSvc" if flags.MP.UseSharedReader or flags.MP.UseSharedWriter else "AthenaPoolCnvSvc")
15  result.addService(service)
16  result.addService(CompFactory.ProxyProviderSvc(ProviderNames=["MetaDataSvc"]))
17 
18  for tool in tools:
19  result.addPublicTool(tool)
20  service.MetaDataTools += [tool]
21 
22  for name in toolNames:
23  if not isinstance(name, str):
24  from AthenaCommon.Logging import logging
25  log = logging.getLogger("MetaDataSvcConfig")
26  log.error('Attempted to pass a non-string argument as a metadata tool name')
27  continue
28  tool = CompFactory.getComp(name)()
29  result.addPublicTool(tool)
30  service.MetaDataTools += [tool]
31 
32  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MetaDataSvcConfig.MetaDataSvcCfg
def MetaDataSvcCfg(flags, toolNames=[], tools=[])
Definition: MetaDataSvcConfig.py:6