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 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 # Post-generation checks:
628 log.info("Checking the L1HLTConsistency...")
629 from TriggerMenuMT.HLT.Config.Validation.CheckL1HLTConsistency import checkL1HLTConsistency
630 checkL1HLTConsistency(flags)
631
632 log.info("Checking the Coherent Prescale assignments...")
633 from TriggerMenuMT.HLT.Config.Validation.CheckCPSGroups import checkCPSGroups
634 checkCPSGroups(HLTMenuConfig.dictsList())
635
636 log.info("Checking that all chains streamed in express have a signature or detctor monGroup")
637 from TriggerMenuMT.HLT.Config.Validation.CheckMonGroups import checkMonGroups
638 checkMonGroups(HLTMenuConfig.dictsList())
639
640 # Cleanup menu singletons to allow garbage collection (ATR-28855)
641 GenerateMenuMT.clear()
642 from TriggerMenuMT.HLT.Config import MenuComponents
643 MenuComponents._ComboHypoPool.clear()
644 MenuComponents._CustomComboHypoAllowed.clear()
645
646 return menuAcc
647
648

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

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