4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory
import CompFactory
10 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
11 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
12 acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs))
13 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
21 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
22 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
23 kwargs.setdefault(
"name",
"GainDecor")
24 acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
31 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
38 kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
39 kwargs.setdefault(
"fill_cluster",
True)
40 acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
46 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
47 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
48 kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
49 kwargs.setdefault(
"neta", 5)
50 kwargs.setdefault(
"nphi", 5)
52 toolArgs.update({
"eta_size": kwargs[
"neta"]})
53 toolArgs.update({
"phi_size": kwargs[
"nphi"]})
55 "CaloFillRectangularClusterTool",
59 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
71 kwargs.setdefault(
"AugmentationTools", augmentationTools)
73 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
85 cluster_sizes = (3, 7), (5, 5), (7, 11)
86 for neta, nphi
in cluster_sizes:
87 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
88 ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
91 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
93 kwargs.setdefault(
"AugmentationTools", augmentationTools)
95 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
101 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
102 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
112 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
113 egamma tool, given the GainDecorator tool"""
115 tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
116 for info
in [
"E",
"nCells"]
117 for layer
in tool.layers
118 for gain
in tool.gain_names.values()
127 info=["E", "nCells"],
129 """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
130 Return a list with the 'ExtraContent' to be added to the decorations to save the gain
131 information per layer"""
133 if collections
is None:
134 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
136 GainDecoratorTool =
None
137 for toolStr
in acc.getEventAlgo(kernel).AugmentationTools:
138 toolStr = f
"{toolStr}"
139 splitStr = toolStr.split(
"/")
140 tool = acc.getPublicTool(splitStr[1])
141 if splitStr[0] ==
"DerivationFramework::GainDecorator":
142 GainDecoratorTool = tool
144 if GainDecoratorTool:
146 "{part}.{info}".
format(part=part, info=info)
147 for part
in collections
155 """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
156 decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
157 object (e.g. Photons.E7x11_Lr0, ...)"""
158 properties =
"SGKey_photons",
"SGKey_electrons"
159 ClusterEnergyPerLayerDecorators = []
160 for toolStr
in acc.getEventAlgo(kernel).AugmentationTools:
161 toolStr = f
"{toolStr}"
162 splitStr = toolStr.split(
"/")
163 tool = acc.getPublicTool(splitStr[1])
164 if splitStr[0] ==
"DerivationFramework::ClusterEnergyPerLayerDecorator":
165 ClusterEnergyPerLayerDecorators.append(tool)
168 for tool
in ClusterEnergyPerLayerDecorators:
169 collections =
filter(bool, (getattr(tool, x)
for x
in properties))
170 for part
in collections:
171 for layer
in tool.layers:
174 "{part}.E{neta}x{nphi}_Lr{layer}".
format(