609def generateMenuMT(flags):
610 """
611 == Main function to generate the L1, L1Topo and HLT menu configs and CA, using the GenerateMenuMT class
612 """
613
614
615 from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
616 generateL1Menu(flags)
617
618
620
621
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
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
639 menu.generatePrescales(flags)
640
641
642
643 finalListOfChainConfigs = menu.resolveEmptySteps(finalListOfChainConfigs)
644 log.debug("finalListOfChainConfig: %s", finalListOfChainConfigs)
645
646
647
648 log.info("Making the HLT configuration tree")
649 menuAcc, CFseq_list = makeHLTTree(flags, finalListOfChainConfigs)
650
651
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
665 GenerateMenuMT.clear()
666 from TriggerMenuMT.HLT.Config import MenuComponents
667 MenuComponents._ComboHypoPool.clear()
668 MenuComponents._CustomComboHypoAllowed.clear()
669
670 return menuAcc
671
672