ATLAS Offline Software
Loading...
Searching...
No Matches
sTgcMeasViewAlg.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
7#include "sTgcMeasViewAlg.h"
8
11namespace MuonR4{
12
14 ATH_CHECK(m_readKeyStrip.initialize());
15 ATH_CHECK(m_readKeyWire.initialize());
16 ATH_CHECK(m_readKeyPad.initialize());
17 ATH_CHECK(m_writeKey.initialize());
18 return StatusCode::SUCCESS;
19 }
20
21 StatusCode sTgcMeasViewAlg::execute(const EventContext& ctx) const {
22 const xAOD::sTgcStripContainer* strips{nullptr};
23 const xAOD::sTgcWireContainer* wires{nullptr};
24 const xAOD::sTgcPadContainer* pads{nullptr};
25 ATH_CHECK(SG::get(strips, m_readKeyStrip, ctx));
26 ATH_CHECK(SG::get(wires, m_readKeyWire, ctx));
27 ATH_CHECK(SG::get(pads, m_readKeyPad, ctx));
28
30 if (strips) {
31 outContainer.insert(outContainer.end(), strips->begin(), strips->end());
32 }
33 if (wires) {
34 outContainer.insert(outContainer.end(),wires->begin(), wires->end());
35 }
36 if (pads){
37 outContainer.insert(outContainer.end(), pads->begin(), pads->end());
38 }
39 std::sort(outContainer.begin(), outContainer.end(),
41 return a->identifier() < b->identifier();
42 });
43
45 ATH_CHECK(writeHandle.record(std::make_unique<xAOD::sTgcMeasContainer>(*outContainer.asDataVector())));
46 return StatusCode::SUCCESS;
47 }
48
49}
#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.
iterator begin() noexcept
Return an iterator pointing at the beginning of the collection.
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::sTgcStripContainer > m_readKeyStrip
StatusCode initialize() override
SG::ReadHandleKey< xAOD::sTgcWireContainer > m_readKeyWire
SG::ReadHandleKey< xAOD::sTgcPadContainer > m_readKeyPad
StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< xAOD::sTgcMeasContainer > 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.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
sTgcStripContainer_v1 sTgcStripContainer
sTgcWireContainer_v1 sTgcWireContainer
sTgcPadContainer_v1 sTgcPadContainer
sTgcMeasurement_v1 sTgcMeasurement