ATLAS Offline Software
xAODTestWriteFwdLink2.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration.
3  */
12 #include "xAODTestWriteFwdLink2.h"
16 #include "AthLinks/DataLink.h"
18 
19 
20 namespace DMTest {
21 
22 
24 {
25  ATH_CHECK( m_cvecAuxKey.initialize() );
26  return StatusCode::SUCCESS;
27 }
28 
29 
30 StatusCode 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 
DMTest::xAODTestWriteFwdLink2::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: xAODTestWriteFwdLink2.cxx:30
DMTest::xAODTestWriteFwdLink2::initialize
virtual StatusCode initialize() override
Definition: xAODTestWriteFwdLink2.cxx:23
DMTest::C_v1
Definition: C_v1.h:27
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
CVec.h
Class used for testing xAOD data reading/writing.
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
C.h
Class used for testing xAOD data reading/writing.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAODTestWriteFwdLink2.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
DMTest::xAODTestWriteFwdLink2::m_cvecAuxKey
SG::WriteHandleKey< DMTest::CAuxContainer > m_cvecAuxKey
Definition: xAODTestWriteFwdLink2.h:37
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
IAuxStore.h
Interface for non-const operations on an auxiliary store.
python.compressB64.c
def c
Definition: compressB64.py:93
DMTest
Definition: B.h:23