ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFrameworkCaloConfig Namespace Reference

Functions

 CaloCellDecoratorCfg (flags, **kwargs)
 MaxCellDecoratorCfg (flags, name="MaxCellDecorator", **kwargs)
 GainDecoratorCfg (flags, **kwargs)
 EgammaCoreCellRecoveryCfg (flags, **kwargs)
 CaloFillRectangularClusterCfg (flags, **kwargs)
 ClusterEnergyPerLayerDecoratorCfg (flags, **kwargs)
 CaloCellDecoratorKernelCfg (flags, name="CaloCellDecoratorKernel", **kwargs)
 MaxCellDecoratorKernelCfg (flags, name="MaxCellDecoratorKernel", **kwargs)
 CaloDecoratorKernelCfg (flags, name="CaloDecoratorKernel", **kwargs)
 CaloClusterThinningCfg (flags, **kwargs)
 JetCaloClusterThinningCfg (flags, **kwargs)
 getGainLayerNames (tool)
 additional utilities to return the list of decorations added by the tools
 getGainDecorations (acc, flags, kernel, collections=None, info=["E", "nCells"])
 getClusterEnergyPerLayerDecorations (acc, kernel)

Function Documentation

◆ CaloCellDecoratorCfg()

DerivationFrameworkCaloConfig.CaloCellDecoratorCfg ( flags,
** kwargs )

Definition at line 6 of file DerivationFrameworkCaloConfig.py.

6def CaloCellDecoratorCfg(flags, **kwargs):
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)
11
12 from egammaCaloTools.egammaCaloToolsConfig import egammaLargeClusterCellRecoveryToolCfg
13 kwargs.setdefault("egammaLargeClusterCellRecoveryTool",
14 acc.popToolsAndMerge(egammaLargeClusterCellRecoveryToolCfg(flags)))
15
16 acc.setPrivateTools(CompFactory.DerivationFramework.CaloCellDecorator(**kwargs))
17 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
18
19 acc.merge(LArOnOffIdMappingCfg(flags))
20 return acc
21
22

◆ CaloCellDecoratorKernelCfg()

DerivationFrameworkCaloConfig.CaloCellDecoratorKernelCfg ( flags,
name = "CaloCellDecoratorKernel",
** kwargs )

Definition at line 113 of file DerivationFrameworkCaloConfig.py.

113def CaloCellDecoratorKernelCfg(flags, name="CaloCellDecoratorKernel", **kwargs):
114 acc = ComponentAccumulator()
115
116 augmentationTools = [
117 acc.addPublicTool(acc.popToolsAndMerge(CaloCellDecoratorCfg(flags)))
118 ]
119
120 kwargs.setdefault("AugmentationTools", augmentationTools)
121
122 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
123 return acc
124
125

◆ CaloClusterThinningCfg()

DerivationFrameworkCaloConfig.CaloClusterThinningCfg ( flags,
** kwargs )

Definition at line 161 of file DerivationFrameworkCaloConfig.py.

161def CaloClusterThinningCfg(flags, **kwargs):
162 acc = ComponentAccumulator()
163 CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
164 acc.addPublicTool(CaloClusterThinning(**kwargs), primary=True)
165 return acc
166

◆ CaloDecoratorKernelCfg()

DerivationFrameworkCaloConfig.CaloDecoratorKernelCfg ( flags,
name = "CaloDecoratorKernel",
** kwargs )

Definition at line 139 of file DerivationFrameworkCaloConfig.py.

139def CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs):
140 acc = MaxCellDecoratorKernelCfg(flags)
141
142 augmentationTools = [
143 acc.addPublicTool(acc.popToolsAndMerge(GainDecoratorCfg(flags)))
144 ]
145
146 # might need some modification if cell-level reweighting is implemented
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(
151 ClusterEnergyPerLayerDecoratorCfg(flags, neta=neta, nphi=nphi, name=cename)
152 )
153 augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
154
155 kwargs.setdefault("AugmentationTools", augmentationTools)
156
157 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
158 return acc
159
160

◆ CaloFillRectangularClusterCfg()

DerivationFrameworkCaloConfig.CaloFillRectangularClusterCfg ( flags,
** kwargs )

Definition at line 81 of file DerivationFrameworkCaloConfig.py.

81def CaloFillRectangularClusterCfg(flags, **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))
86 return acc
87
88

◆ ClusterEnergyPerLayerDecoratorCfg()

DerivationFrameworkCaloConfig.ClusterEnergyPerLayerDecoratorCfg ( flags,
** kwargs )

Definition at line 89 of file DerivationFrameworkCaloConfig.py.

89def ClusterEnergyPerLayerDecoratorCfg(flags, **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']])
100 toolArgs = {}
101 toolArgs.update({"eta_size": neta})
102 toolArgs.update({"phi_size": nphi})
103 kwargs.setdefault(
104 "CaloFillRectangularClusterTool",
105 acc.popToolsAndMerge(CaloFillRectangularClusterCfg(flags, **toolArgs)),
106 )
107 acc.setPrivateTools(
108 CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
109 )
110 return acc
111
112

◆ EgammaCoreCellRecoveryCfg()

DerivationFrameworkCaloConfig.EgammaCoreCellRecoveryCfg ( flags,
** kwargs )

Definition at line 67 of file DerivationFrameworkCaloConfig.py.

67def EgammaCoreCellRecoveryCfg(flags, **kwargs):
68 acc = ComponentAccumulator()
69 # needed for reading cells, do not rely on other config to do that
70 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
71 acc.merge(LArGMCfg(flags))
72 from TileGeoModel.TileGMConfig import TileGMCfg
73 acc.merge(TileGMCfg(flags))
74 #
75 acc.setPrivateTools(
76 CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
77 )
78 return acc
79
80

◆ GainDecoratorCfg()

DerivationFrameworkCaloConfig.GainDecoratorCfg ( flags,
** kwargs )

Definition at line 47 of file DerivationFrameworkCaloConfig.py.

47def GainDecoratorCfg(flags, **kwargs):
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])
52 decorNames = []
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))
64 return acc
65
66

◆ getClusterEnergyPerLayerDecorations()

DerivationFrameworkCaloConfig.getClusterEnergyPerLayerDecorations ( acc,
kernel )
getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
object (e.g. Photons.E7x11_Lr0, ...)

Definition at line 218 of file DerivationFrameworkCaloConfig.py.

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)
227
228 decorations = []
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))
234 return decorations

◆ getGainDecorations()

DerivationFrameworkCaloConfig.getGainDecorations ( acc,
flags,
kernel,
collections = None,
info = ["E", "nCells"] )
getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
Return a list with the 'ExtraContent' to be added to the decorations to save the gain
information per layer

Definition at line 189 of file DerivationFrameworkCaloConfig.py.

195):
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"""
199
200 if collections is None:
201 collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
202
203 GainDecoratorTool = None
204 for tool in acc.getEventAlgo(kernel).AugmentationTools:
205 if tool.getType() == "DerivationFramework::GainDecorator":
206 GainDecoratorTool = tool
207
208 if GainDecoratorTool:
209 return [
210 "{part}.{info}".format(part=part, info=info)
211 for part in collections
212 for info in getGainLayerNames(GainDecoratorTool)
213 ]
214 else:
215 return ""
216
217

◆ getGainLayerNames()

DerivationFrameworkCaloConfig.getGainLayerNames ( tool)

additional utilities to return the list of decorations added by the tools

getGainLayerNames( tool ) -> return a list of names of the decorations added to the
egamma tool, given the GainDecorator tool

Definition at line 178 of file DerivationFrameworkCaloConfig.py.

178def getGainLayerNames(tool):
179 """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
180 egamma tool, given the GainDecorator tool"""
181 return [
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()
186 ]
187
188

◆ JetCaloClusterThinningCfg()

DerivationFrameworkCaloConfig.JetCaloClusterThinningCfg ( flags,
** kwargs )

Definition at line 167 of file DerivationFrameworkCaloConfig.py.

167def JetCaloClusterThinningCfg(flags, **kwargs):
168 acc = ComponentAccumulator()
169 JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
170 acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=True)
171 return acc
172

◆ MaxCellDecoratorCfg()

DerivationFrameworkCaloConfig.MaxCellDecoratorCfg ( flags,
name = "MaxCellDecorator",
** kwargs )

Definition at line 23 of file DerivationFrameworkCaloConfig.py.

23def MaxCellDecoratorCfg(flags, name="MaxCellDecorator", **kwargs):
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
35 # MaxCellDecorator looks at cells, but accesses them only via links,
36 # so the scheduler doesn't see the dependency. Add it explicitly using
37 # ExtraInputs.
38 kwargs.setdefault("ExtraInputs", [("CaloCellContainer", flags.Egamma.Keys.Input.CaloCells)])
39
40 acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(name, **kwargs))
41 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
42
43 acc.merge(LArOnOffIdMappingCfg(flags))
44 return acc
45
46

◆ MaxCellDecoratorKernelCfg()

DerivationFrameworkCaloConfig.MaxCellDecoratorKernelCfg ( flags,
name = "MaxCellDecoratorKernel",
** kwargs )

Definition at line 126 of file DerivationFrameworkCaloConfig.py.

126def MaxCellDecoratorKernelCfg(flags, name="MaxCellDecoratorKernel", **kwargs):
127 acc = ComponentAccumulator()
128
129 augmentationTools = [
130 acc.addPublicTool(acc.popToolsAndMerge(MaxCellDecoratorCfg(flags)))
131 ]
132
133 kwargs.setdefault("AugmentationTools", augmentationTools)
134
135 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
136 return acc
137
138