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", MetaDataContainer="MetaDataHdr")
13  result.addService(service)
14  result.addService(CompFactory.ProxyProviderSvc(ProviderNames=["MetaDataSvc"]))
15 
16  for tool in tools:
17  result.addPublicTool(tool)
18  service.MetaDataTools += [tool]
19 
20  for name in toolNames:
21  if not isinstance(name, str):
22  from AthenaCommon.Logging import logging
23  log = logging.getLogger("MetaDataSvcConfig")
24  log.error('Attempted to pass a non-string argument as a metadata tool name')
25  continue
26  tool = CompFactory.getComp(name)()
27  result.addPublicTool(tool)
28  service.MetaDataTools += [tool]
29 
30  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MetaDataSvcConfig.MetaDataSvcCfg
def MetaDataSvcCfg(flags, toolNames=[], tools=[])
Definition: MetaDataSvcConfig.py:6