ATLAS Offline Software
Loading...
Searching...
No Matches
RpcMeasViewAlg.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
7#include "RpcMeasViewAlg.h"
8
12
13namespace MuonR4{
15 ATH_CHECK(m_readKey1D.initialize());
16 ATH_CHECK(m_readKeyBI.initialize());
17 ATH_CHECK(m_writeKey.initialize());
18 return StatusCode::SUCCESS;
19 }
20
21 StatusCode RpcMeasViewAlg::execute(const EventContext& ctx) const {
22 const xAOD::RpcStripContainer* legacyStrips{nullptr};
23 const xAOD::RpcStrip2DContainer* bilStrips{nullptr};
24 ATH_CHECK(SG::get(legacyStrips, m_readKey1D, ctx));
25 ATH_CHECK(SG::get(bilStrips, m_readKeyBI, ctx));
26
28 if (legacyStrips) {
29 outContainer.insert(outContainer.end(), legacyStrips->begin(), legacyStrips->end());
30 }
31 if (bilStrips) {
32 outContainer.insert(outContainer.end(), bilStrips->begin(), bilStrips->end());
33 }
35 ATH_CHECK(writeHandle.record(std::make_unique<xAOD::RpcMeasurementContainer>(*outContainer.asDataVector())));
36 return StatusCode::SUCCESS;
37 }
38}
#define ATH_CHECK
Evaluate an expression and check for errors.
DataVector adapter that acts like it holds const pointers.
Handle class for reading from StoreGate.
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::RpcStrip2DContainer > m_readKeyBI
SG::ReadHandleKey< xAOD::RpcStripContainer > m_readKey1D
StatusCode initialize() override
StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< xAOD::RpcMeasurementContainer > m_writeKey
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.
RpcStripContainer_v1 RpcStripContainer
RpcStrip2DContainer_v1 RpcStrip2DContainer