ATLAS Offline Software
Classes | Functions | Variables
GenerateMenuMT Namespace Reference

Classes

class  FilterChainsToGenerate
 
class  GenerateMenuMT
 
class  Singleton
 

Functions

def calibCosmicMonSignatures ()
 
def combinedSignatures ()
 
def jointSignatures ()
 
def defaultSignatures ()
 
def testSignatures ()
 
def bphysicsSignatures ()
 
def allSignatures ()
 
def generateMenuMT (flags)
 
def makeHLTTree (flags, chainConfigs)
 

Variables

 log
 
 _maxAllowedCustomCH
 

Function Documentation

◆ allSignatures()

def GenerateMenuMT.allSignatures ( )

Definition at line 32 of file GenerateMenuMT.py.

◆ bphysicsSignatures()

def GenerateMenuMT.bphysicsSignatures ( )

Definition at line 29 of file GenerateMenuMT.py.

29 def bphysicsSignatures():
30  return ['Bphysics']
31 

◆ calibCosmicMonSignatures()

def GenerateMenuMT.calibCosmicMonSignatures ( )

Definition at line 14 of file GenerateMenuMT.py.

15  return ['Streaming','Monitor','Beamspot','Cosmic', 'Calib', 'EnhancedBias']
16 

◆ combinedSignatures()

def GenerateMenuMT.combinedSignatures ( )

Definition at line 17 of file GenerateMenuMT.py.

17 def combinedSignatures():
18  return ['MinBias','Electron','Photon','Muon','Tau','Jet', 'Bjet','MET','UnconventionalTracking','HeavyIon']
19 

◆ defaultSignatures()

def GenerateMenuMT.defaultSignatures ( )

Definition at line 23 of file GenerateMenuMT.py.

23 def defaultSignatures():
24  return ['Streaming']
25 

◆ generateMenuMT()

def GenerateMenuMT.generateMenuMT (   flags)
== Main function to generate the L1, L1Topo and HLT menu configs and CA, using the GenerateMenuMT class

Definition at line 582 of file GenerateMenuMT.py.

582 def generateMenuMT(flags):
583  """
584  == Main function to generate the L1, L1Topo and HLT menu configs and CA, using the GenerateMenuMT class
585  """
586  # Generate L1 menu
587  # The L1Menu json file is produced here
588  from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
589  generateL1Menu(flags)
590 
591 
592  menu = GenerateMenuMT()
593 
594  # Apply generation filter (enable/disable chains and signatures)
595  chains_gen_filter = FilterChainsToGenerate(flags)
596  menu.setChainFilter(chains_gen_filter)
597  log.debug('Filtering chains: %d', menu.chainFilter is not None)
598 
599  # Generate all chains configuration
600  finalListOfChainConfigs = menu.generateAllChainConfigs(flags)
601 
602  checkNumberOfLegs = [chain.checkNumberOfLegs() for chain in finalListOfChainConfigs]
603  if 0 in checkNumberOfLegs:
604  log.error('There is a chain with unexpected number of legs. Revisit your configuration')
605 
606  log.info('Number of configured chains: %d', len(finalListOfChainConfigs))
607 
608  from TriggerMenuMT.HLT.Config import MenuComponents
609  if len(MenuComponents._CustomComboHypoAllowed)> _maxAllowedCustomCH:
610  log.error(f'Found {len(MenuComponents._CustomComboHypoAllowed)} ComboHypo algorithms violating the one-CH-per-step rule, only {_maxAllowedCustomCH} are allowed (which are BLS ComboHypos). This is the list of current violations: {MenuComponents._CustomComboHypoAllowed}. Please consolidate your choice of ComboHypo, by checking that it is able to handle decisions internally; if yes eventually increase the limit set by _maxAllowedCustomCH, after discussing with experts')
611  # Generate and apply the automatic prescale sets (e.g. for disabling items in an MC production)
612  menu.generatePrescales(flags)
613 
614 
615  # Remove any remaining steps that are fully empty in all chains
616  finalListOfChainConfigs = menu.resolveEmptySteps(finalListOfChainConfigs)
617  log.debug("finalListOfChainConfig: %s", finalListOfChainConfigs)
618 
619  # Make the HLT configuration tree
620  # The HLTMenu json file is produced here.
621  log.info("Making the HLT configuration tree")
622  menuAcc, CFseq_list = makeHLTTree(flags, finalListOfChainConfigs)
623 
624  # Configure ChainFilters for ROBPrefetching
625  from TriggerJobOpts.TriggerConfigFlags import ROBPrefetching
626  if ROBPrefetching.InitialRoI in flags.Trigger.ROBPrefetchingOptions:
627  from TrigGenericAlgs.TrigGenericAlgsConfig import prefetchingInitialRoIConfig
628  menuAcc.merge(prefetchingInitialRoIConfig(flags, CFseq_list), 'HLTBeginSeq')
629 
630 
631  # Post-generation checks:
632  log.info("Checking the L1HLTConsistency...")
633  from TriggerMenuMT.HLT.Config.Validation.CheckL1HLTConsistency import checkL1HLTConsistency
634  checkL1HLTConsistency(flags)
635 
636  log.info("Checking the Coherent Prescale assignments...")
637  from TriggerMenuMT.HLT.Config.Validation.CheckCPSGroups import checkCPSGroups
638  checkCPSGroups(HLTMenuConfig.dictsList())
639 
640  log.info("Checking that all chains streamed in express have a signature or detctor monGroup")
641  from TriggerMenuMT.HLT.Config.Validation.CheckMonGroups import checkMonGroups
642  checkMonGroups(HLTMenuConfig.dictsList())
643 
644  # Cleanup menu singletons to allow garbage collection (ATR-28855)
645  GenerateMenuMT.clear()
646  from TriggerMenuMT.HLT.Config import MenuComponents
647  MenuComponents._ComboHypoPool.clear()
648  MenuComponents._CustomComboHypoAllowed.clear()
649 
650  return menuAcc
651 
652 

◆ jointSignatures()

def GenerateMenuMT.jointSignatures ( )

Definition at line 20 of file GenerateMenuMT.py.

20 def jointSignatures():
21  return ['Bjet', 'Egamma', 'Combined']
22 

◆ makeHLTTree()

def GenerateMenuMT.makeHLTTree (   flags,
  chainConfigs 
)
Generate appropriate Control Flow Graph wiht all HLT algorithms

Definition at line 653 of file GenerateMenuMT.py.

653 def makeHLTTree(flags, chainConfigs):
654  """
655  Generate appropriate Control Flow Graph wiht all HLT algorithms
656  """
657  from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFConfig import decisionTreeFromChains, sequenceScanner
658  from TriggerJobOpts.TriggerConfig import collectViewMakers
659  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
660  from AthenaCommon.CFElements import seqAND
661 
662  acc = ComponentAccumulator()
663  steps = seqAND('HLTAllSteps')
664  finalDecisions, CFseq_list, menuAcc = decisionTreeFromChains(flags, steps, chainConfigs, HLTMenuConfig.dictsList())
665  if log.getEffectiveLevel() <= logging.DEBUG:
666  menuAcc.printConfig()
667 
668  acc.merge(menuAcc)
669  successful_scan = sequenceScanner( steps )
670  if not successful_scan:
671  raise Exception("[makeHLTTree] At least one sequence is expected in more than one step. Check error messages and fix!")
672 
673  flatDecisions=[]
674  for step in finalDecisions:
675  flatDecisions.extend (step)
676 
677  viewMakers = collectViewMakers(steps)
678  viewMakerMap = {vm.name:vm for vm in viewMakers}
679  for vmname, vm in viewMakerMap.items():
680  log.debug(f"[makeHLTTree] {vmname} InputMakerOutputDecisions: {vm.InputMakerOutputDecisions}")
681  if vmname.endswith("_probe"):
682  try:
683  log.debug(f"Setting InputCachedViews on {vmname} to read decisions from tag leg {vmname[:-6]}: {vm.InputMakerOutputDecisions}")
684  vm.InputCachedViews = viewMakerMap[vmname[:-6]].InputMakerOutputDecisions
685  except KeyError: # We may be using a probe leg that has different reco from the tag
686  log.debug(f"Tag leg does not match probe: '{vmname[:-6]}', will not use cached views")
687 
688 
689  # Generate JSON representation of the config
690  from TriggerMenuMT.HLT.Config.JSON.HLTMenuJSON import generateJSON
691  generateJSON(flags, HLTMenuConfig.dictsList(), menuAcc.getSequence("HLTAllSteps"))
692 
693  # Store the HLTMonitoring json file
694  from TriggerMenuMT.HLT.Config.JSON.HLTMonitoringJSON import generateDefaultMonitoringJSON
695  generateDefaultMonitoringJSON(flags, HLTMenuConfig.dictsList())
696 
697  return acc, CFseq_list

◆ testSignatures()

def GenerateMenuMT.testSignatures ( )

Definition at line 26 of file GenerateMenuMT.py.

26 def testSignatures():
27  return ['Test']
28 

Variable Documentation

◆ _maxAllowedCustomCH

GenerateMenuMT._maxAllowedCustomCH
private

Definition at line 12 of file GenerateMenuMT.py.

◆ log

GenerateMenuMT.log

Definition at line 9 of file GenerateMenuMT.py.

GenerateMenuMT.calibCosmicMonSignatures
def calibCosmicMonSignatures()
Definition: GenerateMenuMT.py:14
GenerateMenuMT.allSignatures
def allSignatures()
Definition: GenerateMenuMT.py:32
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
GenerateMenuMT.defaultSignatures
def defaultSignatures()
Definition: GenerateMenuMT.py:23
python.TrigConfigSvcCfg.generateL1Menu
def generateL1Menu(flags)
Definition: TrigConfigSvcCfg.py:189
GenerateMenuMT.makeHLTTree
def makeHLTTree(flags, chainConfigs)
Definition: GenerateMenuMT.py:653
GenerateMenuMT
Definition: GenerateMenuMT.py:1
CheckL1HLTConsistency.checkL1HLTConsistency
def checkL1HLTConsistency(flags)
Definition: CheckL1HLTConsistency.py:48
HLTCFConfig.decisionTreeFromChains
def decisionTreeFromChains(flags, HLTNode, chains, allDicts)
Definition: HLTCFConfig.py:157
GenerateMenuMT.bphysicsSignatures
def bphysicsSignatures()
Definition: GenerateMenuMT.py:29
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
HLTCFConfig.sequenceScanner
def sequenceScanner(HLTNode)
Definition: HLTCFConfig.py:101
GenerateMenuMT.combinedSignatures
def combinedSignatures()
Definition: GenerateMenuMT.py:17
GenerateMenuMT.generateMenuMT
def generateMenuMT(flags)
Definition: GenerateMenuMT.py:582
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
CheckMonGroups.checkMonGroups
def checkMonGroups(chainDicts)
Definition: CheckMonGroups.py:15
GenerateMenuMT.jointSignatures
def jointSignatures()
Definition: GenerateMenuMT.py:20
python.TriggerConfig.collectViewMakers
def collectViewMakers(steps)
Definition: TriggerConfig.py:67
HLTMonitoringJSON.generateDefaultMonitoringJSON
def generateDefaultMonitoringJSON(flags, chainDicts)
Definition: HLTMonitoringJSON.py:21
python.TrigGenericAlgsConfig.prefetchingInitialRoIConfig
def prefetchingInitialRoIConfig(flags, CFseq_list)
Definition: TrigGenericAlgsConfig.py:159
HLTMenuJSON.generateJSON
def generateJSON(flags, chainDicts, HLTAllSteps)
Definition: HLTMenuJSON.py:83
CheckCPSGroups.checkCPSGroups
def checkCPSGroups(chainDicts)
Definition: CheckCPSGroups.py:19
GenerateMenuMT.testSignatures
def testSignatures()
Definition: GenerateMenuMT.py:26