ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMatchTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
6
7// Gaudi/Athena include(s):
8#include "GaudiKernel/Incident.h"
9#include "GaudiKernel/IIncidentSvc.h"
11
12// Local include(s):
14
15/**********************************************************************
16 *
17 * Constructors and destructors
18 *
19 **********************************************************************/
20
22 const std::string& name,
23 const IInterface* parent )
24 : AthAlgTool(type, name, parent),
25 m_trigDecisionTool( "Trig::TrigDecisionTool/TrigDecisionTool" ) {
26
27 declareInterface<TrigMatchTool>(this);
28
29 declareProperty( "TrigDecisionTool", m_trigDecisionTool );
30}
31
32/**********************************************************************
33 *
34 * Initialization and Finalization
35 *
36 **********************************************************************/
37
39
40 ATH_MSG_DEBUG( "TrigMatchTool::Intialize()" );
41
42 // load the required tool(s):
43 CHECK( m_trigDecisionTool.retrieve() );
44 ATH_MSG_INFO( "Successfully retrieved the TrigDecisionTool!" );
45 this->setTDT( &( *m_trigDecisionTool ) );
46
47 // register to hear end event incidents so we can clear
48 // the cache
49 ServiceHandle<IIncidentSvc> p_incSvc("IncidentSvc", this->name());
50 p_incSvc->addListener( this, "EndEvent" );
51
52 return StatusCode::SUCCESS;
53}
54
55/**********************************************************************
56 *
57 * Private functions
58 *
59 **********************************************************************/
60
61std::vector<std::string>
63{
64 if (!m_trigDecisionTool) {
65 return std::vector<std::string>();
66 }
67 return m_trigDecisionTool->getListOfTriggers();
68}
69
70std::string TrigMatchTool::lowerChainName( const std::string& chainName ) const {
71
72 const TrigConf::HLTChain *hltChain = m_trigDecisionTool->ExperimentalAndExpertMethods().getChainConfigurationDetails(chainName);
73 if( hltChain ) {
74 return hltChain->lower_chain_name();
75 }
76
77 return "";
78}
79
80// issue a clear at the beginning of each event
81void TrigMatchTool::handle( const Incident &inc ) {
82
83 if (inc.type() == "EndEvent") {
84 this->endEvent();
85 }
86}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
HLT chain configuration information.
const std::string & lower_chain_name() const
void setTDT(Trig::TrigDecisionToolCore *tdt)
virtual void endEvent()
virtual std::vector< std::string > getConfiguredChainNames() const override
virtual StatusCode initialize() override
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
TrigMatchTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual void handle(const Incident &inc) override
virtual std::string lowerChainName(const std::string &chainName) const override