ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTestShallowCopyHVec.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
10
11
22
23
24namespace DMTest {
25
26
31{
32 ATH_CHECK( m_readKey.initialize() );
33 ATH_CHECK( m_writeKey.initialize() );
34 ATH_CHECK( m_aFloat20Key.initialize() );
35 return StatusCode::SUCCESS;
36}
37
38
42StatusCode xAODTestShallowCopyHVec::execute (const EventContext& ctx) const
43{
44 size_t count = ctx.evt() + 1;
45
46 {
48 auto ret = xAOD::shallowCopyContainer (*vec);
49
51 ATH_CHECK( copy.record (std::unique_ptr<DMTest::HVec>(ret.first),
52 std::unique_ptr<xAOD::ShallowAuxContainer>(ret.second)) );
53
55 for (H* h : *ret.first)
56 aFloat20(*h) = count * 20000 + h->aFloat();
57 }
58
59 return StatusCode::SUCCESS;
60}
61
62
63} // namespace DMTest
64
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle mappings between names and auxid_t.
std::vector< size_t > vec
Helpers for checking error return status codes and reporting errors.
Test for xAOD schema evolution.
Test for xAOD schema evolution.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
Handle class for recording to StoreGate.
Header file for AthHistogramAlgorithm.
SG::WriteDecorHandleKey< DMTest::HVec > m_aFloat20Key
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
SG::WriteHandleKey< DMTest::HVec > m_writeKey
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
SG::ReadHandleKey< DMTest::HVec > m_readKey
Handle class for adding a decoration to an object.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
Definition B.h:23
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
Algorithm to test shallow-copy of xAOD data.