ATLAS Offline Software
Loading...
Searching...
No Matches
MBTSModuleCnvAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Gaudi/Athena include(s):
7
8// Old mbts (tile) info!
10
11//New egamma
14
15// Local include(s):
16#include "MBTSModuleCnvAlg.h"
17
18namespace xAODMaker
19{
20
21 MBTSModuleCnvAlg::MBTSModuleCnvAlg(const std::string &name,
22 ISvcLocator *svcLoc)
23 : AthReentrantAlgorithm(name, svcLoc) {}
24
26 {
27 ATH_CHECK(m_inputKey.initialize());
28 ATH_CHECK(m_outputKey.initialize());
29 ATH_CHECK(m_cnvTool.retrieve());
30 return StatusCode::SUCCESS;
31 }
32
33 StatusCode MBTSModuleCnvAlg::execute(const EventContext &ctx) const
34 {
35
36 auto tileCellsHandle = SG::makeHandle(m_inputKey, ctx);
37 ATH_CHECK(tileCellsHandle.isValid()); // technically not needed
38 ATH_MSG_DEBUG("Retrieved tile cells with key: " << m_inputKey.key() << " of size " << tileCellsHandle->size());
39
40 auto modulesContainer = std::make_unique<xAOD::MBTSModuleContainer>();
41 auto modulesAuxContainer = std::make_unique<xAOD::MBTSModuleAuxContainer>();
42 modulesContainer->setStore(modulesAuxContainer.get());
43
44 ATH_CHECK(m_cnvTool->convert(tileCellsHandle.ptr(), modulesContainer.get()));
45
46 auto modulesHandle = SG::makeHandle(m_outputKey, ctx);
47 ATH_MSG_DEBUG("Recorded xAODMBTSModules with key: " << m_outputKey.key() << " of size " << modulesContainer->size());
48 ATH_CHECK(modulesHandle.record(std::move(modulesContainer), std::move(modulesAuxContainer)));
49
50 return StatusCode::SUCCESS;
51 }
52}
#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.
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< xAOD::MBTSModuleContainer > m_outputKey
ToolHandle< IMBTSModuleCnvTool > m_cnvTool
Handle to the converter tool.
MBTSModuleCnvAlg(const std::string &name, ISvcLocator *svcLoc)
SG::ReadHandleKey< TileCellContainer > m_inputKey
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())