ATLAS Offline Software
MdtMeasViewAlg.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #include "MdtMeasViewAlg.h"
7 
8 #include <StoreGate/ReadHandle.h>
11 
12 namespace MuonR4 {
14  ATH_CHECK(m_readKey1D.initialize());
15  ATH_CHECK(m_readKey2D.initialize());
16  ATH_CHECK(m_writeKey.initialize());
17  return StatusCode::SUCCESS;
18  }
19  StatusCode MdtMeasViewAlg::execute(const EventContext& ctx) const {
20 
21  SG::ReadHandle driftCircles{m_readKey1D, ctx};
22  ATH_CHECK(driftCircles.isPresent());
23  SG::ReadHandle twinCircles{m_readKey2D, ctx};
24  ATH_CHECK(twinCircles.isPresent());
25 
27  outContainer.insert(outContainer.end(), driftCircles->begin(), driftCircles->end());
28  outContainer.insert(outContainer.end(), twinCircles->begin(), twinCircles->end());
29 
30  SG::WriteHandle writeHandle{m_writeKey, ctx};
31  ATH_CHECK(writeHandle.record(std::make_unique<xAOD::MdtDriftCircleContainer>(*outContainer.asDataVector())));
32  return StatusCode::SUCCESS;
33  }
34 }
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
MuonR4::MdtMeasViewAlg::m_readKey1D
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_readKey1D
Definition: MdtMeasViewAlg.h:31
MuonR4::MdtMeasViewAlg::m_readKey2D
SG::ReadHandleKey< xAOD::MdtTwinDriftCircleContainer > m_readKey2D
Definition: MdtMeasViewAlg.h:34
MuonR4::MdtMeasViewAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MdtMeasViewAlg.cxx:19
WriteHandle.h
Handle class for recording to StoreGate.
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
MuonR4::MdtMeasViewAlg::initialize
StatusCode initialize() override
Definition: MdtMeasViewAlg.cxx:13
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
MuonR4::MdtMeasViewAlg::m_writeKey
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_writeKey
Definition: MdtMeasViewAlg.h:37
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
MdtMeasViewAlg.h
ReadHandle.h
Handle class for reading from StoreGate.