617def generateMenuMT(flags):
618 """
619 == Main function to generate the L1, L1Topo and HLT menu configs and CA, using the GenerateMenuMT class
620 """
621
622
623 from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
624 generateL1Menu(flags)
625
626
628
629
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
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
647 menu.generatePrescales(flags)
648
649
650
651 finalListOfChainConfigs = menu.resolveEmptySteps(finalListOfChainConfigs)
652 log.debug("finalListOfChainConfig: %s", finalListOfChainConfigs)
653
654
655
656 log.info("Making the HLT configuration tree")
657 menuAcc, CFseq_list = makeHLTTree(flags, finalListOfChainConfigs)
658
659
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
673 GenerateMenuMT.clear()
674 from TriggerMenuMT.HLT.Config import MenuComponents
675 MenuComponents._ComboHypoPool.clear()
676 MenuComponents._CustomComboHypoAllowed.clear()
677
678 return menuAcc
679
680