ATLAS Offline Software
Loading...
Searching...
No Matches
MdtMeasViewAlg.cxx
Go to the documentation of this file.
1
2/*
3 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4*/
5
6#include "MdtMeasViewAlg.h"
7
10
11namespace MuonR4 {
13 ATH_CHECK(m_readKey1D.initialize());
14 ATH_CHECK(m_readKey2D.initialize());
15 ATH_CHECK(m_writeKey.initialize());
16 return StatusCode::SUCCESS;
17 }
18 StatusCode MdtMeasViewAlg::execute(const EventContext& ctx) const {
19 const xAOD::MdtDriftCircleContainer* driftCircles{nullptr};
20 const xAOD::MdtTwinDriftCircleContainer* twinCircles{nullptr};
21
22 ATH_CHECK(SG::get(driftCircles, m_readKey1D, ctx));
23 ATH_CHECK(SG::get(twinCircles, m_readKey2D, ctx));
24
26 outContainer.insert(outContainer.end(), driftCircles->begin(), driftCircles->end());
27 outContainer.insert(outContainer.end(), twinCircles->begin(), twinCircles->end());
28
29 SG::WriteHandle writeHandle{m_writeKey, ctx};
30 ATH_CHECK(writeHandle.record(std::make_unique<xAOD::MdtDriftCircleContainer>(*outContainer.asDataVector())));
31 return StatusCode::SUCCESS;
32 }
33}
#define ATH_CHECK
Evaluate an expression and check for errors.
DataVector adapter that acts like it holds const pointers.
Handle class for recording to StoreGate.
DataVector adapter that acts like it holds const pointers.
iterator end() noexcept
Return an iterator pointing past the end of the collection.
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
const DV * asDataVector() const
Return a pointer to this object, as a const DataVector.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
SG::ReadHandleKey< xAOD::MdtTwinDriftCircleContainer > m_readKey2D
StatusCode initialize() override
StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_writeKey
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_readKey1D
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
This header ties the generic definitions in this package.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MdtTwinDriftCircleContainer_v1 MdtTwinDriftCircleContainer
MdtDriftCircleContainer_v1 MdtDriftCircleContainer