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: {} e: {} evt: {}",
31 evt->runNumber(), evt->eventNumber(), ctx.evt() );
32
33
34 const unsigned int i = ctx.evt() + 1;
35
37 ATH_CHECK( wh1.record( std::make_unique<HiveDataObj>
38 ( 10000 +
39 evt->eventNumber()*100 +
40 i) )
41 );
42 ATH_MSG_INFO(" write: {} = {}", wh1.key(), wh1->val() );
43
44
46 ATH_CHECK( wh2.record( std::make_unique< HiveDataObj >( 10050+i ) ) );
47 ATH_MSG_INFO(" write: {} = {}", wh2.key(), wh2->val() );
48
49 return StatusCode::SUCCESS;
50
51}
52
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(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.