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)
38 kwargs.setdefault(
"ExtraInputs", [(
"CaloCellContainer", flags.Egamma.Keys.Input.CaloCells)])
40 acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(name, **kwargs))
41 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
43 acc.merge(LArOnOffIdMappingCfg(flags))
48 acc = ComponentAccumulator()
49 decorationPattern = kwargs.pop(
"decoration_pattern",
"{}_Lr{}_{}G")
50 kwargs.setdefault(
"gain_names", { 0 :
"Hi", 1 :
"Med", 2 :
"Low" })
51 kwargs.setdefault(
"layers", [0, 1, 2, 3])
53 for x, gain
in kwargs[
"gain_names"].items():
54 for layer
in kwargs[
"layers"]:
55 decorNames += [decorationPattern.format(
"E", layer, gain)]
56 decorNames += [decorationPattern.format(
"rnoW", layer, gain)]
57 decorNames += [decorationPattern.format(
"nCells", layer, gain)]
58 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
59 kwargs.setdefault(
"SGKey_electrons_decorations", decorNames)
60 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
61 kwargs.setdefault(
"SGKey_photons_decorations", decorNames)
62 kwargs.setdefault(
"name",
"GainDecor")
63 acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
68 acc = ComponentAccumulator()
70 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
71 acc.merge(LArGMCfg(flags))
72 from TileGeoModel.TileGMConfig
import TileGMCfg
73 acc.merge(TileGMCfg(flags))
76 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
82 acc = ComponentAccumulator()
83 kwargs.setdefault(
"cells_name", flags.Egamma.Keys.Input.CaloCells)
84 kwargs.setdefault(
"fill_cluster",
True)
85 acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
90 acc = ComponentAccumulator()
91 kwargs.setdefault(
"SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
92 kwargs.setdefault(
"SGKey_photons", flags.Egamma.Keys.Output.Photons)
93 kwargs.setdefault(
"SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
94 neta = kwargs.pop(
"neta", 5)
95 nphi = kwargs.pop(
"nphi", 5)
96 kwargs.setdefault(
"layers", [ 0, 1, 2, 3 ])
97 decorBase =
"E{}x{}_Lr".format(neta, nphi)
98 kwargs.setdefault(
"SGKey_photons_decorations", [decorBase+
str(layer)
for layer
in kwargs[
'layers']])
99 kwargs.setdefault(
"SGKey_electrons_decorations", [decorBase+
str(layer)
for layer
in kwargs[
'layers']])
101 toolArgs.update({
"eta_size": neta})
102 toolArgs.update({
"phi_size": nphi})
104 "CaloFillRectangularClusterTool",
108 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
114 acc = ComponentAccumulator()
116 augmentationTools = [
120 kwargs.setdefault(
"AugmentationTools", augmentationTools)
122 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
127 acc = ComponentAccumulator()
129 augmentationTools = [
133 kwargs.setdefault(
"AugmentationTools", augmentationTools)
135 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
142 augmentationTools = [
147 cluster_sizes = (3, 7), (5, 5), (7, 11)
148 for neta, nphi
in cluster_sizes:
149 cename =
"ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
150 ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
153 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
155 kwargs.setdefault(
"AugmentationTools", augmentationTools)
157 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
162 acc = ComponentAccumulator()
163 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
164 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=
True)
168 acc = ComponentAccumulator()
169 JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
170 acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=
True)
179 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
180 egamma tool, given the GainDecorator tool"""
182 tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
183 for info
in [
"E",
"nCells"]
184 for layer
in tool.layers
185 for gain
in tool.gain_names.values()
194 info=["E", "nCells"],
196 """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
197 Return a list with the 'ExtraContent' to be added to the decorations to save the gain
198 information per layer"""
200 if collections is None:
201 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
203 GainDecoratorTool = None
204 for tool in acc.getEventAlgo(kernel).AugmentationTools:
205 if tool.getType() == "DerivationFramework::GainDecorator":
206 GainDecoratorTool = tool
208 if GainDecoratorTool:
210 "{part}.{info}".format(part=part, info=info)
211 for part in collections
212 for info in getGainLayerNames(GainDecoratorTool)
218def getClusterEnergyPerLayerDecorations(acc, kernel):
219 """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
220 decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
221 object (e.g. Photons.E7x11_Lr0, ...)"""
222 properties = "SGKey_photons", "SGKey_electrons"
223 ClusterEnergyPerLayerDecorators = []
224 for tool in acc.getEventAlgo(kernel).AugmentationTools:
225 if tool.getType() == "DerivationFramework::ClusterEnergyPerLayerDecorator":
226 ClusterEnergyPerLayerDecorators.append(tool)
229 for tool in ClusterEnergyPerLayerDecorators:
230 collections = filter(bool, (getattr(tool, x) for x in properties))
231 for part in collections:
232 key = "SGKey_{}_decorations".format(str(part).lower())
233 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)