ATLAS Offline Software
Loading...
Searching...
No Matches
MetadataAlgConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6from AthenaServices.MetaDataSvcConfig import MetaDataSvcCfg
7
8
9def MetadataAlgCfg(flags, h5_output=None, json_output=None,
10 h5_output_hists=None, enable_systematics=True,
11 allowed_streams=None):
12 acc = ComponentAccumulator()
13 acc.merge(MetaDataSvcCfg(flags))
14 opts = {}
15 if o := h5_output:
16 opts |= dict(h5Output=o)
17 if o := json_output:
18 opts |= dict(jsonOutput=str(o))
19 if o := h5_output_hists:
20 opts |= dict(h5OutputHists=o)
21 if o := allowed_streams:
22 opts |= dict(allowedStreams=o)
23 opts |= dict(enableSystematics=enable_systematics)
24 if not (h5_output or json_output or h5_output_hists):
25 raise ValueError('No outputs given for MetadataAlg')
26 acc.addEventAlgo(
27 CompFactory.ftag.MetadataAlg('MetadataAlg', **opts)
28 )
29 return acc
MetadataAlgCfg(flags, h5_output=None, json_output=None, h5_output_hists=None, enable_systematics=True, allowed_streams=None)