ATLAS Offline Software
Functions
DerivationFrameworkCaloConfig Namespace Reference

Functions

def MaxCellDecoratorCfg (flags, **kwargs)
 
def GainDecoratorCfg (flags, **kwargs)
 
def EgammaCoreCellRecoveryCfg (flags, **kwargs)
 
def CaloFillRectangularClusterCfg (flags, **kwargs)
 
def ClusterEnergyPerLayerDecoratorCfg (flags, **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

◆ CaloClusterThinningCfg()

def DerivationFrameworkCaloConfig.CaloClusterThinningCfg (   flags,
**  kwargs 
)

Definition at line 99 of file DerivationFrameworkCaloConfig.py.

99 def CaloClusterThinningCfg(flags, **kwargs):
100  acc = ComponentAccumulator()
101  CaloClusterThinning = CompFactory.DerivationFramework.CaloClusterThinning
102  acc.addPublicTool(CaloClusterThinning(**kwargs), primary=True)
103  return acc
104 

◆ CaloDecoratorKernelCfg()

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

Definition at line 77 of file DerivationFrameworkCaloConfig.py.

77 def CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs):
78  acc = MaxCellDecoratorKernelCfg(flags)
79 
80  augmentationTools = [
81  acc.addPublicTool(acc.popToolsAndMerge(GainDecoratorCfg(flags)))
82  ]
83 
84  # might need some modification if cell-level reweighting is implemented
85  cluster_sizes = (3, 7), (5, 5), (7, 11)
86  for neta, nphi in cluster_sizes:
87  cename = "ClusterEnergyPerLayerDecorator_%sx%s" % (neta, nphi)
88  ClusterEnergyPerLayerDecorator = acc.popToolsAndMerge(
89  ClusterEnergyPerLayerDecoratorCfg(flags, neta=neta, nphi=nphi, name=cename)
90  )
91  augmentationTools.append(acc.addPublicTool(ClusterEnergyPerLayerDecorator))
92 
93  kwargs.setdefault("AugmentationTools", augmentationTools)
94 
95  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
96  return acc
97 
98 

◆ CaloFillRectangularClusterCfg()

def DerivationFrameworkCaloConfig.CaloFillRectangularClusterCfg (   flags,
**  kwargs 
)

Definition at line 36 of file DerivationFrameworkCaloConfig.py.

36 def CaloFillRectangularClusterCfg(flags, **kwargs):
37  acc = ComponentAccumulator()
38  kwargs.setdefault("cells_name", flags.Egamma.Keys.Input.CaloCells)
39  kwargs.setdefault("fill_cluster", True)
40  acc.setPrivateTools(CompFactory.CaloFillRectangularCluster(**kwargs))
41  return acc
42 
43 

◆ ClusterEnergyPerLayerDecoratorCfg()

def DerivationFrameworkCaloConfig.ClusterEnergyPerLayerDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 44 of file DerivationFrameworkCaloConfig.py.

44 def ClusterEnergyPerLayerDecoratorCfg(flags, **kwargs):
45  acc = ComponentAccumulator()
46  kwargs.setdefault("SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
47  kwargs.setdefault("SGKey_photons", flags.Egamma.Keys.Output.Photons)
48  kwargs.setdefault("SGKey_caloCells", flags.Egamma.Keys.Input.CaloCells)
49  kwargs.setdefault("neta", 5)
50  kwargs.setdefault("nphi", 5)
51  toolArgs = {}
52  toolArgs.update({"eta_size": kwargs["neta"]})
53  toolArgs.update({"phi_size": kwargs["nphi"]})
54  kwargs.setdefault(
55  "CaloFillRectangularClusterTool",
56  acc.popToolsAndMerge(CaloFillRectangularClusterCfg(flags, **toolArgs)),
57  )
58  acc.setPrivateTools(
59  CompFactory.DerivationFramework.ClusterEnergyPerLayerDecorator(**kwargs)
60  )
61  return acc
62 
63 

◆ EgammaCoreCellRecoveryCfg()

def DerivationFrameworkCaloConfig.EgammaCoreCellRecoveryCfg (   flags,
**  kwargs 
)

Definition at line 28 of file DerivationFrameworkCaloConfig.py.

28 def EgammaCoreCellRecoveryCfg(flags, **kwargs):
29  acc = ComponentAccumulator()
30  acc.setPrivateTools(
31  CompFactory.DerivationFramework.EGammaClusterCoreCellRecovery(**kwargs)
32  )
33  return acc
34 
35 

◆ GainDecoratorCfg()

def DerivationFrameworkCaloConfig.GainDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 19 of file DerivationFrameworkCaloConfig.py.

19 def GainDecoratorCfg(flags, **kwargs):
20  acc = ComponentAccumulator()
21  kwargs.setdefault("SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
22  kwargs.setdefault("SGKey_photons", flags.Egamma.Keys.Output.Photons)
23  kwargs.setdefault("name", "GainDecor")
24  acc.setPrivateTools(CompFactory.DerivationFramework.GainDecorator(**kwargs))
25  return acc
26 
27 

◆ 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 159 of file DerivationFrameworkCaloConfig.py.

159 def getClusterEnergyPerLayerDecorations(acc, kernel):
160  """getClusterEnergyPerLayerDecorationsLegacy( acc, kernel ) -> return a list of names of the
161  decorations added to the egamma object, given the ClusterEnergyPerLayerDecorations
162  object (e.g. Photons.E7x11_Lr0, ...)"""
163  properties = "SGKey_photons", "SGKey_electrons"
164  ClusterEnergyPerLayerDecorators = []
165  for toolStr in acc.getEventAlgo(kernel).AugmentationTools:
166  toolStr = f"{toolStr}"
167  splitStr = toolStr.split("/")
168  tool = acc.getPublicTool(splitStr[1])
169  if splitStr[0] == "DerivationFramework::ClusterEnergyPerLayerDecorator":
170  ClusterEnergyPerLayerDecorators.append(tool)
171 
172  decorations = []
173  for tool in ClusterEnergyPerLayerDecorators:
174  collections = filter(bool, (getattr(tool, x) for x in properties))
175  for part in collections:
176  for layer in tool.layers:
177  decorations.extend(
178  [
179  "{part}.E{neta}x{nphi}_Lr{layer}".format(
180  part=part,
181  neta=tool.neta,
182  nphi=tool.nphi,
183  layer=layer,
184  )
185  ]
186  )
187  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 127 of file DerivationFrameworkCaloConfig.py.

128  acc,
129  flags,
130  kernel,
131  collections=None,
132  info=["E", "nCells"],
133 ):
134  """getGainDecorations( acc, kernel collections=["Electrons", "Photons"] ) ->
135  Return a list with the 'ExtraContent' to be added to the decorations to save the gain
136  information per layer"""
137 
138  if collections is None:
139  collections = [flags.Egamma.Keys.Output.Electrons, flags.Egamma.Keys.Output.Photons]
140 
141  GainDecoratorTool = None
142  for toolStr in acc.getEventAlgo(kernel).AugmentationTools:
143  toolStr = f"{toolStr}"
144  splitStr = toolStr.split("/")
145  tool = acc.getPublicTool(splitStr[1])
146  if splitStr[0] == "DerivationFramework::GainDecorator":
147  GainDecoratorTool = tool
148 
149  if GainDecoratorTool:
150  return [
151  "{part}.{info}".format(part=part, info=info)
152  for part in collections
153  for info in getGainLayerNames(GainDecoratorTool)
154  ]
155  else:
156  return ""
157 
158 

◆ 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 116 of file DerivationFrameworkCaloConfig.py.

116 def getGainLayerNames(tool):
117  """getGainLayerNames( tool ) -> return a list of names of the decorations added to the
118  egamma tool, given the GainDecorator tool"""
119  return [
120  tool.decoration_pattern.format(info=info, layer=layer, gain=gain)
121  for info in ["E", "nCells"]
122  for layer in tool.layers
123  for gain in tool.gain_names.values()
124  ]
125 
126 

◆ JetCaloClusterThinningCfg()

def DerivationFrameworkCaloConfig.JetCaloClusterThinningCfg (   flags,
**  kwargs 
)

Definition at line 105 of file DerivationFrameworkCaloConfig.py.

105 def JetCaloClusterThinningCfg(flags, **kwargs):
106  acc = ComponentAccumulator()
107  JetCaloClusterThinning = CompFactory.DerivationFramework.JetCaloClusterThinning
108  acc.addPublicTool(JetCaloClusterThinning(**kwargs), primary=True)
109  return acc
110 

◆ MaxCellDecoratorCfg()

def DerivationFrameworkCaloConfig.MaxCellDecoratorCfg (   flags,
**  kwargs 
)

Definition at line 8 of file DerivationFrameworkCaloConfig.py.

8 def MaxCellDecoratorCfg(flags, **kwargs):
10  kwargs.setdefault("SGKey_electrons", flags.Egamma.Keys.Output.Electrons)
11  kwargs.setdefault("SGKey_photons", flags.Egamma.Keys.Output.Photons)
12  acc.setPrivateTools(CompFactory.DerivationFramework.MaxCellDecorator(**kwargs))
13  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
14 
15  acc.merge(LArOnOffIdMappingCfg(flags))
16  return acc
17 
18 

◆ MaxCellDecoratorKernelCfg()

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

Definition at line 64 of file DerivationFrameworkCaloConfig.py.

64 def MaxCellDecoratorKernelCfg(flags, name="MaxCellDecoratorKernel", **kwargs):
65  acc = ComponentAccumulator()
66 
67  augmentationTools = [
68  acc.addPublicTool(acc.popToolsAndMerge(MaxCellDecoratorCfg(flags)))
69  ]
70 
71  kwargs.setdefault("AugmentationTools", augmentationTools)
72 
73  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(name, **kwargs))
74  return acc
75 
76 
DerivationFrameworkCaloConfig.CaloClusterThinningCfg
def CaloClusterThinningCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:99
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:105
DerivationFrameworkCaloConfig.MaxCellDecoratorCfg
def MaxCellDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:8
covarianceTool.filter
filter
Definition: covarianceTool.py:514
DerivationFrameworkCaloConfig.EgammaCoreCellRecoveryCfg
def EgammaCoreCellRecoveryCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:28
DerivationFrameworkCaloConfig.GainDecoratorCfg
def GainDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:19
DerivationFrameworkCaloConfig.getGainLayerNames
def getGainLayerNames(tool)
additional utilities to return the list of decorations added by the tools
Definition: DerivationFrameworkCaloConfig.py:116
DerivationFrameworkCaloConfig.ClusterEnergyPerLayerDecoratorCfg
def ClusterEnergyPerLayerDecoratorCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:44
DerivationFrameworkCaloConfig.MaxCellDecoratorKernelCfg
def MaxCellDecoratorKernelCfg(flags, name="MaxCellDecoratorKernel", **kwargs)
Definition: DerivationFrameworkCaloConfig.py:64
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
DerivationFrameworkCaloConfig.CaloDecoratorKernelCfg
def CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs)
Definition: DerivationFrameworkCaloConfig.py:77
DerivationFrameworkCaloConfig.getClusterEnergyPerLayerDecorations
def getClusterEnergyPerLayerDecorations(acc, kernel)
Definition: DerivationFrameworkCaloConfig.py:159
DerivationFrameworkCaloConfig.getGainDecorations
def getGainDecorations(acc, flags, kernel, collections=None, info=["E", "nCells"])
Definition: DerivationFrameworkCaloConfig.py:127
DerivationFrameworkCaloConfig.CaloFillRectangularClusterCfg
def CaloFillRectangularClusterCfg(flags, **kwargs)
Definition: DerivationFrameworkCaloConfig.py:36