ATLAS Offline Software
Loading...
Searching...
No Matches
MdtMeasViewAlg.cxx
Go to the documentation of this file.
1
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4*/
5
6#include "MdtMeasViewAlg.h"
7
10
11#include <ranges>
12
13namespace MuonR4 {
15 ATH_CHECK(m_readKey1D.initialize());
16 ATH_CHECK(m_readKey2D.initialize());
17 ATH_CHECK(m_writeKey.initialize());
18 return StatusCode::SUCCESS;
19 }
20 StatusCode MdtMeasViewAlg::execute(const EventContext& ctx) const {
21 const xAOD::MdtDriftCircleContainer* driftCircles{nullptr};
22 const xAOD::MdtTwinDriftCircleContainer* twinCircles{nullptr};
23
24 ATH_CHECK(SG::get(driftCircles, m_readKey1D, ctx));
25 ATH_CHECK(SG::get(twinCircles, m_readKey2D, ctx));
26
28 outContainer.reserve(driftCircles->size() + twinCircles->size());
29 std::merge(driftCircles->begin(), driftCircles->end(), twinCircles->begin(), twinCircles->end(),
30 std::back_inserter(outContainer),
32 return a->identifierHash() < b->identifierHash();
33 });
34
35 SG::WriteHandle writeHandle{m_writeKey, ctx};
36 ATH_CHECK(writeHandle.record(std::make_unique<xAOD::MdtDriftCircleContainer>(*outContainer.asDataVector())));
37 return StatusCode::SUCCESS;
38 }
39}
#define ATH_CHECK
Evaluate an expression and check for errors.
DataVector adapter that acts like it holds const pointers.
static Double_t a
Handle class for recording to StoreGate.
DataVector adapter that acts like it holds const pointers.
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.
size_type size() const noexcept
Returns the number of elements in 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.
MdtDriftCircle_v1 MdtDriftCircle
MdtTwinDriftCircleContainer_v1 MdtTwinDriftCircleContainer
MdtDriftCircleContainer_v1 MdtDriftCircleContainer