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

Classes

class  FilterChainsToGenerate
class  Singleton
class  GenerateMenuMT

Functions

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

Variables

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

Function Documentation

◆ allSignatures()

allSignatures ( )

Definition at line 31 of file GenerateMenuMT.py.

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

◆ bphysicsSignatures()

bphysicsSignatures ( )

Definition at line 28 of file GenerateMenuMT.py.

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

◆ calibCosmicMonSignatures()

calibCosmicMonSignatures ( )

Definition at line 13 of file GenerateMenuMT.py.

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

◆ combinedSignatures()

combinedSignatures ( )

Definition at line 16 of file GenerateMenuMT.py.

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

◆ defaultSignatures()

defaultSignatures ( )

Definition at line 22 of file GenerateMenuMT.py.

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

◆ generateMenuMT()

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

Definition at line 609 of file GenerateMenuMT.py.

609def generateMenuMT(flags):
610 """
611 == Main function to generate the L1, L1Topo and HLT menu configs and CA, using the GenerateMenuMT class
612 """
613 # Generate L1 menu
614 # The L1Menu json file is produced here
615 from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
616 generateL1Menu(flags)
617
618
619 menu = GenerateMenuMT()
620
621 # Apply generation filter (enable/disable chains and signatures)
622 chains_gen_filter = FilterChainsToGenerate(flags)
623 menu.setChainFilter(chains_gen_filter)
624 log.debug('Filtering chains: %d', menu.chainFilter is not None)
625
626 # Generate all chains configuration
627 finalListOfChainConfigs = menu.generateAllChainConfigs(flags)
628
629 checkNumberOfLegs = [chain.checkNumberOfLegs() for chain in finalListOfChainConfigs]
630 if 0 in checkNumberOfLegs:
631 log.error('There is a chain with unexpected number of legs. Revisit your configuration')
632
633 log.info('Number of configured chains: %d', len(finalListOfChainConfigs))
634
635 from TriggerMenuMT.HLT.Config import MenuComponents
636 if len(MenuComponents._CustomComboHypoAllowed)> _maxAllowedCustomCH:
637 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')
638 # Generate and apply the automatic prescale sets (e.g. for disabling items in an MC production)
639 menu.generatePrescales(flags)
640
641
642 # Remove any remaining steps that are fully empty in all chains
643 finalListOfChainConfigs = menu.resolveEmptySteps(finalListOfChainConfigs)
644 log.debug("finalListOfChainConfig: %s", finalListOfChainConfigs)
645
646 # Make the HLT configuration tree
647 # The HLTMenu json file is produced here.
648 log.info("Making the HLT configuration tree")
649 menuAcc, CFseq_list = makeHLTTree(flags, finalListOfChainConfigs)
650
651 # Post-generation checks:
652 log.info("Checking the L1HLTConsistency...")
653 from TriggerMenuMT.HLT.Config.Validation.CheckL1HLTConsistency import checkL1HLTConsistency
654 checkL1HLTConsistency(flags)
655
656 log.info("Checking the Coherent Prescale assignments...")
657 from TriggerMenuMT.HLT.Config.Validation.CheckCPSGroups import checkCPSGroups
658 checkCPSGroups(HLTMenuConfig.dictsList())
659
660 log.info("Checking that all chains streamed in express have a signature or detctor monGroup")
661 from TriggerMenuMT.HLT.Config.Validation.CheckMonGroups import checkMonGroups
662 checkMonGroups(HLTMenuConfig.dictsList())
663
664 # Cleanup menu singletons to allow garbage collection (ATR-28855)
665 GenerateMenuMT.clear()
666 from TriggerMenuMT.HLT.Config import MenuComponents
667 MenuComponents._ComboHypoPool.clear()
668 MenuComponents._CustomComboHypoAllowed.clear()
669
670 return menuAcc
671
672

◆ jointSignatures()

jointSignatures ( )

Definition at line 19 of file GenerateMenuMT.py.

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

◆ makeHLTTree()

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

Definition at line 673 of file GenerateMenuMT.py.

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

◆ testSignatures()

testSignatures ( )

Definition at line 25 of file GenerateMenuMT.py.

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

Variable Documentation

◆ _maxAllowedCustomCH

int GenerateMenuMT._maxAllowedCustomCH = 10
protected

Definition at line 11 of file GenerateMenuMT.py.

◆ log

GenerateMenuMT.log = logging.getLogger(__name__)

Definition at line 8 of file GenerateMenuMT.py.