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 from TriggerJobOpts.TriggerConfigFlags import ROBPrefetching
629 if ROBPrefetching.InitialRoI in flags.Trigger.ROBPrefetchingOptions:
630 from TrigGenericAlgs.TrigGenericAlgsConfig import prefetchingInitialRoIConfig
631 menuAcc.merge(prefetchingInitialRoIConfig(flags, CFseq_list), 'HLTBeginSeq')
632
633
634
635 log.info("Checking the L1HLTConsistency...")
636 from TriggerMenuMT.HLT.Config.Validation.CheckL1HLTConsistency import checkL1HLTConsistency
637 checkL1HLTConsistency(flags)
638
639 log.info("Checking the Coherent Prescale assignments...")
640 from TriggerMenuMT.HLT.Config.Validation.CheckCPSGroups import checkCPSGroups
641 checkCPSGroups(HLTMenuConfig.dictsList())
642
643 log.info("Checking that all chains streamed in express have a signature or detctor monGroup")
644 from TriggerMenuMT.HLT.Config.Validation.CheckMonGroups import checkMonGroups
645 checkMonGroups(HLTMenuConfig.dictsList())
646
647
648 GenerateMenuMT.clear()
649 from TriggerMenuMT.HLT.Config import MenuComponents
650 MenuComponents._ComboHypoPool.clear()
651 MenuComponents._CustomComboHypoAllowed.clear()
652
653 return menuAcc
654
655