ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTestWriteFwdLink2.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
3 */
10
11
16#include "AthLinks/DataLink.h"
18
19
20namespace DMTest {
21
22
24{
25 ATH_CHECK( m_cvecAuxKey.initialize() );
26 return StatusCode::SUCCESS;
27}
28
29
30StatusCode xAODTestWriteFwdLink2::execute (const EventContext& ctx) const
31{
32 unsigned int count = ctx.eventID().event_number() + 1;
33
34 auto cvecaux = std::make_unique<DMTest::CAuxContainer>();
36 cvec.setStore (cvecaux.get());
37 for (size_t i = 0; i < 10; i++) {
38 DMTest::C* c = cvec.push_back (std::make_unique<DMTest::C>());
39 c->setAnInt (count*100 + 10+i);
40 c->setAFloat (count*100 + 20.5+i);
41 }
43 ATH_CHECK( cvecaux_h.record (std::move (cvecaux)) );
44 return StatusCode::SUCCESS;
45}
46
47
48} // namespace DMTest
49
#define ATH_CHECK
Evaluate an expression and check for errors.
Class used for testing xAOD data reading/writing.
Class used for testing xAOD data reading/writing.
Interface for non-const operations on an auxiliary store.
Property holding a SG store/key/clid from which a WriteHandle is made.
virtual StatusCode initialize() override
SG::WriteHandleKey< DMTest::CAuxContainer > m_cvecAuxKey
virtual StatusCode execute(const EventContext &ctx) const override
Derived DataVector<T>.
Definition DataVector.h:795
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
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
C_v1 C
Definition C.h:26