ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerSummaryAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "Gaudi/Property.h"
6#include "TriggerSummaryAlg.h"
8
9TriggerSummaryAlg::TriggerSummaryAlg( const std::string& name,
10 ISvcLocator* pSvcLocator ) :
11 ::AthReentrantAlgorithm( name, pSvcLocator ) {}
12
15
17{
18
19 ATH_CHECK( m_inputDecisionKey.initialize() );
20
22 ATH_CHECK( m_finalDecisionKeys.initialize() );
23
24 ATH_MSG_DEBUG("Will consume implicit decisions:" );
25 for (auto& input: m_finalDecisionKeys){
26 ATH_MSG_DEBUG( " "<<input.key() );
27 }
28
29 ATH_CHECK( m_startStampKey.initialize() );
30
31 ATH_CHECK( m_outputTools.retrieve() );
32
33 if ( !m_monTool.empty() ) ATH_CHECK( m_monTool.retrieve() );
34
35 return StatusCode::SUCCESS;
36}
37
38StatusCode TriggerSummaryAlg::execute(const EventContext& context) const
39{
40
41 // that is certain input
42 auto l1DecisionHandle = SG::makeHandle( m_inputDecisionKey, context );
43 auto inputHandles( m_finalDecisionKeys.makeHandles(context) );
45 for ( auto input: inputHandles ) {
46 if ( input.isValid() ) {
47 for ( auto decisionObject: *input ) {
48 TrigCompositeUtils::decisionIDs( decisionObject, allPassingIDs );
49 }
50 ATH_MSG_DEBUG( "Found "<<input->size()<<" Decisions for " << input.key() );
51 } else {
52 ATH_MSG_DEBUG( "Missing decisions for " << input.key() << " which may be perfectly correct" );
53 }
54 }
55
56 if ( msgLvl( MSG::DEBUG ) ){
57 ATH_MSG_DEBUG( "In summary " << allPassingIDs.size() << " chains passed:" );
58 for ( TrigCompositeUtils::DecisionID id : allPassingIDs ) {
59 ATH_MSG_DEBUG( " +++ " << HLT::Identifier( id ) );
60 }
61 }
62
63 for ( auto& tool: m_outputTools ) {
64 ATH_CHECK( tool->createOutput( context ) );
65 }
66
67 auto timeStampHandle = SG::makeHandle( m_startStampKey, context );
68 ATH_MSG_DEBUG( "Time since the start of L1 decoding " << timeStampHandle.cptr()->millisecondsSince() << " ms" );
69 Monitored::Group ( m_monTool, Monitored::Scalar("TIME_SinceEventStart", timeStampHandle.cptr()->millisecondsSince() ) );
70
71 return StatusCode::SUCCESS;
72}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Header file to be included by clients of the Monitored infrastructure.
virtual std::vector< Gaudi::DataHandle * > inputHandles() const override
void renounceArray(SG::VarHandleKeyArray &handlesArray)
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual StatusCode execute(const EventContext &context) const override
TriggerSummaryAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandleArray< IHLTOutputTool > m_outputTools
SG::ReadHandleKey< TrigTimeStamp > m_startStampKey
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_finalDecisionKeys
virtual StatusCode initialize() override
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_inputDecisionKey
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
unsigned int DecisionID
std::set< DecisionID > DecisionIDContainer
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.