diff --git a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py b/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py index 82b040c3b10907e92ce3baa2e403c40e2f15fed0..2bbde0df3d29d700743405ed1c8769474bfe83e3 100644 --- a/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py +++ b/Trigger/TrigSteer/DecisionHandling/python/EmuStepProcessingConfig.py @@ -213,11 +213,11 @@ def generateChainsManually(): step_empy= ChainStep("Step2_mu1empty", multiplicity=[]) MuChains = [ - makeChain(name='HLT_TestChain8_muv1step_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11]), + makeChain(name='HLT_TestChain8_muv1step_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11]), makeChain(name='HLT_TestChain8_muv1_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu21 , step_mu31, step_mu41] ), makeChain(name='HLT_TestChain20_muv1_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu21 , step_mu31, step_mu41] ), - makeChain(name='HLT_TestChain10_muv2_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu22 , step_mu31] ), - makeChain(name='HLT_TestChain6_muEmpty2_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11 , step_empy , step_mu32, step_mu41] ), + makeChain(name='HLT_TestChain10_muv2_L1MU10', L1Thresholds=["MU10"], ChainSteps=[step_mu11 , step_mu22 , step_mu31] ), + makeChain(name='HLT_TestChain6_muEmpty2_L1MU6', L1Thresholds=["MU6"], ChainSteps=[step_mu11 , step_empy , step_mu32, step_mu41] ), ] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index 78fdf7f6aaa1df2c78a82d0466f245c94b0509fd..eefccd644b7676989c0f8aceb32f9cffa4e4ce77 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -37,6 +37,10 @@ from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFDot import stepCF_DataFlow_to_dot, s from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponentsNaming import CFNaming from AthenaCommon.Configurable import Configurable +from AthenaCommon.CFElements import getSequenceChildren, isSequence, compName +import re + + from AthenaCommon.Logging import logging log = logging.getLogger( __name__ ) @@ -280,7 +284,45 @@ def matrixDisplay( allCFSeq ): log.info( "="*90 ) +def sequenceScanner( HLTNode ): + """ Checks the alignement of sequences and steps in the tree""" + # +-- AthSequencer/HLTAllSteps + # +-- AthSequencer/Step1_filter + # +-- AthSequencer/Step1_reco + from collections import defaultdict + _seqMapInStep = defaultdict(set) + _status = True + + def _mapSequencesInSteps(seq, stepIndex): + """ Recursively finds the steps in which sequences are used""" + if not isSequence(seq): + return stepIndex + name = compName(seq) + match=re.search('^Step([0-9])_filter',name) + if match: + stepIndex = match.group(1) + log.debug("sequenceScanner: This is another step: %s %s", name, stepIndex) + for c in getSequenceChildren( seq ): + if isSequence(c): + stepIndex = _mapSequencesInSteps(c, stepIndex) + _seqMapInStep[compName(c)].add(stepIndex) + return stepIndex + + # do the job: + final_step=_mapSequencesInSteps(HLTNode, 0) + + for alg, steps in _seqMapInStep.items(): + if len(steps)> 1: + log.error("sequenceScanner: Sequence %s is expected in more than one step: %s", alg, steps) + match=re.search('Step([0-9])',alg) + if match: + candidateStep=match.group(1) + log.error("sequenceScanner: ---> candidate good step is %s", candidateStep) + _status=False + + log.debug("sequenceScanner: scanned %s steps with status %d", final_step, _status) + return _status def decisionTreeFromChains(HLTNode, chains, allDicts, newJO): @@ -292,8 +334,6 @@ def decisionTreeFromChains(HLTNode, chains, allDicts, newJO): log.info("Configuring empty decisionTree") return [] - # add chains to multiplicity map (new step here, as this was originally in the __init__ of Chain class - (finalDecisions, CFseq_list) = createDataFlow(chains, allDicts) if not newJO: createControlFlow(HLTNode, CFseq_list) @@ -301,10 +341,13 @@ def decisionTreeFromChains(HLTNode, chains, allDicts, newJO): from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import createControlFlowNewJO createControlFlowNewJO(HLTNode, CFseq_list) + sequenceScanner( HLTNode ) + # decode and attach HypoTools: for chain in chains: chain.createHypoTools() + # create dot graphs log.debug("finalDecisions: %s", finalDecisions) if create_dot(): all_DataFlow_to_dot(HLTNodeName, CFseq_list)