3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory
import CompFactory
7 acc = ComponentAccumulator()
8 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
9 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
10 kwargs.setdefault(
"SGKey_CaloCells", flags.Egamma.Keys.Input.CaloCells)
12 from egammaCaloTools.egammaCaloToolsConfig
import egammaLargeClusterCellRecoveryToolCfg
13 kwargs.setdefault(
"egammaLargeClusterCellRecoveryTool",
14 acc.popToolsAndMerge(egammaLargeClusterCellRecoveryToolCfg(flags)))
16 acc.setPrivateTools(CompFactory.DerivationFramework.CaloCellDecorator(**kwargs))
17 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
19 acc.merge(LArOnOffIdMappingCfg(flags))
24 acc = ComponentAccumulator()
25 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
26 baseDecorations =[
"maxEcell_time",
"maxEcell_energy",
"maxEcell_gain",
27 "maxEcell_onlId",
"maxEcell_x",
"maxEcell_y",
"maxEcell_z"]
28 electronDecorations = baseDecorations
29 kwargs.setdefault(
"SGKey_egammaClusters",
"")
30 if kwargs[
"SGKey_egammaClusters"] !=
'':
31 electronDecorations += [
"dR"]
32 kwargs.setdefault(
"SGKey_electrons_decorations", electronDecorations)
33 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
34 acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(name, **kwargs))
35 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
37 acc.merge(LArOnOffIdMappingCfg(flags))
42 acc = ComponentAccumulator()
43 decorationPattern = kwargs.pop(
"decoration_pattern",
"{}_Lr{}_{}G")
44 kwargs.setdefault(
"gain_names", { 0 :
"Hi", 1 :
"Med", 2 :
"Low" })
45 kwargs.setdefault(
"layers", [0, 1, 2, 3])
47 for x, gain
in kwargs[
"gain_names"].items():
48 for layer
in kwargs[
"layers"]:
49 decorNames += [decorationPattern.format(
"E", layer, gain)]
50 decorNames += [decorationPattern.format(
"rnoW", layer, gain)]
51 decorNames += [decorationPattern.format(
"nCells", layer, gain)]
52 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
53 kwargs.setdefault(
"SGKey_electrons_decorations", decorNames)
54 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
55 kwargs.setdefault(
"SGKey_photons_decorations", decorNames)
56 kwargs.setdefault(
"name",
"GainDecor")
57 acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
62 acc = ComponentAccumulator()
64 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
65 acc.merge(LArGMCfg(flags))
66 from TileGeoModel.TileGMConfig
import TileGMCfg
67 acc.merge(TileGMCfg(flags))
70 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
76 acc = ComponentAccumulator()
77 kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
78 kwargs.setdefault(
"fill_cluster",
True)
79 acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
84 acc = ComponentAccumulator()
85 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
86 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
87 kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
88 neta = kwargs.pop(
"neta", 5)
89 nphi = kwargs.pop(
"nphi", 5)
90 kwargs.setdefault(
"layers", [ 0, 1, 2, 3 ])
91 decorBase =
"E{}x{}_Lr".format(neta, nphi)
92 kwargs.setdefault(
"SGKey_photons_decorations", [decorBase+str(layer)
for layer
in kwargs[
'layers']])
93 kwargs.setdefault(
"SGKey_electrons_decorations", [decorBase+str(layer)
for layer
in kwargs[
'layers']])
95 toolArgs.update({
"eta_size": neta})
96 toolArgs.update({
"phi_size": nphi})
98 "CaloFillRectangularClusterTool",
102 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
108 acc = ComponentAccumulator()
110 augmentationTools = [
114 kwargs.setdefault(
"AugmentationTools", augmentationTools)
116 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
121 acc = ComponentAccumulator()
123 augmentationTools = [
127 kwargs.setdefault(
"AugmentationTools", augmentationTools)
129 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
136 augmentationTools = [
141 cluster_sizes = (3, 7), (5, 5), (7, 11)
142 for neta, nphi
in cluster_sizes:
143 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
144 ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
147 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
149 kwargs.setdefault(
"AugmentationTools", augmentationTools)
151 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
156 acc = ComponentAccumulator()
157 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
158 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
162 acc = ComponentAccumulator()
163 JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
164 acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=
True)
173 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
174 egamma tool, given the GainDecorator tool"""
176 tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
177 for info
in [
"E",
"nCells"]
178 for layer
in tool.layers
179 for gain
in tool.gain_names.values()
188 info=["E", "nCells"],
190 """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
191 Return a list with the 'ExtraContent' to be added to the decorations to save the gain
192 information per layer"""
194 if collections is None:
195 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
197 GainDecoratorTool = None
198 for tool in acc.getEventAlgo(kernel).AugmentationTools:
199 if tool.getType() == "DerivationFramework::GainDecorator":
200 GainDecoratorTool = tool
202 if GainDecoratorTool:
204 "{part}.{info}".format(part=part, info=info)
205 for part in collections
206 for info in getGainLayerNames(GainDecoratorTool)
212def getClusterEnergyPerLayerDecorations(acc, kernel):
213 """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
214 decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
215 object (e.g. Photons.E7x11_Lr0, ...)"""
216 properties = "SGKey_photons", "SGKey_electrons"
217 ClusterEnergyPerLayerDecorators = []
218 for tool in acc.getEventAlgo(kernel).AugmentationTools:
219 if tool.getType() == "DerivationFramework::ClusterEnergyPerLayerDecorator":
220 ClusterEnergyPerLayerDecorators.append(tool)
223 for tool in ClusterEnergyPerLayerDecorators:
224 collections = filter(bool, (getattr(tool, x) for x in properties))
225 for part in collections:
226 key = "SGKey_{}_decorations".format(str(part).lower())
227 decorations.extend(getattr(tool, key))
JetCaloClusterThinningCfg(flags, **kwargs)
CaloFillRectangularClusterCfg(flags, **kwargs)
CaloCellDecoratorCfg(flags, **kwargs)
MaxCellDecoratorKernelCfg(flags, name="MaxCellDecoratorKernel", **kwargs)
MaxCellDecoratorCfg(flags, name="MaxCellDecorator", **kwargs)
CaloClusterThinningCfg(flags, **kwargs)
ClusterEnergyPerLayerDecoratorCfg(flags, **kwargs)
getGainDecorations(acc, flags, kernel, collections=None, info=["E", "nCells"])
CaloCellDecoratorKernelCfg(flags, name="CaloCellDecoratorKernel", **kwargs)
EgammaCoreCellRecoveryCfg(flags, **kwargs)
getGainLayerNames(tool)
additional utilities to return the list of decorations added by the tools
GainDecoratorCfg(flags, **kwargs)
CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs)