ATLAS Offline Software
SubtractedCellGetterCA.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaCommon.Logging import logging
6 __log = logging.getLogger('SubtractedCellGetterCA')
7 
8 def SubtractedCellGetterCfgCA(flags, modulator):
10 
11  cellCopyTool=CompFactory.CaloCellContCopyTool(name="HICellCopyTool")
12 
13  cellSubtrTool = acc.popToolsAndMerge(HISubtractedCellMakerToolCfg(flags, name="HISubtractedCellMakerTool", Modulator=modulator))
14 
15  cellFinalizerTool=acc.popToolsAndMerge(CaloCellContainerFinalizerToolCfg(flags, name="HICaloCellFinalizerTool"))
16 
17  cellMakerTools=[cellCopyTool,cellSubtrTool,cellFinalizerTool]
18 
19  cellAlgo = CompFactory.CaloCellMaker("HICaloCellCopier",
20  CaloCellMakerToolNames=cellMakerTools,
21  CaloCellsOutputName=flags.HeavyIon.Egamma.SubtractedCells,
22  EnableChronoStat=(flags.Concurrency.NumThreads == 0))
23 
24 
25  acc.addEventAlgo(cellAlgo)
26  return acc
27 
28 def CaloCellFastCopyToolCfg(flags, name="HICellCopyTool", **kwargs):
29  includeSamplings=["PreSamplerB", "EMB1", "EMB2", "EMB3",
30  "PreSamplerE", "EME1", "EME2", "EME3",
31  "HEC0", "HEC1", "HEC2", "HEC3",
32  "TileBar0", "TileBar1", "TileBar2",
33  "TileGap1", "TileGap2", "TileGap3",
34  "TileExt0", "TileExt1", "TileExt2",
35  "FCal1", "FCal2", "FCal3" ]
36  kwargs.setdefault("IncludeSamplings",includeSamplings)
37  kwargs.setdefault("InputName","AllCalo")
38 
39  acc = ComponentAccumulator()
40  acc.setPrivateTools(CompFactory.CaloCellFastCopyTool(name, **kwargs))
41  return acc
42 
43 def HISubtractedCellMakerToolCfg(flags, name="HISubtractedCellMakerTool", **kwargs):
44  acc = ComponentAccumulator()
45 
46  if "Modulator" not in kwargs:
47  __log.warning("Modulator is None, will set it to NULL")
48  from HIJetRec.HIJetRecConfigCA import NullModulatorCfg
49  modulator = acc.popToolsAndMerge(NullModulatorCfg())
50  kwargs.setdefault("Modulator", modulator)
51  if "EventShapeKey" not in kwargs:
52  kwargs.setdefault("EventShapeKey", flags.HeavyIon.Egamma.EventShape)
53  if "EventShapeMapTool" not in kwargs:
54  from HIGlobal.HIGlobalConfig import HIEventShapeMapToolCfg
55  eventShapeMapTool = acc.popToolsAndMerge(HIEventShapeMapToolCfg(flags, name="HIEventShapeMapTool"))
56  kwargs.setdefault("EventShapeMapTool",eventShapeMapTool)
57 
58  acc.setPrivateTools(CompFactory.HISubtractedCellMakerTool(name, **kwargs))
59  return acc
60 
61 def CaloCellContainerFinalizerToolCfg(flags, name="HICaloCellFinalizerTool", **kwargs):
62  acc = ComponentAccumulator()
63  acc.setPrivateTools(CompFactory.CaloCellContainerFinalizerTool(name, **kwargs))
64  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
HIJetRecConfigCA.NullModulatorCfg
def NullModulatorCfg()
Definition: HIJetRecConfigCA.py:312
SubtractedCellGetterCA.HISubtractedCellMakerToolCfg
def HISubtractedCellMakerToolCfg(flags, name="HISubtractedCellMakerTool", **kwargs)
Definition: SubtractedCellGetterCA.py:43
SubtractedCellGetterCA.SubtractedCellGetterCfgCA
def SubtractedCellGetterCfgCA(flags, modulator)
Definition: SubtractedCellGetterCA.py:8
SubtractedCellGetterCA.CaloCellContainerFinalizerToolCfg
def CaloCellContainerFinalizerToolCfg(flags, name="HICaloCellFinalizerTool", **kwargs)
Definition: SubtractedCellGetterCA.py:61
HIGlobalConfig.HIEventShapeMapToolCfg
def HIEventShapeMapToolCfg(flags, name="HIEventShapeMapTool", **kwargs)
Definition: HIGlobalConfig.py:20
SubtractedCellGetterCA.CaloCellFastCopyToolCfg
def CaloCellFastCopyToolCfg(flags, name="HICellCopyTool", **kwargs)
Definition: SubtractedCellGetterCA.py:28