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 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
37 kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
38 kwargs.setdefault(
"fill_cluster",
True)
39 acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
45 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
46 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
47 kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
48 kwargs.setdefault(
"neta", 5)
49 kwargs.setdefault(
"nphi", 5)
51 toolArgs.update({
"eta_size": kwargs[
"neta"]})
52 toolArgs.update({
"phi_size": kwargs[
"nphi"]})
54 "CaloFillRectangularClusterTool",
58 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
70 kwargs.setdefault(
"AugmentationTools", augmentationTools)
72 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
84 cluster_sizes = (3, 7), (5, 5), (7, 11)
85 for neta, nphi
in cluster_sizes:
86 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
87 ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
90 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
92 kwargs.setdefault(
"AugmentationTools", augmentationTools)
94 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
100 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
101 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
106 JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
107 acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=
True)
116 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
117 egamma tool, given the GainDecorator tool"""
119 tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
120 for info
in [
"E",
"nCells"]
121 for layer
in tool.layers
122 for gain
in tool.gain_names.values()
131 info=["E", "nCells"],
133 """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
134 Return a list with the 'ExtraContent' to be added to the decorations to save the gain
135 information per layer"""
137 if collections
is None:
138 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
140 GainDecoratorTool =
None
141 for toolStr
in acc.getEventAlgo(kernel).AugmentationTools:
142 toolStr = f
"{toolStr}"
143 splitStr = toolStr.split(
"/")
144 tool = acc.getPublicTool(splitStr[1])
145 if splitStr[0] ==
"DerivationFramework::GainDecorator":
146 GainDecoratorTool = tool
148 if GainDecoratorTool:
150 "{part}.{info}".
format(part=part, info=info)
151 for part
in collections
159 """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
160 decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
161 object (e.g. Photons.E7x11_Lr0, ...)"""
162 properties =
"SGKey_photons",
"SGKey_electrons"
163 ClusterEnergyPerLayerDecorators = []
164 for toolStr
in acc.getEventAlgo(kernel).AugmentationTools:
165 toolStr = f
"{toolStr}"
166 splitStr = toolStr.split(
"/")
167 tool = acc.getPublicTool(splitStr[1])
168 if splitStr[0] ==
"DerivationFramework::ClusterEnergyPerLayerDecorator":
169 ClusterEnergyPerLayerDecorators.append(tool)
172 for tool
in ClusterEnergyPerLayerDecorators:
173 collections =
filter(bool, (getattr(tool, x)
for x
in properties))
174 for part
in collections:
175 for layer
in tool.layers:
178 "{part}.E{neta}x{nphi}_Lr{layer}".
format(