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 acc.setPrivateTools(CompFactory.DerivationFramework.CaloCellDecorator(**kwargs))
11 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
13 acc.merge(LArOnOffIdMappingCfg(flags))
18 acc = ComponentAccumulator()
19 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
20 baseDecorations =[
"maxEcell_time",
"maxEcell_energy",
"maxEcell_gain",
21 "maxEcell_onlId",
"maxEcell_x",
"maxEcell_y",
"maxEcell_z"]
22 electronDecorations = baseDecorations
23 kwargs.setdefault(
"SGKey_egammaClusters",
"")
24 if kwargs[
"SGKey_egammaClusters"] !=
'':
25 electronDecorations += [
"dR"]
26 kwargs.setdefault(
"SGKey_electrons_decorations", electronDecorations)
27 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
28 acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(name, **kwargs))
29 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
31 acc.merge(LArOnOffIdMappingCfg(flags))
36 acc = ComponentAccumulator()
37 decorationPattern = kwargs.pop(
"decoration_pattern",
"{}_Lr{}_{}G")
38 kwargs.setdefault(
"gain_names", { 0 :
"Hi", 1 :
"Med", 2 :
"Low" })
39 kwargs.setdefault(
"layers", [0, 1, 2, 3])
41 for x, gain
in kwargs[
"gain_names"].items():
42 for layer
in kwargs[
"layers"]:
43 decorNames += [decorationPattern.format(
"E", layer, gain)]
44 decorNames += [decorationPattern.format(
"rnoW", layer, gain)]
45 decorNames += [decorationPattern.format(
"nCells", layer, gain)]
46 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
47 kwargs.setdefault(
"SGKey_electrons_decorations", decorNames)
48 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
49 kwargs.setdefault(
"SGKey_photons_decorations", decorNames)
50 kwargs.setdefault(
"name",
"GainDecor")
51 acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
56 acc = ComponentAccumulator()
58 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
59 acc.merge(LArGMCfg(flags))
60 from TileGeoModel.TileGMConfig
import TileGMCfg
61 acc.merge(TileGMCfg(flags))
64 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
70 acc = ComponentAccumulator()
71 kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
72 kwargs.setdefault(
"fill_cluster",
True)
73 acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
78 acc = ComponentAccumulator()
79 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
80 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
81 kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
82 neta = kwargs.pop(
"neta", 5)
83 nphi = kwargs.pop(
"nphi", 5)
84 kwargs.setdefault(
"layers", [ 0, 1, 2, 3 ])
85 decorBase =
"E{}x{}_Lr".format(neta, nphi)
86 kwargs.setdefault(
"SGKey_photons_decorations", [decorBase+str(layer)
for layer
in kwargs[
'layers']])
87 kwargs.setdefault(
"SGKey_electrons_decorations", [decorBase+str(layer)
for layer
in kwargs[
'layers']])
89 toolArgs.update({
"eta_size": neta})
90 toolArgs.update({
"phi_size": nphi})
92 "CaloFillRectangularClusterTool",
96 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
102 acc = ComponentAccumulator()
104 augmentationTools = [
108 kwargs.setdefault(
"AugmentationTools", augmentationTools)
110 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
115 acc = ComponentAccumulator()
117 augmentationTools = [
121 kwargs.setdefault(
"AugmentationTools", augmentationTools)
123 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
130 augmentationTools = [
135 cluster_sizes = (3, 7), (5, 5), (7, 11)
136 for neta, nphi
in cluster_sizes:
137 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
138 ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
141 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
143 kwargs.setdefault(
"AugmentationTools", augmentationTools)
145 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
150 acc = ComponentAccumulator()
151 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
152 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
156 acc = ComponentAccumulator()
157 JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
158 acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=
True)
167 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
168 egamma tool, given the GainDecorator tool"""
170 tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
171 for info
in [
"E",
"nCells"]
172 for layer
in tool.layers
173 for gain
in tool.gain_names.values()
182 info=["E", "nCells"],
184 """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
185 Return a list with the 'ExtraContent' to be added to the decorations to save the gain
186 information per layer"""
188 if collections is None:
189 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
191 GainDecoratorTool = None
192 for tool in acc.getEventAlgo(kernel).AugmentationTools:
193 if tool.getType() == "DerivationFramework::GainDecorator":
194 GainDecoratorTool = tool
196 if GainDecoratorTool:
198 "{part}.{info}".format(part=part, info=info)
199 for part in collections
200 for info in getGainLayerNames(GainDecoratorTool)
206def getClusterEnergyPerLayerDecorations(acc, kernel):
207 """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
208 decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
209 object (e.g. Photons.E7x11_Lr0, ...)"""
210 properties = "SGKey_photons", "SGKey_electrons"
211 ClusterEnergyPerLayerDecorators = []
212 for tool in acc.getEventAlgo(kernel).AugmentationTools:
213 if tool.getType() == "DerivationFramework::ClusterEnergyPerLayerDecorator":
214 ClusterEnergyPerLayerDecorators.append(tool)
217 for tool in ClusterEnergyPerLayerDecorators:
218 collections = filter(bool, (getattr(tool, x) for x in properties))
219 for part in collections:
220 key = "SGKey_{}_decorations".format(str(part).lower())
221 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)