diff --git a/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx b/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx index 927ef44ef3e64bbf086dc1d68ea85c42e3d2756b..d409eb5b4c240b4de37c14346916f2f30ef74d71 100644 --- a/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx +++ b/Trigger/TrigSteer/TrigOutputHandling/src/DecisionSummaryMakerAlg.cxx @@ -21,9 +21,9 @@ StatusCode DecisionSummaryMakerAlg::initialize() { ATH_MSG_DEBUG( "Final decision of the chain " << conf.chain << " will be read from " << conf.collection ); } + ATH_CHECK( m_costWriteHandleKey.initialize( m_doCostMonitoring ) ); if (m_doCostMonitoring) { - CHECK( m_trigCostSvcHandle.retrieve() ); - CHECK( m_costWriteHandleKey.initialize() ); + ATH_CHECK( m_trigCostSvcHandle.retrieve() ); } return StatusCode::SUCCESS; @@ -144,6 +144,10 @@ StatusCode DecisionSummaryMakerAlg::execute(const EventContext& context) const { ATH_CHECK(m_trigCostSvcHandle->endEvent(context, costMonOutput)); } + // Set the algorithm's filter status. This controlls the running of finalisation algs which we only want to execute + // in events which are accepted by one ore more chains. + setFilterPassed( allPassingFinalIDs.size() > 0, context ); + return StatusCode::SUCCESS; } diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py index 3ae064851871ea9575a423251e50ea2285efdb77..e1378a67088129ca74ca5403f17f64734532760c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py @@ -139,6 +139,11 @@ def makeHLTTree(newJO=False, triggerConfigHLT = None): hltEndSeq = parOR("HLTEndSeq") hltTop += hltEndSeq + hltFinalizeSeq = seqAND("HLTFinalizeSeq") + + # TODO - this is not currently used, but can host any algs which need to run conditional on the HLT accepting the event + hltAcceptedEventAlgsSeq = parOR("HLTAcceptedEventAlgsSeq") + # make DF and CF tree from chains finalDecisions = decisionTreeFromChains(steps, triggerConfigHLT.configsList(), triggerConfigHLT.dictsList(), newJO) @@ -157,26 +162,38 @@ def makeHLTTree(newJO=False, triggerConfigHLT = None): from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable, appendCAtoAthena + # Collections required to configure the algs below hypos = collectHypos(steps) filters = collectFilters(steps) viewMakers = collectViewMakers(steps) + Configurable.configurableRun3Behavior=1 summaryAcc, summaryAlg = triggerSummaryCfg( ConfigFlags, hypos ) Configurable.configurableRun3Behavior=0 - hltEndSeq += conf2toConfigurable( summaryAlg ) + # A) First we check if any chain accepted the event + hltFinalizeSeq += conf2toConfigurable( summaryAlg ) appendCAtoAthena( summaryAcc ) + + # B) Then (if true), we run the accepted event algorithms. + hltFinalizeSeq += hltAcceptedEventAlgsSeq + + # More collections required to configure the algs below decObj = collectDecisionObjects( hypos, filters, l1decoder[0], summaryAlg ) decObjHypoOut = collectHypoDecisionObjects(hypos, inputs=False, outputs=True) + Configurable.configurableRun3Behavior=1 monAcc, monAlg = triggerMonitoringCfg( ConfigFlags, hypos, filters, l1decoder[0] ) - edmAlg = triggerMergeViewsAndAddMissingEDMCfg(['AOD', 'ESD'], hypos, viewMakers, decObj, decObjHypoOut) Configurable.configurableRun3Behavior=0 hltEndSeq += conf2toConfigurable( monAlg ) appendCAtoAthena( monAcc ) - # this is a shotcut for now, we always assume we may be writing ESD & AOD outputs, so all gaps will be filled + Configurable.configurableRun3Behavior=1 + edmAlg = triggerMergeViewsAndAddMissingEDMCfg(['AOD', 'ESD'], hypos, viewMakers, decObj, decObjHypoOut) + Configurable.configurableRun3Behavior=0 + # C) Finally, we create the EDM output + hltFinalizeSeq += conf2toConfigurable(edmAlg) - hltEndSeq += conf2toConfigurable(edmAlg) + hltEndSeq += hltFinalizeSeq # Test the configuration from TriggerMenuMT.HLTMenuConfig.Menu.CFValidation import testHLTTree