ATLAS Offline Software
Loading...
Searching...
No Matches
GenerateMenuMT Namespace Reference

Classes

class  FilterChainsToGenerate
class  GenerateMenuMT
class  Singleton

Functions

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

Variables

 log = logging.getLogger(__name__)
int _maxAllowedCustomCH = 10

Function Documentation

◆ allSignatures()

GenerateMenuMT.allSignatures ( )

Definition at line 32 of file GenerateMenuMT.py.

32def allSignatures():
33 return set(calibCosmicMonSignatures() + combinedSignatures() + jointSignatures() + bphysicsSignatures() + defaultSignatures() + testSignatures())
34
35
STL class.

◆ bphysicsSignatures()

GenerateMenuMT.bphysicsSignatures ( )

Definition at line 29 of file GenerateMenuMT.py.

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

◆ calibCosmicMonSignatures()

GenerateMenuMT.calibCosmicMonSignatures ( )

Definition at line 14 of file GenerateMenuMT.py.

14def calibCosmicMonSignatures():
15 return ['Streaming','Monitor','Beamspot','Cosmic', 'Calib', 'EnhancedBias']
16

◆ combinedSignatures()

GenerateMenuMT.combinedSignatures ( )

Definition at line 17 of file GenerateMenuMT.py.

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

◆ defaultSignatures()

GenerateMenuMT.defaultSignatures ( )

Definition at line 23 of file GenerateMenuMT.py.

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

◆ generateMenuMT()

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

Definition at line 585 of file GenerateMenuMT.py.

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

◆ jointSignatures()

GenerateMenuMT.jointSignatures ( )

Definition at line 20 of file GenerateMenuMT.py.

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

◆ makeHLTTree()

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

Definition at line 656 of file GenerateMenuMT.py.

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

◆ testSignatures()

GenerateMenuMT.testSignatures ( )

Definition at line 26 of file GenerateMenuMT.py.

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

Variable Documentation

◆ _maxAllowedCustomCH

int GenerateMenuMT._maxAllowedCustomCH = 10
protected

Definition at line 12 of file GenerateMenuMT.py.

◆ log

GenerateMenuMT.log = logging.getLogger(__name__)

Definition at line 9 of file GenerateMenuMT.py.