ATLAS Offline Software
egammaOQFlagsBuilderConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 __doc__ = "Configure e/gamma object quality"
4 
5 from AthenaCommon.Logging import logging
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 
9 
10 def 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 
26 if __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 
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()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
egammaOQFlagsBuilderConfig.egammaOQFlagsBuilderCfg
def egammaOQFlagsBuilderCfg(flags, name='egammaOQFlagsBuilder', **kwargs)
Definition: egammaOQFlagsBuilderConfig.py:10
extractSporadic.printProperties
def printProperties(h, q, hLB)
Definition: extractSporadic.py:8
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.LArHVScaleConfig.LArHVScaleCfg
def LArHVScaleCfg(configFlags)
Definition: LArHVScaleConfig.py:8