585def generateMenuMT(flags):
586 """
587 == Main function to generate the L1, L1Topo and HLT menu configs and CA, using the GenerateMenuMT class
588 """
589
590
591 from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
592 generateL1Menu(flags)
593
594
596
597
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
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
615 menu.generatePrescales(flags)
616
617
618
619 finalListOfChainConfigs = menu.resolveEmptySteps(finalListOfChainConfigs)
620 log.debug("finalListOfChainConfig: %s", finalListOfChainConfigs)
621
622
623
624 log.info("Making the HLT configuration tree")
625 menuAcc, CFseq_list = makeHLTTree(flags, finalListOfChainConfigs)
626
627
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
641 GenerateMenuMT.clear()
642 from TriggerMenuMT.HLT.Config import MenuComponents
643 MenuComponents._ComboHypoPool.clear()
644 MenuComponents._CustomComboHypoAllowed.clear()
645
646 return menuAcc
647
648