ATLAS Offline Software
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 
21 TrigMatchTool::TrigMatchTool( const std::string& type,
22  const std::string& name,
23  const IInterface* 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 
61 std::vector<std::string>
63 {
64  if (!m_trigDecisionTool) {
65  return std::vector<std::string>();
66  }
67  return m_trigDecisionTool->getListOfTriggers();
68 }
69 
70 std::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
81 void TrigMatchTool::handle( const Incident &inc ) {
82 
83  if (inc.type() == "EndEvent") {
84  this->endEvent();
85  }
86 }
TrigMatchTool::initialize
virtual StatusCode initialize() override
Definition: TrigMatchTool.cxx:38
TrigMatchToolCore::setTDT
void setTDT(Trig::TrigDecisionToolCore *tdt)
Definition: TrigMatchToolCore.h:387
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigConf::HLTChain::lower_chain_name
const std::string & lower_chain_name() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:77
TrigMatchTool::lowerChainName
virtual std::string lowerChainName(const std::string &chainName) const override
Definition: TrigMatchTool.cxx:70
TrigConf::HLTChain
HLT chain configuration information.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:35
TrigMatchTool::handle
virtual void handle(const Incident &inc) override
Definition: TrigMatchTool.cxx:81
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TrigMatchToolCore::endEvent
virtual void endEvent()
Definition: TrigMatchToolCore.cxx:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
errorcheck.h
Helpers for checking error return status codes and reporting errors.
TrigMatchTool::TrigMatchTool
TrigMatchTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigMatchTool.cxx:21
TrigMatchTool::getConfiguredChainNames
virtual std::vector< std::string > getConfiguredChainNames() const override
Definition: TrigMatchTool.cxx:62
TrigMatchTool::m_trigDecisionTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
Definition: TrigMatchTool.h:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
AthAlgTool
Definition: AthAlgTool.h:26
TrigMatchTool.h
ServiceHandle< IIncidentSvc >