From b36fa7cd8f0cf40a7fe55c71c1adc7c019039f68 Mon Sep 17 00:00:00 2001 From: Tim Martin <tim.martin@cern.ch> Date: Mon, 2 Nov 2020 15:39:52 +0000 Subject: [PATCH] [ATR-21897] Chain Multiplicity to JSON for use offline --- .../TrigDecisionTool/ChainGroup.icc | 92 ++++++++++++------- .../TrigConfData/TrigConfData/HLTChain.h | 3 + .../TrigConfData/src/HLTChain.cxx | 11 +++ .../TrigConfHLTData/HLTChain.h | 3 + .../TrigConfxAOD/Root/prepareTriggerMenu.cxx | 1 + .../TrigSteeringEvent/Chain.h | 1 + .../Root/TrigCompositeUtilsRoot.cxx | 19 ++-- .../TrigCompositeUtils/TrigCompositeUtils.h | 10 +- .../test/TrigTraversal_test.cxx | 30 +++--- .../TriggerJobOpts/python/TriggerConfig.py | 8 +- .../python/TriggerConfigGetter.py | 20 ++-- .../python/HLTMenuConfig/Menu/HLTMenuJSON.py | 1 + 12 files changed, 124 insertions(+), 75 deletions(-) diff --git a/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc b/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc index 35aa5a9a542..880d797b478 100644 --- a/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc +++ b/Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/ChainGroup.icc @@ -45,53 +45,77 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature return std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> >(); } - // For each chain, collect Navigation information - TrigCompositeUtils::NavGraph navGraph; + // The sub-graph from which we will extract features + TrigCompositeUtils::NavGraph navGraph; - // Loop over HLT chains - TrigCompositeUtils::DecisionIDContainer chainIDs; + // Collect the set of chains (and chain legs) which we are fetching + // Perform the fetches using the full set of IDs for each chain (include all legs) + TrigCompositeUtils::DecisionIDContainer allRequestedChainIDs; std::set<const TrigConf::HLTChain*>::const_iterator chIt; for (chIt=conf_chain_begin(); chIt != conf_chain_end(); ++chIt) { - const HLT::Chain* fchain = cgm()->chain(**chIt); - if (fchain) { - chainIDs.insert( fchain->getChainHashId() ); - // Obtain navigation routes for passed chains - // Final parameter TRUE as the chain passed (has its ID in terminusNode) - TrigCompositeUtils::recursiveGetDecisions(terminusNode, navGraph, fchain->getChainHashId(), true); + TrigCompositeUtils::DecisionIDContainer thisChainIDs; + HLT::Identifier chainID(""); - ATH_MSG_DEBUG("Added all passed navigation data for chain " << fchain->getChainName() - << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges() << " final nodes:" << navGraph.finalNodes().size()); - if (msg().level() <= MSG::DEBUG && navGraph.finalNodes().size()) { - for (const TrigCompositeUtils::NavGraphNode* n : navGraph.finalNodes()) { - ATH_MSG_DEBUG(" Final node:" << TrigCompositeUtils::decisionToElementLink(n->node()).dataID() << " #" << n->node()->index()); + const HLT::Chain* fchain = cgm()->chain(**chIt); + if (fchain) { + chainID = HLT::Identifier( fchain->getChainName() ); + const std::vector<size_t> legMultiplicites = fchain->getLegMultiplicities(); + allRequestedChainIDs.insert( chainID.numeric() ); + thisChainIDs.insert( chainID.numeric() ); + if (legMultiplicites.size() == 0) { + ATH_MSG_ERROR("chain " << chainID << " has invalid configuration, no multiplicity data."); + } else if (legMultiplicites.size() > 1) { + // For multi-leg chains, the DecisionIDs are handled per leg. + // We don't care here exactly how many objects are required per leg, just that there are two-or-more legs + for (size_t legNumeral = 0; legNumeral < legMultiplicites.size(); ++legNumeral) { + HLT::Identifier legID = TrigCompositeUtils::createLegName(chainID, legNumeral); + allRequestedChainIDs.insert( legID.numeric() ); + thisChainIDs.insert( legID.numeric() ); } } + ATH_MSG_DEBUG("Adding navigation data for chain " << chainID << " with " << legMultiplicites.size() << " leg(s)." ); + if (msg().level() <= MSG::VERBOSE) { + for (const TrigCompositeUtils::DecisionID printID : thisChainIDs) { + ATH_MSG_VERBOSE(" -- Collecting for chain or chain-leg: " << HLT::Identifier(printID)); + } + } + } else { + ATH_MSG_ERROR("Cannot access configuration for one of the ChainGroup's chains"); + continue; + } - if (condition == TrigDefs::includeFailedDecisions) { - std::vector<const TrigCompositeUtils::Decision*> rejectedDecisionNodes = - TrigCompositeUtils::getRejectedDecisionNodes(eventStore, fchain->getChainHashId()); + // Obtain navigation routes for objects which pass + // Final parameter TRUE as the chain passed (has its ID in terminusNode) + TrigCompositeUtils::recursiveGetDecisions(terminusNode, navGraph, thisChainIDs, true); - ATH_MSG_DEBUG("Chain " << fchain->getChainName() << " has " << rejectedDecisionNodes.size() - << " dangling nodes in the graph from objects which were rejected."); + ATH_MSG_DEBUG("Added all passed navigation data for chain " << chainID + << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges() << " final nodes:" << navGraph.finalNodes().size()); - for (const TrigCompositeUtils::Decision* rejectedNode : rejectedDecisionNodes) { - // Final parameter FALSE as the chain failed here (its ID was removed from rejectedNode) - TrigCompositeUtils::recursiveGetDecisions(rejectedNode, navGraph, fchain->getChainHashId(), false); - } + // Obtain navigation routes for objects which fail + if (condition == TrigDefs::includeFailedDecisions) { + std::vector<const TrigCompositeUtils::Decision*> rejectedDecisionNodes = + TrigCompositeUtils::getRejectedDecisionNodes(eventStore, thisChainIDs); - ATH_MSG_DEBUG("Added all failed navigation data for chain " << fchain->getChainName() - << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges() << " final nodes:" << navGraph.finalNodes().size()); - if (msg().level() <= MSG::DEBUG && navGraph.finalNodes().size()) { - for (const TrigCompositeUtils::NavGraphNode* n : navGraph.finalNodes()) { - ATH_MSG_DEBUG(" Final node:" << TrigCompositeUtils::decisionToElementLink(n->node()).dataID() << " #" << n->node()->index()); - } - } + ATH_MSG_DEBUG("Chain " << chainID << " has " << rejectedDecisionNodes.size() + << " dangling nodes in the graph from objects which were rejected."); + for (const TrigCompositeUtils::Decision* rejectedNode : rejectedDecisionNodes) { + // Final parameter FALSE as the chain failed here (its ID was removed from rejectedNode) + TrigCompositeUtils::recursiveGetDecisions(rejectedNode, navGraph, thisChainIDs, false); } - } else { - ATH_MSG_ERROR("Cannot access configuration for one of the ChainGroup's chains"); + ATH_MSG_DEBUG("Added all failed navigation data for chain " << chainID + << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges() << " final nodes:" << navGraph.finalNodes().size()); + } + + } + + ATH_MSG_DEBUG("Finished adding nodes to sub-graph. " + << ", total nodes:" << navGraph.nodes() << " total edges:" << navGraph.edges() << " final nodes:" << navGraph.finalNodes().size()); + if (msg().level() <= MSG::DEBUG && navGraph.finalNodes().size()) { + for (const TrigCompositeUtils::NavGraphNode* n : navGraph.finalNodes()) { + ATH_MSG_DEBUG(" Final node:" << TrigCompositeUtils::decisionToElementLink(n->node()).dataID() << " #" << n->node()->index()); } } @@ -107,7 +131,7 @@ std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > Trig::ChainGroup::feature const bool lastFeatureOfTypeFlag = (featureCollectionMode == TrigDefs::lastFeatureOfType); std::vector<TrigCompositeUtils::LinkInfo<CONTAINER>> returnVector = - TrigCompositeUtils::recursiveGetFeaturesOfType<CONTAINER>(navGraph, containerSGKey, lastFeatureOfTypeFlag, navElementLinkKey, chainIDs); + TrigCompositeUtils::recursiveGetFeaturesOfType<CONTAINER>(navGraph, containerSGKey, lastFeatureOfTypeFlag, navElementLinkKey, allRequestedChainIDs); // Check for missing navigation data if requesting the default "feature" links if (navElementLinkKey == TrigCompositeUtils::featureString()) { diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h index d15e8776946..c5b426d4665 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/HLTChain.h @@ -50,6 +50,9 @@ namespace TrigConf { /** Accessor to the l1 thresholds */ std::vector<std::string> l1thresholds() const; + /** Accessor to the chains multiplicitiy requirements for each of its legs */ + std::vector<size_t> legMultiplicities() const; + /** Accessor to the connected output streams */ std::vector<std::string> streams() const; diff --git a/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx b/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx index d85d27eb34d..35bf9e37c25 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/HLTChain.cxx @@ -61,6 +61,17 @@ TrigConf::Chain::l1item() const return getAttribute("l1item"); } +std::vector<size_t> TrigConf::Chain::legMultiplicities() const { + std::vector<size_t> returnMultiplicities; + const auto& theMultiplicities = getList("legMultiplicities"); + if( !theMultiplicities.empty() ) { + returnMultiplicities.reserve(theMultiplicities.size()); + for( auto& m : theMultiplicities ) { + returnMultiplicities.push_back( m.getValue<size_t>() ); + } + } + return returnMultiplicities; +} std::vector<std::string> TrigConf::Chain::l1thresholds() const diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTChain.h b/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTChain.h index 336a5a6b41c..cdb9c66b576 100644 --- a/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTChain.h +++ b/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTChain.h @@ -80,6 +80,7 @@ namespace TrigConf { unsigned int chain_hash_id () const { return m_chain_hash_id; } unsigned int lower_chain_hash_id () const { return m_lower_chain_hash_id; } int EB_after_step () const { return m_EB_after_step; } + const std::vector<size_t> leg_multiplicities () const { return m_leg_multiplicities; } bool hasMultipleLowerChains() const; const std::vector<int>& lower_chain_counters () const; std::vector<unsigned int> lower_chain_hash_ids () const; @@ -100,6 +101,7 @@ namespace TrigConf { HLTChain& set_triggerTypeList ( const std::vector<HLTTriggerType*>& trigList) { m_HLTTriggerTypeList = trigList; return *this; } HLTChain& set_groupList ( const std::set<std::string>& groups) { m_groups = groups; return *this; } HLTChain& set_EB_after_step ( int EB_after_step ) { m_EB_after_step = EB_after_step; return *this; } + HLTChain& set_leg_multiplicities ( const std::vector<size_t>& mult ) { m_leg_multiplicities = mult; return *this; } // signatures @@ -175,6 +177,7 @@ namespace TrigConf { std::vector<int> m_lower_chain_counters;//!< counters of the lower trigger items if more than 1 unsigned int m_lower_chain_hash_id; //!< hash value from m_lower_chain_name, this is used to match to a chain from the previous trigger level int m_EB_after_step; //!< EB_after_step flag + std::vector<size_t> m_leg_multiplicities;//!< Number of objects required per leg. NOTE: Run3 only quantity HLTPrescale m_prescales; std::vector<HLTSignature*> m_HLTSignatureList; diff --git a/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx b/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx index 51fbb0cbcfd..ad75980a9ca 100644 --- a/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx +++ b/Trigger/TrigConfiguration/TrigConfxAOD/Root/prepareTriggerMenu.cxx @@ -339,6 +339,7 @@ namespace TrigConf { chain->set_rerun_prescale( -1.0 ); // Not used in R3 chain->set_pass_through( -1.0 ); // Not used in R3 chain->set_prescale( loadedPrescale.prescale ); + chain->set_leg_multiplicities( loadedChain.legMultiplicities() ); // Add it to the list of chains: if( ! chainList.addHLTChain( chain ) ) { diff --git a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h index cf0ae8609e4..b62350c1c3a 100644 --- a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h +++ b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h @@ -95,6 +95,7 @@ namespace HLT { const std::string& getChainName() const { return (m_configChain ? m_configChain->chain_name(): no_config); } //!< return the Chain name (string) const std::string& getLowerChainName() const { return (m_configChain ? m_configChain->lower_chain_name(): no_config); } //!< return the Chain name (string) int getEBAfterStep() const { return (m_configChain ? m_configChain->EB_after_step() : -1.); } //!< get EB_after_step + std::vector<size_t> getLegMultiplicities() const { return (m_configChain ? m_configChain->leg_multiplicities() : std::vector<size_t>()); } //!< get per leg multiplicity (Run3 only) bool nextStepAfterEB() const { return ((getChainStep()+1) > getEBAfterStep()) && (getEBAfterStep()>0.); } //!< return whether next step requires EB (-1 means no EB called) bool isMerged() const { return (m_configChain ? (m_configChain->level()=="HLT") : false);}; //!<< return whether is a merged L2+EF chain diff --git a/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx b/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx index 9ef63ae2eb7..8b3529bf22f 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx +++ b/Trigger/TrigSteer/TrigCompositeUtils/Root/TrigCompositeUtilsRoot.cxx @@ -215,7 +215,7 @@ namespace TrigCompositeUtils { return composite->hasObjectCollectionLinks( m_name ); } - std::vector<const Decision*> getRejectedDecisionNodes(asg::EventStoreType* eventStore, const DecisionID id) { + std::vector<const Decision*> getRejectedDecisionNodes(asg::EventStoreType* eventStore, const DecisionIDContainer ids) { std::vector<const Decision*> output; // The list of containers we need to read can change on a file-by-file basis (it depends on the SMK) // Hence we query SG for all collections rather than maintain a large and ever changing ReadHandleKeyArray @@ -276,10 +276,10 @@ namespace TrigCompositeUtils { // So the size of activeChainsIntoThisDecision corresponds to the number of HypoTools which will have run // What do we care about? A chain, or all chains? DecisionIDContainer chainsToCheck; - if (id == 0) { // We care about *all* chains + if (ids.size() == 0) { // We care about *all* chains chainsToCheck = activeChainsIntoThisDecision; - } else { // We care about *one* chain - chainsToCheck.insert(id); + } else { // We care about sepcified chains + chainsToCheck = ids; } // We have found a rejected decision node *iff* a chainID to check is *not* present here // I.e. the HypoTool for the chain returned a NEGATIVE decision @@ -300,12 +300,11 @@ namespace TrigCompositeUtils { void recursiveGetDecisionsInternal(const Decision* node, const Decision* comingFrom, NavGraph& navGraph, - const DecisionID id, + const DecisionIDContainer ids, const bool enforceDecisionOnNode) { // Does this Decision satisfy the chain requirement? - DecisionIDContainer idSet = {id}; - if (enforceDecisionOnNode && id != 0 && !isAnyIDPassing(node, idSet)) { + if (enforceDecisionOnNode && ids.size() != 0 && !isAnyIDPassing(node, ids)) { return; // Stop propagating down this leg. It does not concern the chain with DecisionID = id } @@ -318,7 +317,7 @@ namespace TrigCompositeUtils { for ( ElementLink<DecisionContainer> seed : getLinkToPrevious(node)) { const Decision* seedDecision = *(seed); // Dereference ElementLink // Sending true as final parameter for enforceDecisionOnStartNode as we are recursing away from the supplied start node - recursiveGetDecisionsInternal(seedDecision, node, navGraph, id, /*enforceDecisionOnNode*/ true); + recursiveGetDecisionsInternal(seedDecision, node, navGraph, ids, /*enforceDecisionOnNode*/ true); } } return; @@ -326,11 +325,11 @@ namespace TrigCompositeUtils { void recursiveGetDecisions(const Decision* start, NavGraph& navGraph, - const DecisionID id, + const DecisionIDContainer ids, const bool enforceDecisionOnStartNode) { // Note: we do not require navGraph to be an empty graph. We can extend it. - recursiveGetDecisionsInternal(start, /*comingFrom*/nullptr, navGraph, id, enforceDecisionOnStartNode); + recursiveGetDecisionsInternal(start, /*comingFrom*/nullptr, navGraph, ids, enforceDecisionOnStartNode); return; } diff --git a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h index 33ccb51ffcf..64ea8b34ea3 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h +++ b/Trigger/TrigSteer/TrigCompositeUtils/TrigCompositeUtils/TrigCompositeUtils.h @@ -256,10 +256,10 @@ namespace TrigCompositeUtils { /** * @brief Query all DecisionCollections in the event store, locate all Decision nodes in the graph where an object failed selection for a given chain. * @param[in] eventStore Pointer to event store within current event context - * @param[in] id ID of chain to located failed decision nodes for. Passing 0 returns all decision nodes which failed at least one chain. + * @param[in] ids IDs of chain (if multi-leg chain, include all legs) to located failed decision nodes for. Passing an empty set returns all decision nodes which failed at least one chain. * @return Vector of Decision nodes whose attached feature failed the trigger chain logic for chain with DecisionID id **/ - std::vector<const Decision*> getRejectedDecisionNodes(asg::EventStoreType* eventStore, const DecisionID id = 0); + std::vector<const Decision*> getRejectedDecisionNodes(asg::EventStoreType* eventStore, const DecisionIDContainer ids = {}); @@ -268,14 +268,14 @@ namespace TrigCompositeUtils { * @brief Search back in time from "node" and locate all paths back through Decision objects for a given chain. * @param[in] node The Decision object to start the search from. Typically this will be one of the terminus objects from the HLTNav_Summary. * @param[inout] navPaths Holds a sub-graph of the full navigation graph, filtered by DecisionID. An already partially populated graph may be provided as input. - * @param[in] id Optional DecisionID of a Chain to trace through the navigation. If omitted, no chain requirement will be applied. + * @param[in] ids Optional DecisionIDContainer of Chains / Chain-Legs to trace through the navigation. If omitted, no chain requirement will be applied. * @param[in] enforceDecisionOnStartNode If the check of DecisionID should be carried out on the start node. * enforceDecisionOnStartNode should be true if navigating for a trigger which passed (e.g. starting from HLTPassRaw) * enforceDecisionOnStartNode should be false if navigating for a trigger which failed but whose failing start node(s) were recovered via getRejectedDecisionNodes **/ void recursiveGetDecisions(const Decision* node, NavGraph& navGraph, - const DecisionID id = 0, + const DecisionIDContainer ids = {}, const bool enforceDecisionOnStartNode = true); @@ -287,7 +287,7 @@ namespace TrigCompositeUtils { void recursiveGetDecisionsInternal(const Decision* node, const Decision* comingFrom, NavGraph& navGraph, - const DecisionID id, + const DecisionIDContainer ids, const bool enforceDecisionOnNode); /** diff --git a/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx b/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx index 5a802279448..0a2b450c920 100644 --- a/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx +++ b/Trigger/TrigSteer/TrigCompositeUtils/test/TrigTraversal_test.cxx @@ -331,11 +331,11 @@ int main ATLAS_NOT_THREAD_SAFE () { NavGraph graph_HLT_em_chain; NavGraph graph_HLT_all; - recursiveGetDecisions(END, graph_HLT_mufast_chain, HLT_mufast_chain, true); - recursiveGetDecisions(END, graph_HLT_mu_chain, HLT_mu_chain, true); - recursiveGetDecisions(END, graph_HLT_mu_em_chain, HLT_mu_em_chain, true); - recursiveGetDecisions(END, graph_HLT_em_chain, HLT_em_chain, true); - recursiveGetDecisions(END, graph_HLT_all, 0, true); + recursiveGetDecisions(END, graph_HLT_mufast_chain, {HLT_mufast_chain}, true); + recursiveGetDecisions(END, graph_HLT_mu_chain, {HLT_mu_chain}, true); + recursiveGetDecisions(END, graph_HLT_mu_em_chain, {HLT_mu_em_chain}, true); + recursiveGetDecisions(END, graph_HLT_em_chain, {HLT_em_chain}, true); + recursiveGetDecisions(END, graph_HLT_all, {}, true); log << MSG::INFO << "HLT_mufast_chain" << endmsg; @@ -375,26 +375,26 @@ int main ATLAS_NOT_THREAD_SAFE () { std::cout << " ---------- Now Include Failing Features " << std::endl; - std::vector<const Decision*> extraStart_HLT_mufast_chain = getRejectedDecisionNodes(pSG, HLT_mufast_chain); - std::vector<const Decision*> extraStart_HLT_mu_chain = getRejectedDecisionNodes(pSG, HLT_mu_chain); - std::vector<const Decision*> extraStart_HLT_mu_em_chain = getRejectedDecisionNodes(pSG, HLT_mu_em_chain); - std::vector<const Decision*> extraStart_HLT_em_chain = getRejectedDecisionNodes(pSG, HLT_em_chain); - std::vector<const Decision*> extraStart_HLT_all = getRejectedDecisionNodes(pSG, 0); + std::vector<const Decision*> extraStart_HLT_mufast_chain = getRejectedDecisionNodes(pSG, {HLT_mufast_chain}); + std::vector<const Decision*> extraStart_HLT_mu_chain = getRejectedDecisionNodes(pSG, {HLT_mu_chain}); + std::vector<const Decision*> extraStart_HLT_mu_em_chain = getRejectedDecisionNodes(pSG, {HLT_mu_em_chain}); + std::vector<const Decision*> extraStart_HLT_em_chain = getRejectedDecisionNodes(pSG, {HLT_em_chain}); + std::vector<const Decision*> extraStart_HLT_all = getRejectedDecisionNodes(pSG, {}); for (const Decision* d : extraStart_HLT_mufast_chain) { - recursiveGetDecisions(d, graph_HLT_mufast_chain, HLT_mufast_chain, false); + recursiveGetDecisions(d, graph_HLT_mufast_chain, {HLT_mufast_chain}, false); } for (const Decision* d : extraStart_HLT_mu_chain) { - recursiveGetDecisions(d, graph_HLT_mu_chain, HLT_mu_chain, false); + recursiveGetDecisions(d, graph_HLT_mu_chain, {HLT_mu_chain}, false); } for (const Decision* d : extraStart_HLT_mu_em_chain) { - recursiveGetDecisions(d, graph_HLT_mu_em_chain, HLT_mu_em_chain, false); + recursiveGetDecisions(d, graph_HLT_mu_em_chain, {HLT_mu_em_chain}, false); } for (const Decision* d : extraStart_HLT_em_chain) { - recursiveGetDecisions(d, graph_HLT_em_chain, HLT_em_chain, false); + recursiveGetDecisions(d, graph_HLT_em_chain, {HLT_em_chain}, false); } for (const Decision* d : extraStart_HLT_all) { - recursiveGetDecisions(d, graph_HLT_all, 0, false); + recursiveGetDecisions(d, graph_HLT_all, {}, false); } log << MSG::INFO << "HLT_mufast_chain" << endmsg; diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py index 066e6eaa34f..d341f13a8c4 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py @@ -427,6 +427,8 @@ def triggerPOOLOutputCfg(flags, edmSet): menuwriter = CompFactory.getComp("TrigConf::xAODMenuWriterMT")() menuwriter.IsHLTJSONConfig = True menuwriter.IsL1JSONConfig = True + menuwriter.WritexAODTriggerMenu = True # This should be removed in the future + menuwriter.WritexAODTriggerMenuJson = True menuwriter.KeyWriterTool = CompFactory.getComp('TrigConf::KeyWriterTool')('KeyWriterToolOffline') acc.addEventAlgo( menuwriter ) @@ -436,7 +438,11 @@ def triggerPOOLOutputCfg(flags, edmSet): acc.merge( L1PrescaleCondAlgCfg( flags ) ) # Add metadata to the output stream - streamAlg.MetadataItemList += [ "xAOD::TriggerMenuContainer#*", "xAOD::TriggerMenuAuxContainer#*" ] + if menuwriter.WritexAODTriggerMenu: + streamAlg.MetadataItemList += [ "xAOD::TriggerMenuContainer#*", "xAOD::TriggerMenuAuxContainer#*" ] + + if menuwriter.WritexAODTriggerMenuJson: + streamAlg.MetadataItemList += [ "xAOD::TriggerMenuJsonContainer#*", "xAOD::TriggerMenuJsonAuxContainer#*" ] # Ensure OutputStream runs after TrigDecisionMakerMT and xAODMenuWriterMT streamAlg.ExtraInputs += [ diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py index f72402cdecb..70001805428 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigGetter.py @@ -476,16 +476,16 @@ class TriggerConfigGetter(Configured): objKeyStore.addManyTypesMetaData( metadataItems ) if writeMenuJSON: - metadataItems = [ "xAOD::TriggerMenuJSONContainer#MenuJSON_HLT", - "xAOD::TriggerMenuJSONAuxContainer#MenuJSON_HLTAux.", - "xAOD::TriggerMenuJSONContainer#MenuJSON_L1", - "xAOD::TriggerMenuJSONAuxContainer#MenuJSON_L1Aux.", - "xAOD::TriggerMenuJSONContainer#MenuJSON_HLTPS", - "xAOD::TriggerMenuJSONAuxContainer#MenuJSON_HLTPSAux.", - "xAOD::TriggerMenuJSONContainer#MenuJSON_L1PS", - "xAOD::TriggerMenuJSONAuxContainer#MenuJSON_L1PSAux.", - # "xAOD::TriggerMenuJSONContainer#MenuJSON_BG", // TODO - # "xAOD::TriggerMenuJSONAuxContainer#MenuJSON_BGAux.", // TODO + metadataItems = [ "xAOD::TriggerMenuJsonContainer#MenuJSON_HLT", + "xAOD::TriggerMenuJsonAuxContainer#MenuJSON_HLTAux.", + "xAOD::TriggerMenuJsonContainer#MenuJSON_L1", + "xAOD::TriggerMenuJsonAuxContainer#MenuJSON_L1Aux.", + "xAOD::TriggerMenuJsonContainer#MenuJSON_HLTPS", + "xAOD::TriggerMenuJsonAuxContainer#MenuJSON_HLTPSAux.", + "xAOD::TriggerMenuJsonContainer#MenuJSON_L1PS", + "xAOD::TriggerMenuJsonAuxContainer#MenuJSON_L1PSAux.", + # "xAOD::TriggerMenuJsonContainer#MenuJSON_BG", // TODO + # "xAOD::TriggerMenuJsonAuxContainer#MenuJSON_BGAux.", // TODO ] objKeyStore.addManyTypesMetaData( metadataItems ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py index 974b487c5df..683afef4730 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTMenuJSON.py @@ -102,6 +102,7 @@ def __generateJSON( chainDicts, chainConfigs, HLTAllSteps, menuName, fileName ): menuDict["chains"][chainName] = odict([ ("counter", chain["chainCounter"]), ("nameHash", chain["chainNameHash"]), + ("legMultiplicities", chain["chainMultiplicities"]), ("l1item", chain["L1item"]), ("l1thresholds", l1Thresholds), ("groups", chain["groups"]), -- GitLab