ATLAS Offline Software
Loading...
Searching...
No Matches
egammaOQFlagsBuilderConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3""" Configure e/gamma object quality """
4
5from AthenaCommon.Logging import logging
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8
9
10def egammaOQFlagsBuilderCfg(flags, name='egammaOQFlagsBuilder', **kwargs):
11
12 mlog = logging.getLogger(name)
13 mlog.debug('Start configuration')
14
15 from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
16 acc = LArHVScaleCfg(flags)
17
18 kwargs.setdefault("CellsName", flags.Egamma.Keys.Input.CaloCells)
19 kwargs.setdefault("affectedTool", CompFactory.CaloAffectedTool())
20
21 tool = CompFactory.egammaOQFlagsBuilder(name, **kwargs)
22 acc.setPrivateTools(tool)
23 return acc
24
25
26if __name__ == "__main__":
27
28 from AthenaConfiguration.AllConfigFlags import initConfigFlags
29 from AthenaConfiguration.ComponentAccumulator import printProperties
30 from AthenaConfiguration.TestDefaults import defaultTestFiles
31 flags = initConfigFlags()
32 flags.Input.Files = defaultTestFiles.RDO_RUN2
33 flags.fillFromArgs()
34 flags.lock()
35 flags.dump()
36
37 cfg = ComponentAccumulator()
38 mlog = logging.getLogger("egammaOQFlagsBuilderTest")
39 mlog.info("Configuring egammaOQFlagsBuilder: ")
40 printProperties(mlog, cfg.popToolsAndMerge(
42 nestLevel=1,
43 printDefaults=True)
44
45 f = open("egammaoqflagsbuilder.pkl", "wb")
46 cfg.store(f)
47 f.close()
egammaOQFlagsBuilderCfg(flags, name='egammaOQFlagsBuilder', **kwargs)