diff --git a/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx b/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx index 185308b82f1d713b7c188df171a4fac73cb5abe8..cd105070e9e809d73fa56925bc7ca43a87d3ac58 100644 --- a/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx +++ b/Trigger/TrigSteer/DecisionHandling/src/ComboHypo.cxx @@ -55,7 +55,7 @@ StatusCode ComboHypo::initialize() { } ATH_CHECK( m_multiplicitiesReqMap.size() != 0 ); - + bool errorOccured = false; if (m_checkMultiplicityMap) { for ( const auto& m : m_multiplicitiesReqMap ) { @@ -177,8 +177,8 @@ StatusCode ComboHypo::execute(const EventContext& context ) const { for ( size_t legIndex = 0; legIndex < multiplicityPerLeg.size(); ++legIndex ) { const size_t requiredMultiplicity = multiplicityPerLeg.at( legIndex ); nRequiredUnique += requiredMultiplicity; - HLT::Identifier legId = TrigCompositeUtils::createLegName(chainId, legIndex); + HLT::Identifier legId = TrigCompositeUtils::createLegName(chainId, legIndex); // If there is only one leg, then we just use the chain's name. if (multiplicityPerLeg.size() == 1) { ATH_MSG_DEBUG(chainId << " has multiplicityPerLeg.size() == 1, so we don't use legXXX_HLT_YYY, we just use HLT_YYY"); @@ -187,7 +187,7 @@ StatusCode ComboHypo::execute(const EventContext& context ) const { const DecisionID requiredDecisionIDLeg = legId.numeric(); ATH_MSG_DEBUG("Container " << legIndex << ", looking at leg : " << legId ); - + LegDecisionsMap::const_iterator it = dmap.find(requiredDecisionIDLeg); if ( it == dmap.end() ) { overallDecision = false; diff --git a/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx b/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx index de41fa4da0e0ff9954b666a2b650a9b85cfbb4e4..f982f97bdb67c7e85e7cfd6805b41aebba48f071 100644 --- a/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx @@ -23,7 +23,6 @@ StatusCode RoIsUnpackingToolBase::initialize() return StatusCode::SUCCESS; } - StatusCode RoIsUnpackingToolBase::decodeMapping( std::function< bool(const std::string&)> filter ) { SG::ReadHandle<TrigConf::HLTMenu> hltMenuHandle = SG::makeHandle( m_HLTMenuKey ); @@ -37,9 +36,9 @@ StatusCode RoIsUnpackingToolBase::decodeMapping( std::function< bool(const std:: if ( filter(th) ) { const HLT::Identifier thresholIdentifier(th); m_thresholdToChainMapping[ thresholIdentifier ].push_back( chainIdentifier ); - ATH_MSG_DEBUG( "Associating " << chainIdentifier << " with threshold " << th ); + ATH_MSG_DEBUG( "Associating " << chainIdentifier << " with threshold " << th ); if ( thresholds.size() > 1 ) { - HLT::Identifier legIdentifier = TrigCompositeUtils::createLegName( chainIdentifier, counter ); + HLT::Identifier legIdentifier = TrigCompositeUtils::createLegName(chainIdentifier, counter); m_thresholdToChainMapping[ thresholIdentifier ].push_back( legIdentifier ); m_legToChainMapping.insert( std::make_pair( legIdentifier, chainIdentifier ) ); ATH_MSG_INFO( "Associating additional chain leg " << legIdentifier << " with threshold " << thresholIdentifier ); diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py index 97ba2889f6927c446387c34bbc6fc5113c653926..65e1efbcaf6772afc9e23a033b0b8062b0e4a89f 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone_newJO.py @@ -100,7 +100,7 @@ acc.foreach_component("*/L1Decoder").OutputLevel = DEBUG acc.foreach_component("*/L1Decoder/*Tool").OutputLevel = DEBUG # tools acc.foreach_component("*HLTTop/*Hypo*").OutputLevel = DEBUG # hypo algs acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = INFO # hypo tools -acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = DEBUG# filters +acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = INFO# filters acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = WARNING # messaging from the EDM creators acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py index 20867d5b3cfe86f3ef465b512bcc5ce61edd47af..ad2ca2e8bbd522d0b70ae0a4238987888b6fd1bc 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py @@ -1,8 +1,7 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaCommon.CFElements import seqAND -from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import generateDecisionTreeOld from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionTree from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT from TriggerMenuMT.HLTMenuConfig.Menu.ChainMerging import mergeChainDefs @@ -82,7 +81,7 @@ def generateMenu( flags ): chainDicts = splitInterSignatureChainDict(mainChainDict) listOfChainConfigs = [] - print("aaa", chainDicts) + for chainDict in chainDicts: signature = chainDict['signature'].lower() diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py index 0f45af0a554a5f2aa2e40d4c52d25001760c53cb..f7e351239c6c37f8f7207e1213f81bf306ca5789 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py @@ -1,5 +1,5 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -from PyUtils.Decorators import memoize +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +from functools import lru_cache from AthenaCommon.CFElements import findAllAlgorithms, parOR, seqAND from AthenaCommon.Logging import logging from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator @@ -22,22 +22,13 @@ def printStepsMatrix(matrix): print('---- {}: {}'.format(chainName, namesInCell)) # noqa: ATL901 print('-------------------------') # noqa: ATL901 -# def memoize(f): -# """ caches call of the helper functions, (copied from the internet) remove when we move to python 3.2 or newer and rplace by functools.lru_cache""" -# memo = {} -# def helper(*x): -# tupledx = tuple(x) -# if tupledx not in memo: -# memo[tupledx] = f(*x) -# return memo[tupledx] -# return helper def generateDecisionTree(chains): acc = ComponentAccumulator() mainSequenceName = 'HLTAllSteps' acc.addSequence( seqAND(mainSequenceName) ) - @memoize + @lru_cache(None) def getFiltersStepSeq( stepNumber ): """ Returns sequence containing all filters for a step @@ -49,7 +40,7 @@ def generateDecisionTree(chains): acc.addSequence( seq, parentName = mainSequenceName ) return seq - @memoize + @lru_cache(None) def getRecosStepSeq( stepNumber ): """ """ @@ -59,7 +50,7 @@ def generateDecisionTree(chains): acc.addSequence( seq, parentName = mainSequenceName ) return seq - @memoize + @lru_cache(None) def getSingleMenuSeq( stepNumber, stepName ): """ """ @@ -70,7 +61,7 @@ def generateDecisionTree(chains): acc.addSequence(seq, parentName = allRecoSeqName ) return seq - @memoize + @lru_cache(None) def getComboSequences( stepNumber, stepName ): """ """ @@ -83,7 +74,7 @@ def generateDecisionTree(chains): acc.addSequence( parOR(stepComboRecoName), parentName=stepComboName ) return acc.getSequence(stepComboName), acc.getSequence(stepComboRecoName) - @memoize + @lru_cache(None) def getFilterAlg( stepNumber, stepName ): """ Returns, if need be created, filter for a given step @@ -101,7 +92,7 @@ def generateDecisionTree(chains): log.debug('Creted filter {}'.format(filterName)) return filterAlg - @memoize + @lru_cache(None) def findInputMaker( stepCounter, stepName ): seq = getSingleMenuSeq( stepCounter, stepName ) algs = findAllAlgorithms( seq ) @@ -110,7 +101,7 @@ def generateDecisionTree(chains): return alg raise Exception("No input maker in seq "+seq.name) - @memoize + @lru_cache(None) def findAllInputMakers( stepCounter, stepName ): seq = getSingleMenuSeq( stepCounter, stepName ) algs = findAllAlgorithms( seq ) @@ -123,7 +114,7 @@ def generateDecisionTree(chains): return result else: raise Exception("No input maker in seq "+seq.name) - @memoize + @lru_cache(None) def findComboHypoAlg( stepCounter, stepName ): seq = getSingleMenuSeq( stepCounter, stepName ) algs = findAllAlgorithms( seq ) @@ -132,7 +123,7 @@ def generateDecisionTree(chains): return alg raise Exception("No combo hypo alg in seq "+seq.name) - @memoize + @lru_cache(None) def findHypoAlg( stepCounter, stepName ): seq = getSingleMenuSeq( stepCounter, stepName ) algs = findAllAlgorithms( seq ) @@ -142,7 +133,7 @@ def generateDecisionTree(chains): raise Exception("No hypo alg in seq "+seq.name) - @memoize + @lru_cache(None) def findAllHypoAlgs( stepCounter, stepName ): seq = getSingleMenuSeq( stepCounter, stepName ) algs = findAllAlgorithms( seq ) @@ -183,7 +174,7 @@ def generateDecisionTree(chains): return p.rstrip("_") p = n - @memoize + @lru_cache(None) def prevStepOutput( chain, stepCounter ): """ Returns list of decision collections that are outputs of previous step as well as the hypo alg name that outpus it @@ -194,7 +185,6 @@ def generateDecisionTree(chains): else: prevCounter = stepCounter-1 prevName = chain.steps[prevCounter-1].name # counting steps from 1, for indexing need one less - prevStep = chain.steps[prevCounter-1] prevHypoAlg = findComboHypoAlg( prevCounter, prevName ) out = prevHypoAlg.HypoOutputDecisions prevHypoAlgName = prevHypoAlg.name @@ -206,9 +196,7 @@ def generateDecisionTree(chains): for chain in chains: for stepCounter, step in enumerate( chain.steps, 1 ): getFilterAlg( stepCounter, step.name ) - menuSeqName = getSingleMenuSeq( stepCounter, step.name ).name - - + getSingleMenuSeq( stepCounter, step.name ).name # add sequences that allows reconstructions to be run in parallel, followed (in sequence) by the combo hypo comboSeq, comboRecoSeq = getComboSequences( stepCounter, step.name ) for sequence in step.sequences: @@ -320,7 +308,7 @@ def generateDecisionTree(chains): else: hypoAlg = findHypoAlg( stepCounter, step.name ) log.info(" HypoAlg {} Inputs {} Outputs {} Tools {}".format( hypoAlg.name, hypoAlg.HypoInputDecisions, hypoAlg.HypoOutputDecisions, [t.name for t in hypoAlg.HypoTools] ) ) - #kaboom + return acc