ATLAS Offline Software
Loading...
Searching...
No Matches
SubtractedCellGetterCA.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaCommon.Logging import logging
6__log = logging.getLogger('SubtractedCellGetterCA')
7
8def SubtractedCellGetterCfgCA(flags, modulator):
9 acc=ComponentAccumulator()
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
28def 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
43def 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
61def CaloCellContainerFinalizerToolCfg(flags, name="HICaloCellFinalizerTool", **kwargs):
62 acc = ComponentAccumulator()
63 acc.setPrivateTools(CompFactory.CaloCellContainerFinalizerTool(name, **kwargs))
64 return acc
HISubtractedCellMakerToolCfg(flags, name="HISubtractedCellMakerTool", **kwargs)
CaloCellFastCopyToolCfg(flags, name="HICellCopyTool", **kwargs)
CaloCellContainerFinalizerToolCfg(flags, name="HICaloCellFinalizerTool", **kwargs)
SubtractedCellGetterCfgCA(flags, modulator)