ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTestWriteCVecConst.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
20
21
22namespace DMTest {
23
24
31 ISvcLocator *pSvcLocator)
32 : AthReentrantAlgorithm (name, pSvcLocator),
33 m_cvecKey ("cvecConst")
34{
35 declareProperty ("CVecKey", m_cvecKey);
36}
37
38
43{
44 ATH_CHECK( m_cvecKey.initialize() );
45 return StatusCode::SUCCESS;
46}
47
48
52StatusCode xAODTestWriteCVecConst::execute (const EventContext& ctx) const
53{
54 auto coll = std::make_unique<DMTest::CVec>();
55 auto store = std::make_unique<DMTest::CAuxContainer>();
56 coll->setStore (store.get());
57
59 CHECK( cvec.record (std::move(coll), std::move(store)) );
60
61 size_t count = ctx.evt();
62 for (int i=0; i < 10; i++) {
63 cvec->push_back (new DMTest::C);
64 C& c = *cvec->back();
65 c.setAnInt (count * 100 + i+1);
66 c.setAFloat (count * 200 + (float)i*0.1);
67 }
68
69 return StatusCode::SUCCESS;
70}
71
72
77{
78 return StatusCode::SUCCESS;
79}
80
81
82} // namespace DMTest
83
#define ATH_CHECK
Evaluate an expression and check for errors.
Hold information about an option setting request.
Class used for testing xAOD data reading/writing.
Class used for testing xAOD data reading/writing.
Class used for testing xAOD data reading/writing.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< DMTest::CVec > m_cvecKey
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
virtual StatusCode finalize() override
Algorithm finalization; called at the end of the job.
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
xAODTestWriteCVecConst(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
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
Test recording a const aux obj via WriteHandle.