3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
9 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
10 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
11 acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs))
12 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
20 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
21 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
22 kwargs.setdefault(
"name",
"GainDecor")
23 acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
30 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
32 from TileGeoModel.TileGMConfig
import TileGMCfg
36 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
43 kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
44 kwargs.setdefault(
"fill_cluster",
True)
45 acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
51 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
52 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
53 kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
54 kwargs.setdefault(
"neta", 5)
55 kwargs.setdefault(
"nphi", 5)
57 toolArgs.update({
"eta_size": kwargs[
"neta"]})
58 toolArgs.update({
"phi_size": kwargs[
"nphi"]})
60 "CaloFillRectangularClusterTool",
64 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
76 kwargs.setdefault(
"AugmentationTools", augmentationTools)
78 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
90 cluster_sizes = (3, 7), (5, 5), (7, 11)
91 for neta, nphi
in cluster_sizes:
92 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
93 ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
96 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
98 kwargs.setdefault(
"AugmentationTools", augmentationTools)
100 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
106 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
107 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
112 JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
113 acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=
True)
122 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
123 egamma tool, given the GainDecorator tool"""
125 tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
126 for info
in [
"E",
"nCells"]
127 for layer
in tool.layers
128 for gain
in tool.gain_names.values()
137 info=["E", "nCells"],
139 """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
140 Return a list with the 'ExtraContent' to be added to the decorations to save the gain
141 information per layer"""
143 if collections
is None:
144 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
146 GainDecoratorTool =
None
147 for toolStr
in acc.getEventAlgo(kernel).AugmentationTools:
148 toolStr = f
"{toolStr}"
149 splitStr = toolStr.split(
"/")
150 tool = acc.getPublicTool(splitStr[1])
151 if splitStr[0] ==
"DerivationFramework::GainDecorator":
152 GainDecoratorTool = tool
154 if GainDecoratorTool:
156 "{part}.{info}".
format(part=part, info=info)
157 for part
in collections
165 """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
166 decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
167 object (e.g. Photons.E7x11_Lr0, ...)"""
168 properties =
"SGKey_photons",
"SGKey_electrons"
169 ClusterEnergyPerLayerDecorators = []
170 for toolStr
in acc.getEventAlgo(kernel).AugmentationTools:
171 toolStr = f
"{toolStr}"
172 splitStr = toolStr.split(
"/")
173 tool = acc.getPublicTool(splitStr[1])
174 if splitStr[0] ==
"DerivationFramework::ClusterEnergyPerLayerDecorator":
175 ClusterEnergyPerLayerDecorators.append(tool)
178 for tool
in ClusterEnergyPerLayerDecorators:
179 collections =
filter(bool, (getattr(tool, x)
for x
in properties))
180 for part
in collections:
181 for layer
in tool.layers:
184 "{part}.E{neta}x{nphi}_Lr{layer}".
format(