ATLAS Offline Software
TrigSlimmingHelper.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 """Helper functions for adding trigger EDM content to a derivation"""
4 
5 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
6 from TrigEDMConfig.TriggerEDM import getTriggerEDMList
7 
8 
9 def addTrigEDMSetToOutput(flags, helper: SlimmingHelper, edmSet: str, edmVersion: int = None):
10  """Add a full trigger EDM set to the output slimming helper"""
11 
12  if edmVersion is None:
13  edmVersion = flags.Trigger.EDMVersion
14 
15  # Do nothing if there is no trigger payload in the input file
16  if edmVersion == -1:
17  return
18 
19  edmList = getTriggerEDMList(flags, key=edmSet, runVersion=edmVersion)
20  # This list is a mapping from container type to a list of required container names
21  # This includes the Aux containers and their lists of aux variables.
22  # The SlimmingHelper however requires the list of *interface* (non-Aux) containers.
23  # At this point we want all xAOD EDM members and all decorations which have propagated
24  # to the AOD to propagate down to the DAOD as well, so we fill the containers into AllVariables.
25  # We additionally pick up non-xAOD items in StaticContent
26  # Collate that information here
27  for cont_type, cont_list in edmList.items():
28  for container in cont_list:
29  # For the next part we need to know all the container names and the associated aux items
30  # If we can assume the standard relation between interface and aux names (which is
31  # probably safe) then we just need to look at the aux names for this.
32  interface_name, aux, auxitems = container.partition("Aux.")
33  if aux:
34  helper.AllVariables += [interface_name]
35 
36  if "xAOD::" not in cont_type:
37  helper.StaticContent += [f"{cont_type}#{container}"]
python.TriggerEDM.getTriggerEDMList
def getTriggerEDMList(flags, key, runVersion=-1)
Definition: TriggerEDM.py:149
TrigSlimmingHelper.addTrigEDMSetToOutput
def addTrigEDMSetToOutput(flags, SlimmingHelper helper, str edmSet, int edmVersion=None)
Definition: TrigSlimmingHelper.py:9