ATLAS Offline Software
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):
9 #include "TrigNavigationCnvAlg.h"
10 
11 using 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 
23  CHECK( m_xaodKey.initialize() );
24 
25  CHECK( m_cnvTool.retrieve() );
26 
27  return StatusCode::SUCCESS;
28 }
29 
30 StatusCode 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 
xAODMaker
Definition: StoreGateSvc.h:72
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
xAODMaker::TrigNavigationCnvAlg::TrigNavigationCnvAlg
TrigNavigationCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: TrigNavigationCnvAlg.cxx:13
xAODMaker::TrigNavigationCnvAlg::m_xaodKey
SG::WriteHandleKey< xAOD::TrigNavigation > m_xaodKey
StoreGate key for the output object.
Definition: TrigNavigationCnvAlg.h:53
TrigNavigationCnvAlg.h
SG::AuxElement::setStore
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
Definition: AuxElement.cxx:221
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
xAODMaker::TrigNavigationCnvAlg::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition: TrigNavigationCnvAlg.cxx:18
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
xAODMaker::TrigNavigationCnvAlg::m_cnvTool
ToolHandle< ITrigNavigationCnvTool > m_cnvTool
Definition: TrigNavigationCnvAlg.h:55
xAODMaker::TrigNavigationCnvAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition: TrigNavigationCnvAlg.cxx:30
xAODMaker::TrigNavigationCnvAlg::m_aodKey
SG::ReadHandleKey< HLT::HLTResult > m_aodKey
StoreGate key of the input object.
Definition: TrigNavigationCnvAlg.h:50