ATLAS Offline Software
MuonInDetExtensionMergerAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
6 MuonInDetExtensionMergerAlg::MuonInDetExtensionMergerAlg(const std::string& name, ISvcLocator* pSvcLocator) :
7  AthReentrantAlgorithm(name, pSvcLocator) {}
8 
10  ATH_CHECK(m_inputCandidates.initialize());
11  ATH_CHECK(m_writeKey.initialize());
12  return StatusCode::SUCCESS;
13 }
14 
15 StatusCode MuonInDetExtensionMergerAlg::execute(const EventContext& ctx) const {
19  if (!readHandle.isValid()) {
20  ATH_MSG_FATAL("Failed to retrieve InDetCandidates from storegate "<<key.fullKey());
21  return StatusCode::FAILURE;
22  }
23  merged.insert(merged.end(), readHandle->begin(), readHandle->end());
24  }
25  std::unique_ptr<InDetCandidateCollection> output_coll = std::make_unique<InDetCandidateCollection>(*merged.asDataVector());
27  ATH_CHECK(writeHandle.record(std::move(output_coll)));
28  return StatusCode::SUCCESS;
29 }
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonInDetExtensionMergerAlg::m_writeKey
SG::WriteHandleKey< InDetCandidateCollection > m_writeKey
Output Key.
Definition: MuonInDetExtensionMergerAlg.h:28
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
MuonInDetExtensionMergerAlg::m_inputCandidates
SG::ReadHandleKeyArray< InDetCandidateCollection > m_inputCandidates
Definition: MuonInDetExtensionMergerAlg.h:26
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonInDetExtensionMergerAlg.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonInDetExtensionMergerAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MuonInDetExtensionMergerAlg.cxx:15
MuonInDetExtensionMergerAlg::MuonInDetExtensionMergerAlg
MuonInDetExtensionMergerAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonInDetExtensionMergerAlg.cxx:6
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonInDetExtensionMergerAlg::initialize
StatusCode initialize() override
Definition: MuonInDetExtensionMergerAlg.cxx:9
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37