ATLAS Offline Software
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 
10  ISvcLocator* pSvcLocator ) :
11  ::AthReentrantAlgorithm( name, pSvcLocator ) {}
12 
14 {}
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 
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 
38 StatusCode 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 }
TriggerSummaryAlg::m_finalDecisionKeys
SG::ReadHandleKeyArray< TrigCompositeUtils::DecisionContainer > m_finalDecisionKeys
Definition: TriggerSummaryAlg.h:38
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
TriggerSummaryAlg::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: TriggerSummaryAlg.cxx:38
TriggerSummaryAlg::TriggerSummaryAlg
TriggerSummaryAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TriggerSummaryAlg.cxx:9
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
Definition: AthCommonDataStore.h:364
TriggerSummaryAlg::~TriggerSummaryAlg
virtual ~TriggerSummaryAlg()
Definition: TriggerSummaryAlg.cxx:13
TriggerSummaryAlg::m_outputTools
ToolHandleArray< IHLTOutputTool > m_outputTools
Definition: TriggerSummaryAlg.h:48
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles
virtual std::vector< Gaudi::DataHandle * > inputHandles() const override
Return this algorithm's input handles.
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TriggerSummaryAlg::m_startStampKey
SG::ReadHandleKey< TrigTimeStamp > m_startStampKey
Definition: TriggerSummaryAlg.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TriggerSummaryAlg::initialize
virtual StatusCode initialize() override
Definition: TriggerSummaryAlg.cxx:16
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
TriggerSummaryAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TriggerSummaryAlg.h:50
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TriggerSummaryAlg.h
TriggerSummaryAlg::m_inputDecisionKey
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_inputDecisionKey
Definition: TriggerSummaryAlg.h:35