ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataWrite
src
xAODTestWriteCView.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id$
12
13
14
#include "
xAODTestWriteCView.h
"
15
#include "
xAODTestWriteHelper.h
"
16
#include "
DataModelTestDataCommon/CVec.h
"
17
#include "
DataModelTestDataCommon/CView.h
"
18
#include "
AthContainers/ConstDataVector.h
"
19
#include "
AthenaKernel/errorcheck.h
"
20
21
22
namespace
DMTest
{
23
24
30
xAODTestWriteCView::xAODTestWriteCView
(
const
std::string &name,
31
ISvcLocator *pSvcLocator)
32
:
AthReentrantAlgorithm
(name, pSvcLocator),
33
m_cvecKey
(
"cvec"
),
34
m_cviewKey
(
"cview"
)
35
{
36
declareProperty
(
"CVecKey"
,
m_cvecKey
);
37
declareProperty
(
"CViewKey"
,
m_cviewKey
);
38
}
39
40
44
StatusCode
xAODTestWriteCView::initialize
()
45
{
46
ATH_CHECK
(
m_cvecKey
.initialize() );
47
ATH_CHECK
(
m_cviewKey
.initialize() );
48
return
StatusCode::SUCCESS;
49
}
50
51
55
StatusCode
xAODTestWriteCView::execute
(
const
EventContext& ctx)
const
56
{
57
SG::ReadHandle<DMTest::CVec>
cvec (
m_cvecKey
, ctx);
58
auto
cview = std::make_unique<ConstDataVector<DMTest::CView> >(
SG::VIEW_ELEMENTS
);
59
for
(
int
i = cvec->size()-1; i >= 0; --i)
60
cview->push_back ((*cvec)[i]);
61
62
SG::WriteHandle<ConstDataVector<DMTest::CView>
> cviewH (
m_cviewKey
, ctx);
63
CHECK
(
DMTest::recordView1
(cviewH, std::move(cview)) );
64
65
return
StatusCode::SUCCESS;
66
}
67
68
72
StatusCode
xAODTestWriteCView::finalize
()
73
{
74
return
StatusCode::SUCCESS;
75
}
76
77
78
}
// namespace DMTest
79
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
CVec.h
Class used for testing xAOD data reading/writing.
CView.h
Class used for testing ViewVector reading/writing.
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DMTest::xAODTestWriteCView::m_cviewKey
SG::WriteHandleKey< ConstDataVector< DMTest::CView > > m_cviewKey
Definition
xAODTestWriteCView.h:66
DMTest::xAODTestWriteCView::xAODTestWriteCView
xAODTestWriteCView(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
xAODTestWriteCView.cxx:30
DMTest::xAODTestWriteCView::finalize
virtual StatusCode finalize() override
Algorithm finalization; called at the end of the job.
Definition
xAODTestWriteCView.cxx:72
DMTest::xAODTestWriteCView::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
xAODTestWriteCView.cxx:44
DMTest::xAODTestWriteCView::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
xAODTestWriteCView.cxx:55
DMTest::xAODTestWriteCView::m_cvecKey
SG::ReadHandleKey< DMTest::CVec > m_cvecKey
Definition
xAODTestWriteCView.h:65
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
DMTest
Definition
B.h:23
DMTest::recordView1
StatusCode recordView1(SG::WriteHandle< ConstDataVector< ViewVector< DMTest::CVec > > > &h, std::unique_ptr< ConstDataVector< ViewVector< DMTest::CVec > > > view)
Definition
xAODTestWriteHelper.cxx:21
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition
OwnershipPolicy.h:18
xAODTestWriteCView.h
Algorithm to test writing an xAOD view vector (cview).
xAODTestWriteHelper.h
Test recording ViewVector w/o having CLASS_DEF visible in compilation unit.
Generated on
for ATLAS Offline Software by
1.17.0