From 63a6677c5c4855af6977d928677d39cd17456ec7 Mon Sep 17 00:00:00 2001 From: Tomasz Bold <tomasz.bold@gmail.com> Date: Thu, 10 Oct 2019 10:30:35 +0000 Subject: [PATCH] Drop menu mapping properties in L1Decoder --- .../python/MTCalibPebConfig.py | 14 +++---- .../L1Decoder/share/testL1Decoder.py | 4 -- .../L1Decoder/src/EMRoIsUnpackingTool.cxx | 2 +- .../L1Decoder/src/EMRoIsUnpackingTool.h | 2 +- .../L1Decoder/src/IRoIsUnpackingTool.h | 4 +- .../L1Decoder/src/JRoIsUnpackingTool.cxx | 2 +- .../L1Decoder/src/JRoIsUnpackingTool.h | 2 +- Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx | 4 +- Trigger/TrigSteer/L1Decoder/src/L1Decoder.h | 4 -- .../L1Decoder/src/METRoIsUnpackingTool.cxx | 2 +- .../L1Decoder/src/METRoIsUnpackingTool.h | 2 +- .../L1Decoder/src/MURoIsUnpackingTool.cxx | 2 +- .../L1Decoder/src/MURoIsUnpackingTool.h | 2 +- .../L1Decoder/src/RerunRoIsUnpackingTool.cxx | 2 +- .../L1Decoder/src/RerunRoIsUnpackingTool.h | 2 +- .../L1Decoder/src/RoIsUnpackingToolBase.cxx | 36 ----------------- .../L1Decoder/src/RoIsUnpackingToolBase.h | 11 ++--- .../L1Decoder/src/TAURoIsUnpackingTool.cxx | 2 +- .../L1Decoder/src/TAURoIsUnpackingTool.h | 2 +- .../TrigUpgradeTest/CMakeLists.txt | 6 +-- .../python/EmuStepProcessingConfig.py | 13 ++---- .../TrigUpgradeTest/python/TestUtils.py | 40 ++----------------- .../share/EmuL1DecodingTest.py | 14 ++----- .../TrigUpgradeTest/share/EmuScalingCFTest.py | 22 ++-------- .../share/EmuStepProcessingTest.py | 11 +---- .../TrigUpgradeTest/share/MinBias.py | 1 - .../TrigUpgradeTest/share/simpleJetJob.py | 7 ---- .../TrigUpgradeTest/share/testHLT_MT.py | 1 - .../TriggerJobOpts/python/TriggerConfig.py | 7 ---- .../python/HLTMenuConfig/Menu/HLTCFConfig.py | 4 -- .../TriggerMenuMT/scripts/generateMenuMT.py | 5 +-- 31 files changed, 46 insertions(+), 186 deletions(-) diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py index 2e58f45499c..99de466efcd 100644 --- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py +++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/python/MTCalibPebConfig.py @@ -89,15 +89,16 @@ def make_l1_seq(): from TrigT1ResultByteStream.TrigT1ResultByteStreamConf import RoIBResultByteStreamDecoderAlg all_algs.append(RoIBResultByteStreamDecoderAlg()) + # Set menu for L1ConfigSvc + from TriggerJobOpts.TriggerFlags import TriggerFlags + TriggerFlags.triggerMenuSetup = "LS2_v1" + # Ensure LVL1ConfigSvc is initialised before L1Decoder handles BeginRun incident # This should be done by the L1Decoder configuration in new-style job options (with component accumulator) - from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc, findFileInXMLPATH + from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu, getL1ConfigSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr - svcMgr += LVL1ConfigSvc() - - # Set the LVL1 menu (needed for initialising LVL1ConfigSvc) - from TriggerJobOpts.TriggerFlags import TriggerFlags - svcMgr.LVL1ConfigSvc.XMLMenuFile = findFileInXMLPATH(TriggerFlags.inputLVL1configFile()) + l1JsonFile = generateL1Menu() + svcMgr += getL1ConfigSvc() # Initialise L1 decoding tools from L1Decoder.L1DecoderConf import CTPUnpackingTool @@ -114,7 +115,6 @@ def make_l1_seq(): from L1Decoder.L1DecoderConf import L1Decoder l1decoder = L1Decoder() l1decoder.ctpUnpacker = ctpUnpacker - l1decoder.ChainToCTPMapping = chainCTPMap all_algs.append(l1decoder) from AthenaCommon.CFElements import seqOR diff --git a/Trigger/TrigSteer/L1Decoder/share/testL1Decoder.py b/Trigger/TrigSteer/L1Decoder/share/testL1Decoder.py index 55a41bbc369..646b6f75343 100644 --- a/Trigger/TrigSteer/L1Decoder/share/testL1Decoder.py +++ b/Trigger/TrigSteer/L1Decoder/share/testL1Decoder.py @@ -23,10 +23,6 @@ for unpack in topSequence.L1Decoder.roiUnpackers: from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON generateJSON() - -#testChains =[x for x, y in CTPToChainMapping.items()] -#topSequence.L1Decoder.ChainToCTPMapping = CTPToChainMapping -#print testChains print topSequence.L1Decoder #from TrigUpgradeTest.jetDefs import jetRecoSequence diff --git a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx index 5a9252449e6..51b5e15a626 100644 --- a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.cxx @@ -39,7 +39,7 @@ StatusCode EMRoIsUnpackingTool::start() { return StatusCode::SUCCESS; } -StatusCode EMRoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) { +StatusCode EMRoIsUnpackingTool::updateConfiguration() { m_emThresholds.clear(); using namespace TrigConf; const ThresholdConfig* thresholdConfig = m_configSvc->thresholdConfig(); diff --git a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h index 1eb959dd719..6ae9f68c35e 100644 --- a/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/EMRoIsUnpackingTool.h @@ -34,7 +34,7 @@ public: const HLT::IDSet& activeChains) const override; virtual StatusCode initialize() override; - virtual StatusCode updateConfiguration(const IRoIsUnpackingTool::SeedingMap& ) override; + virtual StatusCode updateConfiguration() override; virtual StatusCode finalize() override; virtual StatusCode start() override; diff --git a/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h index 6cc5812a20d..e655cafae82 100644 --- a/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/IRoIsUnpackingTool.h @@ -20,12 +20,12 @@ class IRoIsUnpackingTool : virtual public IAlgTool { public: DeclareInterfaceID(IRoIsUnpackingTool, 1, 0); - typedef std::map<std::string, std::string> SeedingMap; + /** * Invoked when there is a potential change of the configuration. Typically beginRun * it obtains the information about the L1 item -> HLT seeding relation in a form of a map where the key is the HLT chain name and value is the L1 item **/ - virtual StatusCode updateConfiguration( const SeedingMap& seeding ) = 0; + virtual StatusCode updateConfiguration( ) = 0; /** * Unpack RoIB result depending on implementaton (e.g. EM, Jet, ...) diff --git a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx index 488031cf79b..d66f7d8bf63 100644 --- a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.cxx @@ -31,7 +31,7 @@ StatusCode JRoIsUnpackingTool::start() { } -StatusCode JRoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) { +StatusCode JRoIsUnpackingTool::updateConfiguration() { using namespace TrigConf; m_jetThresholds.clear(); diff --git a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h index ae91e1819b1..0ebe26d3162 100644 --- a/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/JRoIsUnpackingTool.h @@ -28,7 +28,7 @@ public: const HLT::IDSet& activeChains) const override; virtual StatusCode initialize() override; - virtual StatusCode updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) override; + virtual StatusCode updateConfiguration() override; virtual StatusCode finalize() override { return StatusCode::SUCCESS; } virtual StatusCode start() override; private: diff --git a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx index 568cb72f958..62a6d72b1ce 100644 --- a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.cxx @@ -51,9 +51,9 @@ StatusCode L1Decoder::initialize() { void L1Decoder::handle(const Incident& incident) { if (incident.type()!="BeginRun") return; ATH_MSG_DEBUG( "In L1Decoder BeginRun incident" ); - + for ( auto t: m_roiUnpackers ) - if ( t->updateConfiguration( m_chainToCTPProperty ).isFailure() ) { + if ( t->updateConfiguration( ).isFailure() ) { ATH_MSG_ERROR( "Problem in configuring " << t->name() ); } } diff --git a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h index 804dd1352e9..38a17b629b5 100644 --- a/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h +++ b/Trigger/TrigSteer/L1Decoder/src/L1Decoder.h @@ -66,10 +66,6 @@ private: Gaudi::Property<std::string> m_costMonitoringChain{this, "CostMonitoringChain", "HLT_costmonitor", "Name of the chain which should enable HLT cost montoring."}; - Gaudi::Property<std::map<std::string, std::string>> m_chainToCTPProperty{ - this, "ChainToCTPMapping", {}, "Seeding in the form: HLT_chain : L1_item"}; - ///@} - ServiceHandle<ITrigCostMTSvc> m_trigCostSvcHandle { this, "TrigCostMTSvc", "TrigCostMTSvc", "The trigger cost service" }; diff --git a/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.cxx index 5cbe42a9c33..b600e5d2c64 100644 --- a/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.cxx @@ -36,7 +36,7 @@ StatusCode METRoIsUnpackingTool::start() { } -StatusCode METRoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) { +StatusCode METRoIsUnpackingTool::updateConfiguration() { using namespace TrigConf; for ( auto thresholdToChain: m_thresholdToChainMapping ) { diff --git a/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.h index 9f9012c3ef8..60f98749fe3 100644 --- a/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/METRoIsUnpackingTool.h @@ -20,7 +20,7 @@ public: const std::string& name, const IInterface* parent ); - virtual StatusCode updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) override; + virtual StatusCode updateConfiguration() override; virtual StatusCode initialize() override; diff --git a/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx index 02084d1dbef..e7b8cbec466 100644 --- a/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.cxx @@ -41,7 +41,7 @@ StatusCode MURoIsUnpackingTool::start() { } -StatusCode MURoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) { +StatusCode MURoIsUnpackingTool::updateConfiguration() { using namespace TrigConf; const ThresholdConfig* thresholdConfig = m_configSvc->thresholdConfig(); for ( TriggerThreshold * th : thresholdConfig->getThresholdVector( L1DataDef::MUON ) ) { diff --git a/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h index ffff9e571f8..fa972de7236 100644 --- a/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/MURoIsUnpackingTool.h @@ -31,7 +31,7 @@ class MURoIsUnpackingTool : public RoIsUnpackingToolBase const IInterface* parent ); virtual StatusCode initialize() override; - virtual StatusCode updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) override; + virtual StatusCode updateConfiguration() override; virtual StatusCode unpack(const EventContext& ctx, const ROIB::RoIBResult& roib, const HLT::IDSet& activeChains) const override; diff --git a/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.cxx index d32fdc1cdb5..c10bb256d9d 100644 --- a/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.cxx @@ -30,7 +30,7 @@ StatusCode RerunRoIsUnpackingTool::finalize() { return StatusCode::SUCCESS; } -StatusCode RerunRoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) { +StatusCode RerunRoIsUnpackingTool::updateConfiguration() { return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.h index a85ba503991..bb8d84c5c94 100644 --- a/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/RerunRoIsUnpackingTool.h @@ -33,7 +33,7 @@ class RerunRoIsUnpackingTool : public RoIsUnpackingToolBase virtual ~RerunRoIsUnpackingTool(); virtual StatusCode initialize() override; virtual StatusCode finalize() override; - virtual StatusCode updateConfiguration(const IRoIsUnpackingTool::SeedingMap&) override; + virtual StatusCode updateConfiguration() override; StatusCode unpack( const EventContext& ctx, const ROIB::RoIBResult& roib, diff --git a/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx b/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx index 0961e7c3d48..778854e7967 100644 --- a/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.cxx @@ -48,42 +48,6 @@ StatusCode RoIsUnpackingToolBase::decodeMapping( std::function< bool(const std:: } return StatusCode::SUCCESS; } -StatusCode RoIsUnpackingToolBase::decodeMapping( std::function< bool(const TrigConf::TriggerThreshold*)> filter, const TrigConf::ItemContainer& l1Items, const IRoIsUnpackingTool::SeedingMap& seeding ) { - for ( auto chainItemPair: seeding) { - std::string chainName = chainItemPair.first; - std::string itemName = chainItemPair.second; - auto itemsIterator = l1Items.get<TrigConf::tag_name_hash>().find(itemName); - - if ( itemsIterator != l1Items.get<TrigConf::tag_name_hash>().end() ) { - - const TrigConf::TriggerItem* item = *itemsIterator; - const TrigConf::TriggerItemNode* node = item->topNode(); - std::vector<TrigConf::TriggerThreshold*> itemThresholds; - node->getAllThresholds(itemThresholds); - const int thresholdCount = itemThresholds.size(); - ATH_MSG_DEBUG( "Item " << item->name() << " with thresholds " << thresholdCount); - int prefix = -1; - for ( const TrigConf::TriggerThreshold* th: itemThresholds ) { - prefix++; - if ( filter(th) ) { - m_thresholdToChainMapping[HLT::Identifier(th->name())].push_back( HLT::Identifier(chainName) ); - ATH_MSG_DEBUG( "Associating " << chainName << " with threshold " << th->name() ); - if ( thresholdCount > 1 ) { - std::string legName = "000_" + chainName; - const std::string ps = std::to_string(prefix); - legName.replace(3-ps.size(), ps.size(), ps ); - m_thresholdToChainMapping[HLT::Identifier(th->name())].push_back( HLT::Identifier(legName) ); - ATH_MSG_INFO( "Associating " << legName << " with threshold " << th->name() ); - } - } - } - } else { - // we may wish to change that to ERROR at some point - ATH_MSG_WARNING( "Could not find item: " << itemName << " that is used in seeding"); - } - } - return StatusCode::SUCCESS; -} void RoIsUnpackingToolBase::addChainsToDecision( HLT::Identifier thresholdId, TrigCompositeUtils::Decision* d, diff --git a/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.h b/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.h index aeeb3c601e3..0028225cfe1 100644 --- a/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.h +++ b/Trigger/TrigSteer/L1Decoder/src/RoIsUnpackingToolBase.h @@ -36,7 +36,7 @@ public: virtual StatusCode initialize() override; - virtual StatusCode updateConfiguration( const IRoIsUnpackingTool::SeedingMap& /*seeding*/ ) override { return StatusCode::SUCCESS; } + virtual StatusCode updateConfiguration( ) override { return StatusCode::SUCCESS; } virtual StatusCode unpack(const EventContext& /*ctx*/, const ROIB::RoIBResult& /*roib*/, @@ -49,10 +49,6 @@ protected: SG::WriteHandleKey<TrigCompositeUtils::DecisionContainer> m_decisionsKey{ this, "Decisions", "RoIDecisions", "Decisions for each RoI"}; - Gaudi::Property<std::vector<std::string>> m_thresholdToChainProperty{ - this, "ThresholdToChainMapping", {}, "Mapping from the threshold name to chain in the form: " - "'EM3 : HLT_e5', 'EM3 : HLT_e5tight', ..., ( note spaces ), if absent, the L1 item -> HLT chain seeding relation is used to find the threshold"}; - SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu"}; @@ -61,10 +57,9 @@ protected: std::map<HLT::Identifier, HLT::IDVec> m_thresholdToChainMapping; /** - * decodes mapping from L1 item -> to HLT chain to find out which threshold seeds which chain - * Threshold have to pass the selection of the filter (i.e. the filter should return true for the threshold to seed a chain) + * Fills mapping from L1 threshold -> to HLT chain + * @arg filter is a function that, using the threshold name defines if this decoder instance should take care of this threshold **/ - StatusCode decodeMapping( std::function< bool(const TrigConf::TriggerThreshold*)> filter, const TrigConf::ItemContainer& l1Items, const IRoIsUnpackingTool::SeedingMap& seeding ); StatusCode decodeMapping( std::function< bool(const std::string&)> filter ) ; diff --git a/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx index 2a3b8bcf89f..a724ef690f5 100644 --- a/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx +++ b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.cxx @@ -49,7 +49,7 @@ StatusCode TAURoIsUnpackingTool::start() { } -StatusCode TAURoIsUnpackingTool::updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) { +StatusCode TAURoIsUnpackingTool::updateConfiguration() { using namespace TrigConf; m_tauThresholds.clear(); diff --git a/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h index 8d1215c5a1b..2e4c1d16a1b 100644 --- a/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h +++ b/Trigger/TrigSteer/L1Decoder/src/TAURoIsUnpackingTool.h @@ -34,7 +34,7 @@ public: const HLT::IDSet& activeChains) const override; virtual StatusCode initialize() override; - virtual StatusCode updateConfiguration( const IRoIsUnpackingTool::SeedingMap& ) override; + virtual StatusCode updateConfiguration() override; virtual StatusCode finalize() override; virtual StatusCode start() override; private: diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt index 342f56cc64e..a0d1a75e26c 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt +++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt @@ -50,9 +50,9 @@ function( _add_test name ) endfunction( _add_test ) -#_add_test( emu_l1_decoding POST_EXEC_SCRIPT nopost.sh ) # should be moved to the L1Decoder package -#_add_test( emu_scaling_CF EXTRA_PATTERNS "-s TrigSignatureMoniMT.*INFO HLT_.*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*") # should be moved to TriggerMenuMT -#_add_test( emu_step_processing EXTRA_PATTERNS "-s TrigSignatureMoniMT.*INFO HLT_.*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*") # should be moved to TriggerMenuMT +_add_test( emu_l1_decoding POST_EXEC_SCRIPT nopost.sh ) # should be moved to the L1Decoder package +_add_test( emu_scaling_CF EXTRA_PATTERNS "-s TrigSignatureMoniMT.*INFO HLT_.*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*") # should be moved to TriggerMenuMT +_add_test( emu_step_processing EXTRA_PATTERNS "-s TrigSignatureMoniMT.*INFO HLT_.*|TriggerSummaryStep.* chains passed:|TriggerSummaryStep.*+++ HLT_.*") # should be moved to TriggerMenuMT # Unit tests of the test scripts atlas_add_test( flake8_test_dir diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py index c930765f16f..3a7e9a15cc7 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py @@ -201,9 +201,7 @@ def generateL1DecoderAndChains(): HLTChains += CombChains - # this is a temporary hack to include new test chains - from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import getOverallL1item - EnabledChainNamesToCTP = dict([ (c.name, getOverallL1item(c.name)) for c in HLTChains]) + ########################## L1 ################################################# @@ -211,23 +209,18 @@ def generateL1DecoderAndChains(): l1Decoder = L1Decoder( RoIBResult="" ) l1Decoder.prescaler.EventInfo="" - l1Decoder.ChainToCTPMapping = EnabledChainNamesToCTP l1Decoder.L1DecoderSummaryKey = "L1DecoderSummary" ctpUnpacker = CTPUnpackingEmulationTool( ForceEnableAllChains=False , InputFilename="ctp.dat" ) l1Decoder.ctpUnpacker = ctpUnpacker emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", InputFilename="l1emroi.dat", OutputTrigRoIs="L1EMRoIs", Decisions="L1EM", ThresholdPrefix="EM" ) - emUnpacker.ThresholdToChainMapping = thresholdToChains( ElChains ) + [ m for m in thresholdToChains( CombChains ) if "EM" in m] #EnabledElChains + EnabledElComboChains emUnpacker.Decisions="L1EM" - log.debug("EMRoIsUnpackingTool enables chians:") - log.debug(emUnpacker.ThresholdToChainMapping) + muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", InputFilename="l1muroi.dat", OutputTrigRoIs="L1MURoIs", Decisions="L1MU", ThresholdPrefix="MU" ) - muUnpacker.ThresholdToChainMapping = thresholdToChains( MuChains ) + [ m for m in thresholdToChains( CombChains ) if "MU" in m] #EnabledMuChains + EnabledMuComboChains muUnpacker.Decisions="L1MU" - log.debug("MURoIsUnpackingTool enables chians:") - log.debug(muUnpacker.ThresholdToChainMapping) + l1Decoder.roiUnpackers = [emUnpacker, muUnpacker] diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py b/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py index b5fb45d1500..a7f55a9e0f8 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/TestUtils.py @@ -12,30 +12,9 @@ def writeEmulationFiles(data): # Testing menu used in the L1 decoders class MenuTest(object): + pass + - CTPToChainMapping = {"HLT_e3_etcut": "L1_EM3", - "HLT_e5_etcut": "L1_EM3", - "HLT_g5_etcut": "L1_EM3", - "HLT_e7_etcut": "L1_EM7", - "HLT_mu6idperf": "L1_MU6", - "HLT_mu6": "L1_MU6", - "HLT_mu20": "L1_MU20", - "HLT_xs20": "L1_EM7", - "HLT_2e3_etcut": "L1_2EM3", - "HLT_e3e5_etcut":"L1_2EM3", - "HLT_2mu6": "L1_2MU4", - "HLT_e15mu24": "L1_EM7_MU15", - "HLT_xe10": "L1_XE10", - "HLT_te15": "L1_TE15.0ETA24", - "HLT_j85": "L1_J20", - "HLT_j60": "L1_J20", - "HLT_j35_gsc45_boffperf_split" : "L1_J20", - "HLT_j35_gsc45_bmv2c1070_split" : "L1_J20", - "HLT_j35_gsc45_bmv2c1070" : "L1_J20" - } - -def applyMenu(l1decoder): - l1decoder.ChainToCTPMapping = MenuTest.CTPToChainMapping from L1Decoder.L1DecoderConf import L1Decoder # L1 emulation for RDO @@ -65,12 +44,6 @@ class L1EmulationTest(L1Decoder): self.ctpUnpacker = ctpUnpacker self += ctpUnpacker - self.ChainToCTPMapping = {'HLT_mu20' : 'L1_MU8', - 'HLT_mu81step' : 'L1_MU8', - 'HLT_mu8' : 'L1_MU8', - 'HLT_e20' : 'L1_EM12', - 'HLT_e8' : 'L1_EM7', - 'HLT_mu8_e8' : 'L1_EM3_MU6'} # EM unpacker if TriggerFlags.doID() or TriggerFlags.doCalo(): @@ -78,9 +51,6 @@ class L1EmulationTest(L1Decoder): Decisions = "EMRoIDecisions", OutputTrigRoIs = "EMRoIs", OutputLevel = self.getDefaultProperty("OutputLevel")) - emUnpacker.ThresholdToChainMapping = ['EM7 : HLT_e20', - 'EM7 : HLT_e8', - 'EM7 : HLT_mu8_e8'] self.roiUnpackers += [emUnpacker] print emUnpacker @@ -91,10 +61,6 @@ class L1EmulationTest(L1Decoder): Decisions = "MURoIDecisions", OutputTrigRoIs = "MURoIs", OutputLevel=self.getDefaultProperty("OutputLevel")) - muUnpacker.ThresholdToChainMapping = ['MU10 : HLT_mu20', - 'MU6 : HLT_mu81step', - 'MU6 : HLT_mu8', - 'MU6 : HLT_mu8_e8'] self.roiUnpackers += [muUnpacker] self.L1DecoderSummaryKey = "L1DecoderSummary" @@ -104,7 +70,7 @@ class L1EmulationTest(L1Decoder): chainsCounter = 0 -def makeChain( name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=[] ): +def makeChain( name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=["RATE:TestRateGroup", "BW:TestBW"] ): """ In addition to making the chain object fills the flags that are used to generate MnuCOnfig JSON file """ diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuL1DecodingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuL1DecodingTest.py index 271049f220c..aae95adaf9a 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuL1DecodingTest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuL1DecodingTest.py @@ -55,12 +55,9 @@ l1Decoder.ctpUnpacker = ctpUnpacker emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", Decisions = "EMRoIDecisions") -emUnpacker.ThresholdToChainMapping = ["EM3 : HLT_e3", "EM3 : HLT_g5", "EM7 : HLT_e7", "EM15 : HLT_e15mu4" ] - muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", Decisions = "MURoIDecisions") -muUnpacker.ThresholdToChainMapping = ["MU6 : HLT_mu6", "MU6 : HLT_mu6idperf", "MU4 : HLT_e15mu4"] # do not know yet how to configure the services for it l1Decoder.roiUnpackers = [emUnpacker] @@ -94,13 +91,10 @@ makeHLTTree( triggerConfigHLT=TriggerConfigHLT ) from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON generateJSON() -# once MR unifying this setup in replce by an import from config svc -from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc, HLTConfigSvc, findFileInXMLPATH -svcMgr += HLTConfigSvc() -hltJsonFile = TriggerFlags.inputHLTconfigFile().replace(".xml",".json").replace("HLTconfig","HLTmenu") -hltJsonFile = findFileInXMLPATH(hltJsonFile) -svcMgr.HLTConfigSvc.JsonFileName = hltJsonFile -log.info("Configured HLTConfigSvc with InputType='file' and JsonFileName=%s" % hltJsonFile) +from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc +from AthenaCommon.AppMgr import ServiceMgr +ServiceMgr += getHLTConfigSvc() + print "topSequence dump:", topSequence # diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuScalingCFTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuScalingCFTest.py index 2894e6e4869..bd9216290c8 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuScalingCFTest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuScalingCFTest.py @@ -92,9 +92,6 @@ def process(): writeEmulationFiles(data) - # this is a temporary hack to include new test chains - from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import getOverallL1item - EnabledChainNamesToCTP = dict([ (c.name, getOverallL1item(c.name)) for c in HLTChains]) ########################## L1 ################################################# @@ -102,18 +99,14 @@ def process(): l1Decoder = L1Decoder( RoIBResult="" ) l1Decoder.prescaler.EventInfo="" - l1Decoder.ChainToCTPMapping = EnabledChainNamesToCTP l1Decoder.L1DecoderSummaryKey = "L1DecoderSummary" ctpUnpacker = CTPUnpackingEmulationTool( ForceEnableAllChains=False , InputFilename="ctp.dat" ) l1Decoder.ctpUnpacker = ctpUnpacker - emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", InputFilename="l1emroi.dat", OutputTrigRoIs="L1EMRoIs", Decisions="L1EM" ) + emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", InputFilename="l1emroi.dat", OutputTrigRoIs="L1EMRoIs", Decisions="L1EM", ThresholdPrefix="EM" ) from TrigUpgradeTest.EmuStepProcessingConfig import thresholdToChains - emUnpacker.ThresholdToChainMapping = thresholdToChains( HLTChains ) emUnpacker.Decisions="L1EM" - log.debug("EMRoIsUnpackingTool enables chians:") - log.debug(emUnpacker.ThresholdToChainMapping) l1Decoder.roiUnpackers = [emUnpacker] @@ -137,19 +130,12 @@ def process(): theApp.EvtMax = nevents - from TriggerJobOpts.TriggerFlags import TriggerFlags - TriggerFlags.outputHLTconfigFile = TriggerFlags.outputHLTconfigFile().replace('config', 'menu') from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON generateJSON() - # once MR unifying this setup in replce by an import from config svc - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc, HLTConfigSvc, findFileInXMLPATH - svcMgr += HLTConfigSvc() - hltJsonFile = TriggerFlags.inputHLTconfigFile().replace(".xml",".json").replace("HLTconfig","HLTmenu") - hltJsonFile = findFileInXMLPATH(hltJsonFile) - svcMgr.HLTConfigSvc.JsonFileName = hltJsonFile - log.info("Configured HLTConfigSvc with InputType='file' and JsonFileName=%s" % hltJsonFile) + from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc + from AthenaCommon.AppMgr import ServiceMgr + ServiceMgr += getHLTConfigSvc() process() diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py index 8b04d5e577f..4bf6695fd43 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py @@ -33,18 +33,11 @@ from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree makeHLTTree( triggerConfigHLT=TriggerConfigHLT ) -TriggerFlags.outputHLTconfigFile = TriggerFlags.outputHLTconfigFile().replace('config', 'menu') from TriggerMenuMT.HLTMenuConfig.Menu.HLTMenuJSON import generateJSON generateJSON() - -# once MR unifying this setup in replce by an import from config svc -from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc, HLTConfigSvc, findFileInXMLPATH -svcMgr += HLTConfigSvc() -hltJsonFile = TriggerFlags.inputHLTconfigFile().replace(".xml",".json").replace("HLTconfig","HLTmenu") -hltJsonFile = findFileInXMLPATH(hltJsonFile) -svcMgr.HLTConfigSvc.JsonFileName = hltJsonFile -log.info("Configured HLTConfigSvc with InputType='file' and JsonFileName=%s" % hltJsonFile) +from TrigConfigSvc.TrigConfigSvcCfg import getHLTConfigSvc +svcMgr += getHLTConfigSvc() print "EmuStepProcessing: dump top Sequence after CF/DF Tree build" diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/MinBias.py b/Trigger/TrigValidation/TrigUpgradeTest/share/MinBias.py index 2030da6198f..dac47ba6e10 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/MinBias.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/MinBias.py @@ -15,7 +15,6 @@ for viewAlg in viewAlgs: from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() -topSequence.L1Decoder.ChainToCTPMapping={"HLT_mbsptrk":"L1_RD0_FILLED"} topSequence += viewAlgs from TrigT2MinBias.TrigT2MinBiasConf import TrigCountSpacePointsMT, SPCountHypoAlgMT, SPCountHypoTool diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py index 98204412190..f57142a0392 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/simpleJetJob.py @@ -20,13 +20,6 @@ if TriggerFlags.doCalo: # menu items - CTPToChainMapping = { - "HLT_j85": "L1_J20" , - "HLT_j45" : "L1_J20" - } - testChains =[x for x, y in CTPToChainMapping.items()] - topSequence.L1Decoder.ChainToCTPMapping = CTPToChainMapping - print testChains # get L1 decisions for unpack in topSequence.L1Decoder.roiUnpackers: diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py index 20b2586e156..b1378325533 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/testHLT_MT.py @@ -394,7 +394,6 @@ if opt.doL1Unpacking: from L1Decoder.L1DecoderConfig import L1Decoder topSequence += RoIBResultByteStreamDecoderAlg() # creates RoIBResult (input for L1Decoder) from ByteStream topSequence += L1Decoder("L1Decoder") - #topSequence.L1Decoder.ChainToCTPMapping = MenuTest.CTPToChainMapping elif opt.doL1Sim: from L1Decoder.L1DecoderConfig import L1Decoder topSequence += L1Decoder("L1Decoder") diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index 1faa4ed918b..db8e8fe7e91 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -180,7 +180,6 @@ def triggerMonitoringCfg(flags, hypos, filters, l1Decoder): #mon.FinalChainStep = allChains mon.L1Decisions = l1Decoder.getProperties()['L1DecoderSummaryKey'] if l1Decoder.getProperties()['L1DecoderSummaryKey'] != '<no value>' else l1Decoder.getDefaultProperty('L1DecoderSummary') - allChains.update( l1Decoder.ChainToCTPMapping.keys() ) from DecisionHandling.DecisionHandlingConfig import setupFilterMonitoring [ [ setupFilterMonitoring( alg ) for alg in algs ] for algs in filters.values() ] @@ -331,11 +330,6 @@ def triggerMergeViewsAndAddMissingEDMCfg( edmSet, hypos, viewMakers, decObj ): return alg -def setupL1DecoderFromMenu( flags, l1Decoder ): - """ Post setup of the L1Decoder, once approved, it should be moved to L1DecoderCfg function """ - - from TriggerJobOpts.MenuConfigFlags import MenuUtils - l1Decoder.ChainToCTPMapping = MenuUtils.toCTPSeedingDict( flags ) def triggerRunCfg( flags, menu=None ): @@ -358,7 +352,6 @@ def triggerRunCfg( flags, menu=None ): # necessary ingreedient is list of mappings from L1 item to chain # and item to threshold (the later can be maybe extracted from L1 config file) l1DecoderAcc, l1DecoderAlg = L1DecoderCfg( flags ) - setupL1DecoderFromMenu( flags, l1DecoderAlg ) acc.merge( l1DecoderAcc ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index 6227ffdce71..6030f5c69e6 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -144,10 +144,6 @@ def makeHLTTree(newJO=False, triggerConfigHLT = None): # take L1Decoder out of topSeq topSequence.remove( l1decoder ) - # set CTP chains before creating the full tree (and the monitor) - EnabledChainNamesToCTP = dict([ (c["chainName"], c["L1item"]) for c in triggerConfigHLT.dictsList()]) - l1decoder[0].ChainToCTPMapping = EnabledChainNamesToCTP - # main HLT top sequence hltTop = seqOR("HLTTop") diff --git a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateMenuMT.py index 8d781bd008f..34ba3fdcebe 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateMenuMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/scripts/generateMenuMT.py @@ -25,11 +25,8 @@ TriggerFlags.triggerMenuSetup = "LS2_v1" from TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT import GenerateMenuMT g = GenerateMenuMT() -#allChainConfigs = g.generateChainConfigs() -allChainConfigs = g.getChainsFromMenu() -EnabledChainNamesToCTP = dict([ (c[0], c[1]) for c in allChainConfigs]) -topSequence.L1Decoder.ChainToCTPMapping = EnabledChainNamesToCTP + -- GitLab