ATLAS Offline Software
Loading...
Searching...
No Matches
AlgA.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "AlgA.h"
8
9#include <memory>
10
11//---------------------------------------------------------------------------
12
13StatusCode AlgA::initialize() {
14 ATH_MSG_DEBUG("initialize " << name());
15
16 ATH_CHECK( m_wrh1.initialize() );
17 ATH_CHECK( m_wrh2.initialize() );
18 ATH_CHECK( m_evt.initialize() );
19
20 return StatusCode::SUCCESS;
21}
22
23//---------------------------------------------------------------------------
24
25StatusCode AlgA::execute(const EventContext& ctx) const {
26
27 ATH_MSG_DEBUG("execute " << name());
28
30 ATH_MSG_INFO(" EventInfo: r: " << evt->runNumber()
31 << " e: " << evt->eventNumber()
32 << " evt: " << ctx.evt() );
33
34
35 const unsigned int i = ctx.evt() + 1;
36
38 ATH_CHECK( wh1.record( std::make_unique<HiveDataObj>
39 ( 10000 +
40 evt->eventNumber()*100 +
41 i) )
42 );
43 ATH_MSG_INFO(" write: " << wh1.key() << " = " << wh1->val() );
44
45
47 ATH_CHECK( wh2.record( std::make_unique< HiveDataObj >( 10050+i ) ) );
48 ATH_MSG_INFO(" write: " << wh2.key() << " = " << wh2->val() );
49
50 return StatusCode::SUCCESS;
51
52}
53
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
SG::WriteHandleKey< HiveDataObj > m_wrh2
Definition AlgA.h:25
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition AlgA.h:26
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition AlgA.h:24
virtual StatusCode execute(const EventContext &ctx) const override
Definition AlgA.cxx:25
virtual StatusCode initialize() override
Definition AlgA.cxx:13
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.