ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.TriggerListsHelper.TriggerListsHelper Class Reference
Collaboration diagram for python.TriggerListsHelper.TriggerListsHelper:

Public Member Functions

def __init__ (self, flags)
 
def GetTriggerLists (self)
 

Public Attributes

 flags
 
 Run2TriggerNamesTau
 
 Run2TriggerNamesNoTau
 See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI Get single and multi mu, e, photon triggers Jet, tau, multi-object triggers not available in the matching code. More...
 
 Run3TriggerNames
 Add Run 2 cross-triggers for some sets. More...
 

Detailed Description

Definition at line 73 of file TriggerListsHelper.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TriggerListsHelper.TriggerListsHelper.__init__ (   self,
  flags 
)

Definition at line 74 of file TriggerListsHelper.py.

74  def __init__(self, flags):
75  self.flags = flags
76  TriggerAPI.setConfigFlags(flags)
77  self.Run2TriggerNamesTau = []
78  self.Run2TriggerNamesNoTau = []
79  self.Run3TriggerNames = []
80  self.GetTriggerLists()
81 

Member Function Documentation

◆ GetTriggerLists()

def python.TriggerListsHelper.TriggerListsHelper.GetTriggerLists (   self)

Definition at line 82 of file TriggerListsHelper.py.

82  def GetTriggerLists(self):
83 
84  md = GetFileMD(self.flags.Input.Files)
85  hlt_menu = md.get('TriggerMenu', {}).get('HLTChains', None)
86 
87  if self.flags.Trigger.EDMVersion <= 2:
88 
89  # Trigger API for Runs 1, 2
90  #====================================================================
91  # TRIGGER CONTENT
92  #====================================================================
93 
96  allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34
97  trig_el = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, livefraction=0.8)
98  trig_mu = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, livefraction=0.8)
99  trig_g = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.g, livefraction=0.8)
100  trig_tau = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, livefraction=0.8)
101 
102  trig_em = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.mu, livefraction=0.8)
103  trig_et = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.el, additionalTriggerType=TriggerType.tau, livefraction=0.8)
104  trig_mt = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.mu, additionalTriggerType=TriggerType.tau, livefraction=0.8)
105  # Note that this seems to pick up both isolated and non-isolated triggers already, so no need for extra grabs
106  trig_txe = TriggerAPI.getLowestUnprescaledAnyPeriod(allperiods, triggerType=TriggerType.tau, additionalTriggerType=TriggerType.xe, livefraction=0.8)
107 
108 
109  extra_file_notau = read_trig_list_file("DerivationFrameworkPhys/run2ExtraMatchingTriggers.txt")
110  extra_file_tau = read_trig_list_file("DerivationFrameworkPhys/run2ExtraMatchingTauTriggers.txt")
111 
112 
113  extra_flag_notau, extra_flag_tau = read_trig_list_flags(self.flags)
114 
115 
116  trigger_names_full_notau = list(set(trig_el+trig_mu+trig_g+trig_em+trig_et+trig_mt+extra_file_notau+extra_flag_notau))
117  trigger_names_full_tau = list(set(trig_tau+trig_txe+extra_file_tau+extra_flag_tau))
118 
119 
120  trigger_names_notau = []
121  trigger_names_tau = []
122 
123  if hlt_menu:
124  for chain_name in hlt_menu:
125  if chain_name in trigger_names_full_notau: trigger_names_notau.append(chain_name)
126  if chain_name in trigger_names_full_tau: trigger_names_tau.append(chain_name)
127  else: # No means to filter based on in-file metadata
128  trigger_names_notau = trigger_names_full_notau
129  trigger_names_tau = trigger_names_full_tau
130 
131  self.Run2TriggerNamesNoTau = trigger_names_notau
132  self.Run2TriggerNamesTau = trigger_names_tau
133 
134  else: # Run 3 and Run 4
135 
136  # TriggerAPI Session based trigger lists
137  session = getTapisSession(self.flags)
138  lf = 0.8 # Prescale weighted life fraction of the GRL's LBs
139  api_trigger_names = set()
140  api_trigger_names = session.getLowestUnprescaled(triggerType=TriggerType.el, livefraction=lf).union(api_trigger_names)
141  api_trigger_names = session.getLowestUnprescaled(triggerType=TriggerType.mu, livefraction=lf).union(api_trigger_names)
142  api_trigger_names = session.getLowestUnprescaled(triggerType=TriggerType.g, livefraction=lf).union(api_trigger_names)
143  api_trigger_names = session.getLowestUnprescaled(triggerType=TriggerType.tau, livefraction=lf).union(api_trigger_names)
144 
145  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.el, TriggerType.mu], livefraction=lf).union(api_trigger_names)
146  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.el, TriggerType.tau], livefraction=lf).union(api_trigger_names)
147  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.mu, TriggerType.tau], livefraction=lf).union(api_trigger_names)
148  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.tau, TriggerType.xe], livefraction=lf).union(api_trigger_names)
149 
150  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.el, TriggerType.g], livefraction=lf).union(api_trigger_names)
151  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.el, TriggerType.xe], livefraction=lf).union(api_trigger_names)
152  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.mu, TriggerType.g], livefraction=lf).union(api_trigger_names)
153  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.g, TriggerType.xe], livefraction=lf).union(api_trigger_names)
154  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.tau, TriggerType.g], livefraction=lf).union(api_trigger_names)
155 
156  # Add hadronic categories, new for Run 3
157  api_trigger_names = session.getLowestUnprescaled(triggerType=TriggerType.j, livefraction=lf).union(api_trigger_names)
158  api_trigger_names = session.getLowestUnprescaled(triggerType=TriggerType.bj, livefraction=lf).union(api_trigger_names)
159  # Add cross-triggers as well
160  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.el, TriggerType.j], livefraction=lf).union(api_trigger_names)
161  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.mu, TriggerType.j], livefraction=lf).union(api_trigger_names)
162  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.j, TriggerType.bj], livefraction=lf).union(api_trigger_names)
163  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.j, TriggerType.g], livefraction=lf).union(api_trigger_names)
164  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.j, TriggerType.tau], livefraction=lf).union(api_trigger_names)
165  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.j, TriggerType.xe], livefraction=lf).union(api_trigger_names)
166  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.j, TriggerType.ht], livefraction=lf).union(api_trigger_names)
167  api_trigger_names = session.getLowestUnprescaled(triggerType=[TriggerType.bj, TriggerType.xe], livefraction=lf).union(api_trigger_names)
168 
169 
170  extra_flag_notau, extra_flag_tau = read_trig_list_flags(self.flags)
171  extra_flag = extra_flag_notau + extra_flag_tau
172 
173 
174  extra_file = read_trig_list_file("DerivationFrameworkPhys/run3ExtraMatchingTriggers.txt")
175 
176 
177  self.Run3TriggerNames = list(set(extra_file + extra_flag + list(api_trigger_names)))
178 
179  return

Member Data Documentation

◆ flags

python.TriggerListsHelper.TriggerListsHelper.flags

Definition at line 75 of file TriggerListsHelper.py.

◆ Run2TriggerNamesNoTau

python.TriggerListsHelper.TriggerListsHelper.Run2TriggerNamesNoTau

See https://twiki.cern.ch/twiki/bin/view/Atlas/TriggerAPI Get single and multi mu, e, photon triggers Jet, tau, multi-object triggers not available in the matching code.

Add cross-triggers for some sets Add extra chains which were specified via repository include-lists Add extra chains from flags Merge and remove duplicates Now reduce the list based on the content of the first input AOD

Definition at line 78 of file TriggerListsHelper.py.

◆ Run2TriggerNamesTau

python.TriggerListsHelper.TriggerListsHelper.Run2TriggerNamesTau

Definition at line 77 of file TriggerListsHelper.py.

◆ Run3TriggerNames

python.TriggerListsHelper.TriggerListsHelper.Run3TriggerNames

Add Run 2 cross-triggers for some sets.

Add additional cross-trigger categories identified from investigating API output Add extra chains from flags Add extra chains from file Merge and remove duplicates

Definition at line 79 of file TriggerListsHelper.py.


The documentation for this class was generated from the following file:
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True, maxLevel='peeker')
Definition: AutoConfigFlags.py:65
python.TriggerListsHelper.read_trig_list_flags
def read_trig_list_flags(flags)
Definition: TriggerListsHelper.py:22
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.TriggerListsHelper.read_trig_list_file
def read_trig_list_file(fname)
Definition: TriggerListsHelper.py:9
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.TriggerListsHelper.getTapisSession
def getTapisSession(flags)
Definition: TriggerListsHelper.py:32