ATLAS Offline Software
MuonSpectrometer
MuonPhaseII
MuonCnv
xAODMuonViewAlgs
src
MdtMeasViewAlg.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
#include "
MdtMeasViewAlg.h
"
7
8
#include <
StoreGate/ReadHandle.h
>
9
#include <
StoreGate/WriteHandle.h
>
10
#include <
AthContainers/ConstDataVector.h
>
11
12
namespace
MuonR4
{
13
StatusCode
MdtMeasViewAlg::initialize
() {
14
ATH_CHECK
(
m_readKey1D
.initialize());
15
ATH_CHECK
(
m_readKey2D
.initialize());
16
ATH_CHECK
(
m_writeKey
.initialize());
17
return
StatusCode::SUCCESS;
18
}
19
StatusCode
MdtMeasViewAlg::execute
(
const
EventContext& ctx)
const
{
20
21
SG::ReadHandle
driftCircles{
m_readKey1D
, ctx};
22
ATH_CHECK
(driftCircles.isPresent());
23
SG::ReadHandle
twinCircles{
m_readKey2D
, ctx};
24
ATH_CHECK
(twinCircles.isPresent());
25
26
ConstDataVector<xAOD::MdtDriftCircleContainer>
outContainer{
SG::VIEW_ELEMENTS
};
27
outContainer.insert(outContainer.end(), driftCircles->begin(), driftCircles->end());
28
outContainer.insert(outContainer.end(), twinCircles->begin(), twinCircles->end());
29
30
SG::WriteHandle
writeHandle{
m_writeKey
, ctx};
31
ATH_CHECK
(writeHandle.record(std::make_unique<xAOD::MdtDriftCircleContainer>(*outContainer.asDataVector())));
32
return
StatusCode::SUCCESS;
33
}
34
}
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::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:70
MuonR4::MdtMeasViewAlg::m_readKey1D
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_readKey1D
Definition:
MdtMeasViewAlg.h:31
MuonR4::MdtMeasViewAlg::m_readKey2D
SG::ReadHandleKey< xAOD::MdtTwinDriftCircleContainer > m_readKey2D
Definition:
MdtMeasViewAlg.h:34
MuonR4::MdtMeasViewAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition:
MdtMeasViewAlg.cxx:19
WriteHandle.h
Handle class for recording to StoreGate.
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
MuonR4::MdtMeasViewAlg::initialize
StatusCode initialize() override
Definition:
MdtMeasViewAlg.cxx:13
MuonR4
This header ties the generic definitions in this package.
Definition:
HoughEventData.h:16
SG::WriteHandle
Definition:
StoreGate/StoreGate/WriteHandle.h:76
MuonR4::MdtMeasViewAlg::m_writeKey
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_writeKey
Definition:
MdtMeasViewAlg.h:37
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition:
ConstDataVector.h:76
MdtMeasViewAlg.h
ReadHandle.h
Handle class for reading from StoreGate.
Generated on Tue Dec 24 2024 21:14:17 for ATLAS Offline Software by
1.8.18