ATLAS Offline Software
Loading...
Searching...
No Matches
HiveAlgR.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "HiveAlgR.h"
6#include "GaudiKernel/ServiceHandle.h"
7
8HiveAlgR::HiveAlgR( const std::string& name,
9 ISvcLocator* pSvcLocator ) :
10 ::AthReentrantAlgorithm( name, pSvcLocator )
11{}
12
13/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14HiveAlgR::~HiveAlgR() = default;
15
16/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18
19 info() << "initialize: " << index() << endmsg;
20
21 ATH_CHECK( m_wrh1.initialize() );
22 ATH_CHECK( m_evt.initialize() );
23
24 return StatusCode::SUCCESS;
25}
26
27/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28StatusCode HiveAlgR::finalize() {
29 info() << "finalize: " << index() << endmsg;
30 return StatusCode::SUCCESS;
31}
32
33/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
34StatusCode HiveAlgR::execute(const EventContext& ctx) const {
35
36 info() << "execute: " << index() << " on " << ctx << endmsg;
37
39 ATH_MSG_INFO(" EventInfo: r: " << evt->runNumber()
40 << " e: " << evt->eventNumber() );
41
43 ATH_CHECK(wh1.record(std::make_unique<HiveDataObj>(10000 +evt->eventNumber()*100)));
44
45 ATH_MSG_INFO(" write: " << wh1.key() << " = " << wh1->val() );
46
47 return StatusCode::SUCCESS;
48
49}
50
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
Re-entrant Algorithm that reads the EventInfo obj, and writes a HiveDataObjs to the store.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition HiveAlgR.h:41
virtual StatusCode finalize() override
Definition HiveAlgR.cxx:28
HiveAlgR(const std::string &name, ISvcLocator *pSvcLocator)
Definition HiveAlgR.cxx:8
virtual StatusCode execute(const EventContext &) const override
Definition HiveAlgR.cxx:34
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition HiveAlgR.h:43
virtual StatusCode initialize() override
Definition HiveAlgR.cxx:17
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.
Definition index.py:1