ATLAS Offline Software
Functions
DerivationFrameworkCaloConfig Namespace Reference

Functions

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

Function Documentation

◆ CaloCellDecoratorCfg()

def DerivationFrameworkCaloConfig.CaloCellDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 6 of file DerivationFrameworkCaloConfig.py.

6 def CaloCellDecoratorCfg(flags, **kwargs):
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
12 
13  acc.merge(LArOnOffIdMappingCfg(flags))
14  return acc
15 
16 

◆ CaloCellDecoratorKernelCfg()

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

Definition at line 79 of file DerivationFrameworkCaloConfig.py.

79 def CaloCellDecoratorKernelCfg(flags, name="CaloCellDecoratorKernel", **kwargs):
80  acc = ComponentAccumulator()
81 
82  augmentationTools = [
83  acc.addPublicTool(acc.popToolsAndMerge(CaloCellDecoratorCfg(flags)))
84  ]
85 
86  kwargs.setdefault("AugmentationTools", augmentationTools)
87 
88  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
89  return acc
90 
91 

◆ CaloClusterThinningCfg()

def DerivationFrameworkCaloConfig.CaloClusterThinningCfg (   flags,
**  kwargs 
)

Definition at line 127 of file DerivationFrameworkCaloConfig.py.

127 def CaloClusterThinningCfg(flags, **kwargs):
128  acc = ComponentAccumulator()
129  CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
130  acc.addPublicTool(CaloClusterThinning(**kwargs), primary=True)
131  return acc
132 

◆ CaloDecoratorKernelCfg()

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

Definition at line 105 of file DerivationFrameworkCaloConfig.py.

105 def CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs):
106  acc = MaxCellDecoratorKernelCfg(flags)
107 
108  augmentationTools = [
109  acc.addPublicTool(acc.popToolsAndMerge(GainDecoratorCfg(flags)))
110  ]
111 
112  # might need some modification if cell-level reweighting is implemented
113  cluster_sizes = (3, 7), (5, 5), (7, 11)
114  for neta, nphi in cluster_sizes:
115  cename = "ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
116  ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
117  ClusterEnergyPerLayerDecoratorCfg(flags, neta=neta, nphi=nphi, name=cename)
118  )
119  augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
120 
121  kwargs.setdefault("AugmentationTools", augmentationTools)
122 
123  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
124  return acc
125 
126 

◆ CaloFillRectangularClusterCfg()

def DerivationFrameworkCaloConfig.CaloFillRectangularClusterCfg (   flags,
**  kwargs 
)

Definition at line 51 of file DerivationFrameworkCaloConfig.py.

51 def CaloFillRectangularClusterCfg(flags, **kwargs):
52  acc = ComponentAccumulator()
53  kwargs.setdefault("cells_name", flags.Egamma.Keys.Input.CaloCells)
54  kwargs.setdefault("fill_cluster", True)
55  acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
56  return acc
57 
58 

◆ ClusterEnergyPerLayerDecoratorCfg()

def DerivationFrameworkCaloConfig.ClusterEnergyPerLayerDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 59 of file DerivationFrameworkCaloConfig.py.

59 def ClusterEnergyPerLayerDecoratorCfg(flags, **kwargs):
60  acc = ComponentAccumulator()
61  kwargs.setdefault("SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
62  kwargs.setdefault("SGKey_photons", flags.Egamma.Keys.Output.Photons)
63  kwargs.setdefault("SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
64  kwargs.setdefault("neta", 5)
65  kwargs.setdefault("nphi", 5)
66  toolArgs = {}
67  toolArgs.update({"eta_size": kwargs["neta"]})
68  toolArgs.update({"phi_size": kwargs["nphi"]})
69  kwargs.setdefault(
70  "CaloFillRectangularClusterTool",
71  acc.popToolsAndMerge(CaloFillRectangularClusterCfg(flags, **toolArgs)),
72  )
73  acc.setPrivateTools(
74  CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
75  )
76  return acc
77 
78 

◆ EgammaCoreCellRecoveryCfg()

def DerivationFrameworkCaloConfig.EgammaCoreCellRecoveryCfg (   flags,
**  kwargs 
)

Definition at line 37 of file DerivationFrameworkCaloConfig.py.

37 def EgammaCoreCellRecoveryCfg(flags, **kwargs):
38  acc = ComponentAccumulator()
39  # needed for reading cells, do not rely on other config to do that
40  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
41  acc.merge(LArGMCfg(flags))
42  from TileGeoModel.TileGMConfig import TileGMCfg
43  acc.merge(TileGMCfg(flags))
44  #
45  acc.setPrivateTools(
46  CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
47  )
48  return acc
49 
50 

◆ GainDecoratorCfg()

def DerivationFrameworkCaloConfig.GainDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 28 of file DerivationFrameworkCaloConfig.py.

28 def GainDecoratorCfg(flags, **kwargs):
29  acc = ComponentAccumulator()
30  kwargs.setdefault("SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
31  kwargs.setdefault("SGKey_photons", flags.Egamma.Keys.Output.Photons)
32  kwargs.setdefault("name", "GainDecor")
33  acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
34  return acc
35 
36 

◆ getClusterEnergyPerLayerDecorations()

def 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 184 of file DerivationFrameworkCaloConfig.py.

184 def getClusterEnergyPerLayerDecorations(acc, kernel):
185  """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
186  decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
187  object (e.g. Photons.E7x11_Lr0, ...)"""
188  properties = "SGKey_photons", "SGKey_electrons"
189  ClusterEnergyPerLayerDecorators = []
190  for tool in acc.getEventAlgo(kernel).AugmentationTools:
191  if tool.getType() == "DerivationFramework::ClusterEnergyPerLayerDecorator":
192  ClusterEnergyPerLayerDecorators.append(tool)
193 
194  decorations = []
195  for tool in ClusterEnergyPerLayerDecorators:
196  collections = filter(bool, (getattr(tool, x) for x in properties))
197  for part in collections:
198  for layer in tool.layers:
199  decorations.extend(
200  [
201  "{part}.E{neta}x{nphi}_Lr{layer}".format(
202  part=part,
203  neta=tool.neta,
204  nphi=tool.nphi,
205  layer=layer,
206  )
207  ]
208  )
209  return decorations

◆ getGainDecorations()

def 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 155 of file DerivationFrameworkCaloConfig.py.

156  acc,
157  flags,
158  kernel,
159  collections=None,
160  info=["E", "nCells"],
161 ):
162  """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
163  Return a list with the 'ExtraContent' to be added to the decorations to save the gain
164  information per layer"""
165 
166  if collections is None:
167  collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
168 
169  GainDecoratorTool = None
170  for tool in acc.getEventAlgo(kernel).AugmentationTools:
171  if tool.getType() == "DerivationFramework::GainDecorator":
172  GainDecoratorTool = tool
173 
174  if GainDecoratorTool:
175  return [
176  "{part}.{info}".format(part=part, info=info)
177  for part in collections
178  for info in getGainLayerNames(GainDecoratorTool)
179  ]
180  else:
181  return ""
182 
183 

◆ getGainLayerNames()

def 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 144 of file DerivationFrameworkCaloConfig.py.

144 def getGainLayerNames(tool):
145  """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
146  egamma tool, given the GainDecorator tool"""
147  return [
148  tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
149  for info in ["E", "nCells"]
150  for layer in tool.layers
151  for gain in tool.gain_names.values()
152  ]
153 
154 

◆ JetCaloClusterThinningCfg()

def DerivationFrameworkCaloConfig.JetCaloClusterThinningCfg (   flags,
**  kwargs 
)

Definition at line 133 of file DerivationFrameworkCaloConfig.py.

133 def JetCaloClusterThinningCfg(flags, **kwargs):
134  acc = ComponentAccumulator()
135  JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
136  acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=True)
137  return acc
138 

◆ MaxCellDecoratorCfg()

def DerivationFrameworkCaloConfig.MaxCellDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 17 of file DerivationFrameworkCaloConfig.py.

17 def MaxCellDecoratorCfg(flags, **kwargs):
18  acc = ComponentAccumulator()
19  kwargs.setdefault("SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
20  kwargs.setdefault("SGKey_photons", flags.Egamma.Keys.Output.Photons)
21  acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs))
22  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
23 
24  acc.merge(LArOnOffIdMappingCfg(flags))
25  return acc
26 
27 

◆ MaxCellDecoratorKernelCfg()

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

Definition at line 92 of file DerivationFrameworkCaloConfig.py.

92 def MaxCellDecoratorKernelCfg(flags, name="MaxCellDecoratorKernel", **kwargs):
93  acc = ComponentAccumulator()
94 
95  augmentationTools = [
96  acc.addPublicTool(acc.popToolsAndMerge(MaxCellDecoratorCfg(flags)))
97  ]
98 
99  kwargs.setdefault("AugmentationTools", augmentationTools)
100 
101  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
102  return acc
103 
104 
DerivationFrameworkCaloConfig.CaloClusterThinningCfg
def CaloClusterThinningCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:127
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
DerivationFrameworkCaloConfig.JetCaloClusterThinningCfg
def JetCaloClusterThinningCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:133
DerivationFrameworkCaloConfig.CaloCellDecoratorKernelCfg
def CaloCellDecoratorKernelCfg(flags, name="CaloCellDecoratorKernel", **kwargs)
Definition: DerivationFrameworkCaloConfig.py:79
DerivationFrameworkCaloConfig.MaxCellDecoratorCfg
def MaxCellDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:17
covarianceTool.filter
filter
Definition: covarianceTool.py:514
DerivationFrameworkCaloConfig.EgammaCoreCellRecoveryCfg
def EgammaCoreCellRecoveryCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:37
DerivationFrameworkCaloConfig.GainDecoratorCfg
def GainDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:28
DerivationFrameworkCaloConfig.getGainLayerNames
def getGainLayerNames(tool)
additional utilities to return the list of decorations added by the tools
Definition: DerivationFrameworkCaloConfig.py:144
DerivationFrameworkCaloConfig.ClusterEnergyPerLayerDecoratorCfg
def ClusterEnergyPerLayerDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:59
DerivationFrameworkCaloConfig.MaxCellDecoratorKernelCfg
def MaxCellDecoratorKernelCfg(flags, name="MaxCellDecoratorKernel", **kwargs)
Definition: DerivationFrameworkCaloConfig.py:92
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
DerivationFrameworkCaloConfig.CaloCellDecoratorCfg
def CaloCellDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:6
DerivationFrameworkCaloConfig.CaloDecoratorKernelCfg
def CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs)
Definition: DerivationFrameworkCaloConfig.py:105
DerivationFrameworkCaloConfig.getClusterEnergyPerLayerDecorations
def getClusterEnergyPerLayerDecorations(acc, kernel)
Definition: DerivationFrameworkCaloConfig.py:184
DerivationFrameworkCaloConfig.getGainDecorations
def getGainDecorations(acc, flags, kernel, collections=None, info=["E", "nCells"])
Definition: DerivationFrameworkCaloConfig.py:155
DerivationFrameworkCaloConfig.CaloFillRectangularClusterCfg
def CaloFillRectangularClusterCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:51
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7