Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SegmentViewAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "SegmentViewAlg.h"
6 namespace MuonR4 {
7 
9  ATH_CHECK(m_readKeys.initialize());
11  if (m_readKeys.empty()) {
12  ATH_MSG_FATAL("Please configure at least one read key");
13  return StatusCode::FAILURE;
14  }
15 
16  return StatusCode::SUCCESS;
17  }
18  StatusCode SegmentViewAlg::execute(const EventContext& ctx) const {
19 
22  const xAOD::MuonSegmentContainer* segCont{nullptr};
23  ATH_CHECK(SG::get(segCont, key, ctx));
24  viewCont.insert(viewCont.end(), segCont->begin(), segCont->end());
25  }
26  SG::WriteHandle writeHandle{m_writeKey, ctx};
27  ATH_CHECK(writeHandle.record(std::make_unique<xAOD::MuonSegmentContainer>(*viewCont.asDataVector())));
28  return StatusCode::SUCCESS;
29  }
30 }
MuonR4::SegmentViewAlg::m_readKeys
SG::ReadHandleKeyArray< xAOD::MuonSegmentContainer > m_readKeys
Definition: SegmentViewAlg.h:19
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SegmentViewAlg.h
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::ReadHandleKey< xAOD::MuonSegmentContainer >
MuonR4::SegmentViewAlg::execute
StatusCode execute(const EventContext &ctx) const override final
Definition: SegmentViewAlg.cxx:18
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
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
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
MuonR4::SegmentViewAlg::initialize
StatusCode initialize() override final
Definition: SegmentViewAlg.cxx:8
MuonR4::SegmentViewAlg::m_writeKey
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_writeKey
Definition: SegmentViewAlg.h:20
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37