ATLAS Offline Software
Loading...
Searching...
No Matches
ForwardEventInfoCnvAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 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):
17
18namespace xAODMaker
19{
20
22 ISvcLocator *svcLoc)
23 : AthReentrantAlgorithm(name, svcLoc) {}
24
26 {
27
28 ATH_CHECK(m_inputKey.initialize());
29 ATH_CHECK(m_outputKey.initialize());
30 ATH_CHECK(m_cnvTool.retrieve());
31
32 // Return gracefully:
33 return StatusCode::SUCCESS;
34 }
35
36 StatusCode ForwardEventInfoCnvAlg::execute(const EventContext &ctx) const
37 {
38
39 auto mbtsCollisionsTimeHandle = SG::makeHandle(m_inputKey, ctx);
40 ATH_MSG_INFO("Retrieved particles with key: " << m_inputKey.key());
41
42 auto fwdEventInfo = std::make_unique<xAOD::ForwardEventInfoContainer>();
43 auto fwdEventInfoAux = std::make_unique<xAOD::ForwardEventInfoAuxContainer>();
44 fwdEventInfo->setStore(fwdEventInfoAux.get());
45
46 ATH_CHECK(m_cnvTool->convert(mbtsCollisionsTimeHandle.ptr(), fwdEventInfo.get()));
47
48 auto fwdEventInfoHandle = SG::makeHandle(m_outputKey, ctx);
49 ATH_CHECK(fwdEventInfoHandle.record(std::move(fwdEventInfo), std::move(fwdEventInfoAux)));
50 return StatusCode::SUCCESS;
51 }
52
53} // namespace xAODMaker
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Helpers for checking error return status codes and reporting errors.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< MBTSCollisionTime > m_inputKey
virtual StatusCode initialize() override
Function initialising the algorithm.
ToolHandle< IForwardEventInfoCnvTool > m_cnvTool
ForwardEventInfoCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
SG::WriteHandleKey< xAOD::ForwardEventInfoContainer > m_outputKey
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())