ATLAS Offline Software
Loading...
Searching...
No Matches
TrigNavigationCnvAlg.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// Gaudi/Athena include(s):
7
8// Local include(s):
10
11using namespace xAODMaker;
12
14 ISvcLocator* svcLoc )
15 : AthReentrantAlgorithm( name, svcLoc ) {
16}
17
19 ATH_MSG_DEBUG( " AOD Key: " << m_aodKey );
20 ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey );
21
22 CHECK( m_aodKey.initialize() );
23 CHECK( m_xaodKey.initialize() );
24
25 CHECK( m_cnvTool.retrieve() );
26
27 return StatusCode::SUCCESS;
28}
29
30StatusCode TrigNavigationCnvAlg::execute(const EventContext& ctx) const {
31 auto aod = SG::makeHandle(m_aodKey, ctx);
32 ATH_CHECK( aod.isValid() );
33
34 std::unique_ptr<xAOD::TrigNavigationAuxInfo> aux = std::make_unique<xAOD::TrigNavigationAuxInfo>();
35 std::unique_ptr<xAOD::TrigNavigation> xaod = std::make_unique<xAOD::TrigNavigation>();
36 xaod->setStore(aux.get());
37
38 ATH_CHECK( m_cnvTool->convert( aod.cptr(), xaod.get() ) );
39 ATH_CHECK( SG::makeHandle(m_xaodKey, ctx).record( std::move(xaod), std::move(aux)) );
40
41 return StatusCode::SUCCESS;
42}
43
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< xAOD::TrigNavigation > m_xaodKey
StoreGate key for the output object.
SG::ReadHandleKey< HLT::HLTResult > m_aodKey
StoreGate key of the input object.
virtual StatusCode initialize() override
Function initialising the algorithm.
ToolHandle< ITrigNavigationCnvTool > m_cnvTool
TrigNavigationCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())