ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | Static Private Attributes | List of all members
GenerateMenuMT.GenerateMenuMT Class Reference
Inheritance diagram for GenerateMenuMT.GenerateMenuMT:
Collaboration diagram for GenerateMenuMT.GenerateMenuMT:

Public Member Functions

def getRequiredSignatures (theslice)
 
def __init__ (self)
 
def setChainFilter (self, f)
 
def getChainDicts (self, flags)
 
def importSignaturesToGenerate (self)
 
def generateChains (self, flags)
 
def generateAllChainConfigs (self, flags)
 
def getChainsFromMenu (self, flags)
 
def resolveEmptySteps (self, chainConfigs)
 
def __call__ (cls, *args, **kwargs)
 
def clear (cls)
 

Public Attributes

 chainsInMenu
 
 allChainsForAlignment
 
 chainDicts
 
 combinationsInMenu
 
 alignmentGroupsToAlign
 
 configLengthDict
 
 signaturesOverwritten
 
 L1Prescales
 
 HLTPrescales
 
 chainFilter
 
 availableSignatures
 
 sigDicts
 
 chainDefModule
 

Private Member Functions

def __generateChainConfig (self, flags, mainChainDict)
 

Static Private Attributes

 _instances
 

Detailed Description

Singleton class for trigger menu

Definition at line 59 of file GenerateMenuMT.py.

Constructor & Destructor Documentation

◆ __init__()

def GenerateMenuMT.GenerateMenuMT.__init__ (   self)

Definition at line 76 of file GenerateMenuMT.py.

76  def __init__(self):
77  self.chainsInMenu = {} # signature : [chains]
78 
79  self.allChainsForAlignment = []
80  self.chainDicts = []
81  self.combinationsInMenu = []
82  self.alignmentGroupsToAlign = set()
83  self.configLengthDict = {}
84 
85  self.signaturesOverwritten = False
86  self.L1Prescales = None
87  self.HLTPrescales = None
88 
89  self.chainFilter = None
90  self.availableSignatures = []
91 
92  self.sigDicts = {}
93 
94  self.chainDefModule = {} # Generate[SIG]ChainDefs module for each SIGnature
95 

Member Function Documentation

◆ __call__()

def GenerateMenuMT.Singleton.__call__ (   cls,
args,
**  kwargs 
)
inherited

Definition at line 50 of file GenerateMenuMT.py.

50  def __call__(cls, *args, **kwargs):
51  if cls not in cls._instances:
52  cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
53  return cls._instances[cls]
54 

◆ __generateChainConfig()

def GenerateMenuMT.GenerateMenuMT.__generateChainConfig (   self,
  flags,
  mainChainDict 
)
private
# Assembles the chain configuration and returns a chain object with (name, L1see and list of ChainSteps)

Definition at line 356 of file GenerateMenuMT.py.

356  def __generateChainConfig(self, flags, mainChainDict):
357  """
358  # Assembles the chain configuration and returns a chain object with (name, L1see and list of ChainSteps)
359  """
360 
361  from TriggerMenuMT.HLT.Config.Utility.ChainDictTools import splitInterSignatureChainDict
362  from TriggerMenuMT.HLT.Config.Utility.ComboHypoHandling import addTopoInfo, comboConfigurator, topoLegIndices
363  from TriggerMenuMT.HLT.Config.Utility.ChainMerging import mergeChainDefs
364  from TriggerMenuMT.HLT.CommonSequences import EventBuildingSequences, TLABuildingSequences
365 
366  # split the the chainDictionaries for each chain and print them in a pretty way
367  chainDicts = splitInterSignatureChainDict(mainChainDict)
368 
369  if log.isEnabledFor(logging.DEBUG):
370  import pprint
371  pp = pprint.PrettyPrinter(indent=4, depth=8)
372  log.debug('dictionary is: %s', pp.pformat(chainDicts))
373 
374  # Loop over all chainDicts and send them off to their respective assembly code
375  listOfChainConfigs = []
376  perSig_lengthOfChainConfigs = []
377 
378  for chainPartDict in chainDicts:
379  chainPartConfig = None
380  currentSig = chainPartDict['signature']
381  currentAlignGroup = None
382  if len(chainPartDict['chainParts']) == 1:
383  currentAlignGroup = chainPartDict['chainParts'][0]['alignmentGroup']
384 
385  chainName = chainPartDict['chainName']
386  log.debug('Checking chainDict for chain %s in signature %s, alignment group %s' , chainName, currentSig, currentAlignGroup)
387 
388  if currentSig in self.availableSignatures:
389  try:
390  log.debug("[__generateChainConfigs] Trying to get chain config for %s", currentSig)
391  if currentSig in ['Electron', 'Photon', 'Muon', 'Tau', 'Bphysics'] :
392  chainPartConfig, perSig_lengthOfChainConfigs = self.chainDefModule[currentSig].generateChainConfigs(flags, chainPartDict, perSig_lengthOfChainConfigs)
393  else:
394  chainPartConfig = self.chainDefModule[currentSig].generateChainConfigs(flags, chainPartDict)
395  if currentSig == 'Test' and isinstance(chainPartConfig, tuple):
396  chainPartConfig = chainPartConfig[0]
397  except Exception:
398  log.error('[__generateChainConfigs] Problems creating ChainDef for chain %s ', chainName)
399  log.error('[__generateChainConfigs] I am in chain part\n %s ', chainPartDict)
400  log.exception('[__generateChainConfigs] Full chain dictionary is\n %s ', mainChainDict)
401  raise Exception('[__generateChainConfigs] Stopping menu generation. Please investigate the exception shown above.')
402  else:
403  log.error('Chain %s cannot be generated - Signature "%s" not available', chainPartDict['chainName'], currentSig)
404  log.error('Available signature(s): %s', self.availableSignatures)
405  raise Exception('Stopping the execution. Please correct the configuration.')
406 
407  log.debug("Chain %s \n chain config: %s",chainPartDict['chainName'],chainPartConfig)
408 
409  listOfChainConfigs.append(chainPartConfig)
410  log.debug("[__generateChainConfigs] adding to the perSig_lengthOfChainConfigs list (%s, %s)",chainPartConfig.nSteps,chainPartConfig.alignmentGroups)
411  perSig_lengthOfChainConfigs.append((chainPartConfig.nSteps,chainPartConfig.alignmentGroups))
412 
413  # this will be a list of lists for inter-sig combined chains and a list with one
414  # multi-element list for intra-sig combined chains
415  # here, we flatten it accordingly (works for both cases!)
416  lengthOfChainConfigs = []
417  for nSteps, aGrps in perSig_lengthOfChainConfigs:
418  if len(nSteps) != len(aGrps):
419  log.error("Chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps)
420  else:
421  for a,b in zip(nSteps,aGrps):
422  lengthOfChainConfigs.append((a,b))
423 
424 
425  # This part is to deal with combined chains between different signatures
426  try:
427  if len(listOfChainConfigs) == 0:
428  raise Exception('[__generateChainConfigs] No Chain Configuration found for {0}'.format(mainChainDict['chainName']))
429  else:
430  if len(listOfChainConfigs)>1:
431  log.debug("Merging strategy from dictionary: %s", mainChainDict["mergingStrategy"])
432  theChainConfig, perSig_lengthOfChainConfigs = mergeChainDefs(listOfChainConfigs, mainChainDict, perSig_lengthOfChainConfigs)
433  lengthOfChainConfigs = []
434  for nSteps, aGrps in perSig_lengthOfChainConfigs:
435  if len(nSteps) != len(aGrps):
436  log.error("Post-merged chain part has %s steps and %s alignment groups - these don't match!",nSteps,aGrps)
437  else:
438  for a,b in zip(nSteps,aGrps):
439  lengthOfChainConfigs.append((a,b))
440  else:
441  theChainConfig = listOfChainConfigs[0]
442 
443  for topoID in range(len(mainChainDict['extraComboHypos'])):
444  thetopo = mainChainDict['extraComboHypos'][topoID].strip(string.digits).rstrip(topoLegIndices)
445  theChainConfig.addTopo((comboConfigurator[thetopo],thetopo))
446 
447  # Now we know where the topos should go, we can insert them in the right steps
448  if len(theChainConfig.topoMap) > 0:
449  log.debug("Trying to add extra ComboHypoTool for %s",mainChainDict['extraComboHypos'])
450  addTopoInfo(theChainConfig,mainChainDict,listOfChainConfigs,lengthOfChainConfigs)
451  except RuntimeError:
452  log.error('[__generateChainConfigs] Problems creating ChainDef for chain %s ', chainName)
453  log.error('[__generateChainConfigs] I am in the extraComboHypos section, for %s ', mainChainDict['extraComboHypos'])
454  log.exception('[__generateChainConfigs] Full chain dictionary is\n %s ', mainChainDict)
455  raise Exception('[__generateChainConfigs] Stopping menu generation. Please investigate the exception shown above.')
456  except AttributeError:
457  raise Exception('[__generateChainConfigs] Stopping menu generation. Please investigate the exception shown above.')
458 
459  # Configure event building strategy
460  eventBuildType = mainChainDict['eventBuildType']
461  if eventBuildType:
462  try:
463  if 'PhysicsTLA' in eventBuildType:
464  log.debug("Adding TLA Step for chain %s", mainChainDict['chainName'])
465  TLABuildingSequences.addTLAStep(flags, theChainConfig, mainChainDict)
466  log.debug('Configuring event building sequence %s for chain %s', eventBuildType, mainChainDict['chainName'])
467  EventBuildingSequences.addEventBuildingSequence(flags, theChainConfig, eventBuildType, mainChainDict)
468  except TypeError as ex:
469  log.error(ex)
470  raise Exception('[__generateChainConfigs] Stopping menu generation for EventBuilding/TLA sequences. Please investigate the exception shown above.')
471 
472  log.debug('[__generateChainConfigs] lengthOfChainConfigs %s, ChainConfigs %s ', lengthOfChainConfigs, theChainConfig)
473  return theChainConfig,lengthOfChainConfigs
474 
475 

◆ clear()

def GenerateMenuMT.Singleton.clear (   cls)
inherited

Definition at line 55 of file GenerateMenuMT.py.

55  def clear(cls):
56  cls._instances.clear()
57 
58 

◆ generateAllChainConfigs()

def GenerateMenuMT.GenerateMenuMT.generateAllChainConfigs (   self,
  flags 
)
== Obtains chain configs for all chains in menu

Definition at line 220 of file GenerateMenuMT.py.

220  def generateAllChainConfigs(self, flags):
221  """
222  == Obtains chain configs for all chains in menu
223  """
224 
225  from TriggerMenuMT.HLT.Config.Utility.MenuAlignmentTools import MenuAlignment
226  from TriggerMenuMT.HLT.CommonSequences import EventBuildingSequences, TLABuildingSequences
227 
228  # get all chain names from menu
229  log.info("Will now get chains from the menu")
230  self.getChainsFromMenu(flags)
231 
232  # decoding of the chain name
233  log.info("Will now get chain dictionaries for each chain")
234  self.getChainDicts(flags)
235 
236  if flags.Trigger.disableCPS:
237  log.warning('Removing all CPS group because the flag Trigger.disableCPS is set')
238  for chainDict in self.chainDicts:
239  chainDict['groups'] = [g for g in chainDict['groups'] if not g.startswith('RATE:CPS_')]
240 
241  #import the necessary signatures
242  log.debug("Importing the necessary signatures")
243  self.importSignaturesToGenerate()
244 
245  log.info("Will now generate the chain configuration for each chain")
246  self.generateChains(flags)
247 
248  log.info("Will now calculate the alignment parameters")
249  #dict of signature: set it belongs to
250  #e.g. {'Electron': ['Electron','Muon','Photon']}
251  menuAlignment = MenuAlignment(self.combinationsInMenu,
252  self.alignmentGroupsToAlign,
253  self.configLengthDict)
254  menuAlignment.analyse_combinations()
255 
256  # alignmentGroups_to_align = menuAlignment.groupsToAlign
257  # lengthOfChainConfigs = self.configLengthDict
258  # combinationsInMenu = menuAlignment.combinationsInMenu
259  # alignmentGroup_sets_to_align = menuAlignment.setsToAlign
260 
261  log.info('Aligning the following signatures: %s',sorted(menuAlignment.sets_to_align))
262  log.debug('Length of each of the alignment groups: %s',self.configLengthDict)
263 
264  chainConfigs = []
265 
266  for chainDict,chainConfig,lengthOfChainConfigs in self.allChainsForAlignment:
267 
268  # start by ordering electron, photon, muon by having e+mu, g+mu, e+g chains
269  # desired ordering: electron, photon, muon, tau, jet, met, b-jet
270 
271  # lengthOfChainConfigs is something like this: [(4, 'Photon'), (5, 'Muon')]
272  # needs to match up with the maximum number of steps in a signature in the menu (length_of_configs)
273  # start with electron! Only need to add post-steps for combined electron chains if the max length in a combined chain
274  # is greater than the number of electron steps combined chain. Assume that the max length of an electron chain occurs
275  # in a combined chain.
276 
277  log.debug("[generateAllChainConfigs] chain %s has config lengths %s and alignment groups %s", chainDict['chainName'], lengthOfChainConfigs, chainDict['alignmentGroups'])
278 
279  alignmentGroups = chainDict['alignmentGroups']
280 
281  #parallel-merged single-signature chains or single signature chains. Anything that needs no splitting!
282  if len(set(alignmentGroups)) == 1:
283  alignedChainConfig = menuAlignment.single_align(chainDict, chainConfig)
284  HLTMenuConfig.registerChain( chainDict )
285  chainConfigs.append( alignedChainConfig )
286 
287  elif len(alignmentGroups) >= 2:
288  alignedChainConfig = menuAlignment.multi_align(chainDict, chainConfig, lengthOfChainConfigs)
289  HLTMenuConfig.registerChain( chainDict )
290  chainConfigs.append( alignedChainConfig )
291 
292  else:
293  log.error("Menu can't deal with combined chains with more than two alignmentGroups at the moment. oops...")
294  raise NotImplementedError("more than three alignment groups still needs implementing in ChainMerging.py, ATR-22206")
295 
296  if not HLTMenuConfig.isChainRegistered(chainDict['chainName']):
297  log.error("Chain %s has not been registered in the menu!", chainDict['chainName'])
298  import pprint
299  pp = pprint.PrettyPrinter(indent=4, depth=8)
300  log.error('The chain dictionary is: %s', pp.pformat(chainDict))
301  raise Exception("Please fix the menu or the chain.")
302 
303  # align event building sequences
304  log.info("[generateAllChainConfigs] general alignment complete, will now align TLA chains")
305  TLABuildingSequences.alignTLASteps(chainConfigs, HLTMenuConfig.dicts())
306  log.info("[generateAllChainConfigs] general and TLA alignment complete, will now align PEB chains")
307  EventBuildingSequences.alignEventBuildingSteps(chainConfigs, HLTMenuConfig.dicts())
308 
309  log.info("[generateAllChainConfigs] all chain configurations have been generated.")
310  return chainConfigs
311 
312 

◆ generateChains()

def GenerateMenuMT.GenerateMenuMT.generateChains (   self,
  flags 
)

Definition at line 180 of file GenerateMenuMT.py.

180  def generateChains(self, flags):
181  all_chains = []
182  combinations_in_menu = []
183  alignmentGroups_to_align = set()
184  length_of_configs = {}
185 
186  nchainDicts = len(self.chainDicts)
187  notify_increment = max(int(nchainDicts / 10),1)
188  for ichainDict, chainDict in enumerate(self.chainDicts):
189  log.debug("Next: getting chain configuration for chain %s ", chainDict['chainName'])
190  if ichainDict % notify_increment==0:
191  log.info("Generating HLT chain %d / %d", ichainDict+1, nchainDicts)
192  chainConfig,lengthOfChainConfigs = self.__generateChainConfig(flags, chainDict)
193  all_chains += [(chainDict,chainConfig,lengthOfChainConfigs)]
194 
195  #update the alignment group length dictionary if we have a longer number of steps
196  #or the signature isn't registered in the dictionary yet
197  for config_length, config_grp in lengthOfChainConfigs:
198  if config_grp in length_of_configs:
199  if config_length > length_of_configs[config_grp]:
200  length_of_configs[config_grp] = config_length
201  else:
202  length_of_configs[config_grp] = config_length
203 
204  # find the chains that contain more than one alignment group, to keep track
205  # of what combinations do we need to deal with.
206  # we're using sets here so we don't end up with duplicates
207  if len(set(chainDict['alignmentGroups'])) > 1:
208  combinations_in_menu += [list(set(chainDict['alignmentGroups']))]
209  for align_group in list(set(chainDict['alignmentGroups'])):
210  alignmentGroups_to_align.update([align_group])
211 
212  self.allChainsForAlignment = all_chains
213  self.combinationsInMenu = combinations_in_menu
214  self.alignmentGroupsToAlign = alignmentGroups_to_align
215  self.configLengthDict = length_of_configs
216 
217  return
218 
219 

◆ getChainDicts()

def GenerateMenuMT.GenerateMenuMT.getChainDicts (   self,
  flags 
)

Definition at line 118 of file GenerateMenuMT.py.

118  def getChainDicts(self, flags):
119 
120  def validSignature(currentSig, chainSig):
121  """Check if chain is assigned to the correct signature"""
122  reqd = GenerateMenuMT.getRequiredSignatures(currentSig)
123  isValid = chainSig.issubset( reqd )
124  log.debug("Chain signatures: %s, required signatures: %s",chainSig,reqd)
125  if not isValid:
126  log.error("Chain signatures %s not a subset of required signatures %s",set(chainSig),reqd)
127  return isValid
128 
129  from TriggerMenuMT.HLT.Config.Utility.DictFromChainName import dictFromChainName
130 
131  chainCounter = 0
132  invalid = False
133  for sig, chains in self.chainsInMenu.items():
134  for chain in chains:
135  log.debug("Now processing chain: %s from signature %s", chain, sig)
136  chainCounter += 1
137  chainDict = dictFromChainName(flags, chain)
138  chainDict['chainCounter'] = chainCounter
139  chainDict['prescale'] = 1 # set default chain prescale
140 
141  # Pick out the folder and subsignature directories to import
142  for sigfo, subsig in chainDict['sigDicts'].items():
143  if sigfo not in self.sigDicts:
144  self.sigDicts[sigfo] = subsig
145  else:
146  for ss in subsig:
147  if ss not in self.sigDicts[sigfo]:
148  self.sigDicts[sigfo].append(ss)
149 
150  self.chainDicts.append(chainDict)
151 
152  if not validSignature(sig, set(chainDict['signatures'])):
153  invalid=True
154  log.error('Chain %s assigned to signature %s but creates %s',
155  chainDict['chainName'], sig, set(chainDict['signatures']))
156  if invalid:
157  raise RuntimeError('Incorrect assignment of chains to slices -- see preceding messages.')
158 

◆ getChainsFromMenu()

def GenerateMenuMT.GenerateMenuMT.getChainsFromMenu (   self,
  flags 
)
== Returns the list of chain names that are in the menu

Definition at line 313 of file GenerateMenuMT.py.

313  def getChainsFromMenu(self, flags):
314  """
315  == Returns the list of chain names that are in the menu
316  """
317  from TriggerMenuMT.HLT.Menu.MenuPrescaleConfig import MenuPrescaleConfig
318 
319  # go over the slices and put together big list of signatures requested
320  (self.L1Prescales, self.HLTPrescales, self.chainsInMenu) = MenuPrescaleConfig(HLTMenuConfig, flags)
321 
322  log.debug("Setup HLT menu with prescales: %s", self.HLTPrescales)
323 
324  # Filter chains if requested
325  if self.chainFilter is not None:
326  self.signaturesOverwritten = True
327 
328  # Verify that if the chain filter has lists of chains
329  # they are all in the menu
330  chainsToCheck = []
331  if hasattr(self.chainFilter,'selectChains'):
332  chainsToCheck += self.chainFilter.selectChains
333  if hasattr(self.chainFilter,'disableChains'):
334  chainsToCheck += self.chainFilter.disableChains
335  for chain in chainsToCheck:
336  inMenu = False
337  for signame in self.chainsInMenu:
338  if chain in [c.name for c in self.chainsInMenu[signame]]:
339  inMenu = True
340  break
341  if not inMenu:
342  raise RuntimeError(f'Request to enable/disable chain {chain} that is not in menu')
343 
344  for signame in self.chainsInMenu:
345  self.chainsInMenu[signame] = [c for c in self.chainsInMenu[signame]
346  if self.chainFilter(signame, c.name)]
347 
348  if not self.chainsInMenu:
349  log.warning("There seem to be no chains in the menu - please check")
350  elif log.isEnabledFor(logging.DEBUG):
351  import pprint
352  log.debug("The following chains were found in the menu:")
353  pprint.pprint(self.chainsInMenu)
354 
355 

◆ getRequiredSignatures()

def GenerateMenuMT.GenerateMenuMT.getRequiredSignatures (   theslice)

Definition at line 63 of file GenerateMenuMT.py.

63  def getRequiredSignatures(theslice):
64  allSigs = allSignatures()
65  signatureDeps = {sig:[sig] for sig in allSigs}
66  # Special cases
67  signatureDeps.update({
68  # Bjet always requires jet
69  'Bjet': ['Bjet','Jet'],
70  # Egamma contains two signatures
71  'Egamma': ['Electron','Photon'],
72  'Combined': combinedSignatures(),
73  })
74  return set(signatureDeps[theslice]+defaultSignatures()) # always allow streamers
75 

◆ importSignaturesToGenerate()

def GenerateMenuMT.GenerateMenuMT.importSignaturesToGenerate (   self)
check if all the signature files can be imported and then import them

Definition at line 159 of file GenerateMenuMT.py.

159  def importSignaturesToGenerate(self):
160  """check if all the signature files can be imported and then import them"""
161 
162  for sig, subSigs in self.sigDicts.items():
163  try:
164  for ss in subSigs:
165  import_module = 'TriggerMenuMT.HLT.' + sig +'.Generate' + ss + 'ChainDefs'
166  self.chainDefModule[ss] = importlib.import_module(import_module)
167 
168  if ss not in self.availableSignatures:
169  self.availableSignatures.append(ss)
170 
171  except ImportError:
172  log.exception('Problems when importing ChainDef generating code for %s', sig)
173  import traceback
174  traceback.print_exc()
175 
176  log.info('Available signature(s) for chain generation: %s', self.availableSignatures)
177 
178  return
179 

◆ resolveEmptySteps()

def GenerateMenuMT.GenerateMenuMT.resolveEmptySteps (   self,
  chainConfigs 
)

Definition at line 476 of file GenerateMenuMT.py.

476  def resolveEmptySteps(self,chainConfigs):
477  max_steps = max([len(cc.steps) for cc in chainConfigs], default=0)
478  steps_are_empty = [True for i in range(0,max_steps)]
479  emptySteps = []
480  for cc in chainConfigs:
481  for istep, the_step in enumerate(cc.steps):
482  if not the_step.isEmpty:
483  steps_are_empty[istep] = False
484  else:
485  emptySteps.append(the_step)
486 
487  log.debug("Are there any fully empty steps? %s", steps_are_empty)
488  log.debug("The empty step(s) and associated chain(s) are: %s", emptySteps)
489  empty_step_indices = [i for i,is_empty in enumerate(steps_are_empty) if is_empty]
490 
491  if len(empty_step_indices) == 0:
492  return chainConfigs
493 
494  special_test_menu = self.chainFilter and ( getattr(self.chainFilter, "selectChains", False) or \
495  getattr(self.chainFilter, "disableChains", False) or \
496  getattr(self.chainFilter, "disabledSignatures", False) or \
497  getattr(self.chainFilter, "enabledSignatures", False) )
498 
499 
500  if len(self.availableSignatures) != 1 and not special_test_menu:
501  raise Exception("[resolveEmptySteps] Please find the reason for this empty step and resolve it / remove it from the menu: %s", emptySteps)
502 
503  log.info("Will now delete steps %s (indexed from zero)",empty_step_indices)
504 
505  for cc in chainConfigs:
506  new_steps = []
507  #only add non-empty steps to the new steps list!
508  for istep,step in enumerate(cc.steps):
509  if istep not in empty_step_indices:
510  new_steps += [step]
511  cc.steps = new_steps
512 
513  return chainConfigs
514 
515 

◆ setChainFilter()

def GenerateMenuMT.GenerateMenuMT.setChainFilter (   self,
  f 
)
Set chain filter for menu generation.

   This can be any callable object taking two
   arguments for signature and chain name and returning a boolean.
   E.g. to only generate Egamma chains:
menu.setChainFilter(lambda slice,chain : slice=='Egamma').

   In the special case that f is a functor with the list attributes
   selectChains and/or disableChains, the contents will be explicitly
   checked to be in the menu.

Definition at line 96 of file GenerateMenuMT.py.

96  def setChainFilter(self, f):
97  """Set chain filter for menu generation.
98 
99  This can be any callable object taking two
100  arguments for signature and chain name and returning a boolean.
101  E.g. to only generate Egamma chains:
102  menu.setChainFilter(lambda slice,chain : slice=='Egamma').
103 
104  In the special case that f is a functor with the list attributes
105  selectChains and/or disableChains, the contents will be explicitly
106  checked to be in the menu.
107  """
108  fname = f.__class__.__name__ if isinstance(f,object) else f.__name__
109  import inspect
110  if len(inspect.signature(f).parameters)!=2:
111  log.error('%s is not a valid chain filter. Function/callable needs take two arguments '
112  'for signature and chain name and return a boolean', fname)
113  else:
114  log.warning('Setting chain filter to %s', fname)
115  self.chainFilter = f
116 
117 

Member Data Documentation

◆ _instances

GenerateMenuMT.Singleton._instances
staticprivateinherited

Definition at line 49 of file GenerateMenuMT.py.

◆ alignmentGroupsToAlign

GenerateMenuMT.GenerateMenuMT.alignmentGroupsToAlign

Definition at line 82 of file GenerateMenuMT.py.

◆ allChainsForAlignment

GenerateMenuMT.GenerateMenuMT.allChainsForAlignment

Definition at line 79 of file GenerateMenuMT.py.

◆ availableSignatures

GenerateMenuMT.GenerateMenuMT.availableSignatures

Definition at line 90 of file GenerateMenuMT.py.

◆ chainDefModule

GenerateMenuMT.GenerateMenuMT.chainDefModule

Definition at line 94 of file GenerateMenuMT.py.

◆ chainDicts

GenerateMenuMT.GenerateMenuMT.chainDicts

Definition at line 80 of file GenerateMenuMT.py.

◆ chainFilter

GenerateMenuMT.GenerateMenuMT.chainFilter

Definition at line 89 of file GenerateMenuMT.py.

◆ chainsInMenu

GenerateMenuMT.GenerateMenuMT.chainsInMenu

Definition at line 77 of file GenerateMenuMT.py.

◆ combinationsInMenu

GenerateMenuMT.GenerateMenuMT.combinationsInMenu

Definition at line 81 of file GenerateMenuMT.py.

◆ configLengthDict

GenerateMenuMT.GenerateMenuMT.configLengthDict

Definition at line 83 of file GenerateMenuMT.py.

◆ HLTPrescales

GenerateMenuMT.GenerateMenuMT.HLTPrescales

Definition at line 87 of file GenerateMenuMT.py.

◆ L1Prescales

GenerateMenuMT.GenerateMenuMT.L1Prescales

Definition at line 86 of file GenerateMenuMT.py.

◆ sigDicts

GenerateMenuMT.GenerateMenuMT.sigDicts

Definition at line 92 of file GenerateMenuMT.py.

◆ signaturesOverwritten

GenerateMenuMT.GenerateMenuMT.signaturesOverwritten

Definition at line 85 of file GenerateMenuMT.py.


The documentation for this class was generated from the following file:
GenerateMenuMT.allSignatures
def allSignatures()
Definition: GenerateMenuMT.py:30
max
#define max(a, b)
Definition: cfImp.cxx:41
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
GenerateMenuMT.defaultSignatures
def defaultSignatures()
Definition: GenerateMenuMT.py:21
DictFromChainName.dictFromChainName
def dictFromChainName(flags, chainInfo)
Definition: DictFromChainName.py:626
ComboHypoHandling.addTopoInfo
def addTopoInfo(theChainConfig, mainChainDict, listOfChainDefs, lengthOfChainConfigs)
Definition: ComboHypoHandling.py:213
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
GenerateMenuMT.combinedSignatures
def combinedSignatures()
Definition: GenerateMenuMT.py:15
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
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.HLT.Menu.MenuPrescaleConfig.MenuPrescaleConfig
def MenuPrescaleConfig(hltMenuConfig, flags)
Definition: MenuPrescaleConfig.py:9
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
ChainMerging.mergeChainDefs
def mergeChainDefs(listOfChainDefs, chainDict, perSig_lengthOfChainConfigs=None)
Definition: ChainMerging.py:15
VKalVrtAthena::varHolder_detail::clear
void clear(T &var)
Definition: NtupleVars.h:48
ChainDictTools.splitInterSignatureChainDict
def splitInterSignatureChainDict(chainDict)
Definition: ChainDictTools.py:9
python.HLT.Bjet.GenerateBjetChainDefs.generateChainConfigs
def generateChainConfigs(flags, chainDict)
Definition: GenerateBjetChainDefs.py:13