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 32 of file GenerateMenuMT.py.

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

◆ bphysicsSignatures()

bphysicsSignatures ( )

Definition at line 29 of file GenerateMenuMT.py.

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

◆ calibCosmicMonSignatures()

calibCosmicMonSignatures ( )

Definition at line 14 of file GenerateMenuMT.py.

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

◆ combinedSignatures()

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()

defaultSignatures ( )

Definition at line 23 of file GenerateMenuMT.py.

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

◆ generateMenuMT()

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

Definition at line 617 of file GenerateMenuMT.py.

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

◆ jointSignatures()

jointSignatures ( )

Definition at line 20 of file GenerateMenuMT.py.

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

◆ makeHLTTree()

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

Definition at line 681 of file GenerateMenuMT.py.

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

◆ testSignatures()

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.