ATLAS Offline Software
Loading...
Searching...
No Matches
HiveAlgM.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 "HiveAlgM.h"
6#include <thread>
7#include <chrono>
8#include <memory>
9
10HiveAlgM::HiveAlgM( const std::string& name,
11 ISvcLocator* pSvcLocator ) :
12 ::HiveAlgBase( name, pSvcLocator )
13{}
14
16
18 ATH_MSG_DEBUG("initialize " << name());
19
20 ATH_CHECK( m_rdh1.initialize() );
21 ATH_CHECK( m_rdh2.initialize() );
22
24}
25
26StatusCode HiveAlgM::execute(const EventContext& ctx) const {
27
28 ATH_MSG_DEBUG("execute " << name());
29
30 sleep();
31
33 if (!rdh1.isValid()) {
34 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh1.key());
35 return StatusCode::FAILURE;
36 }
37
39 if (!rdh2.isValid()) {
40 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh2.key());
41 return StatusCode::FAILURE;
42 }
43
44 ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() );
45 ATH_MSG_INFO(" read: " << rdh2.key() << " = " << rdh2->val() );
46
47 if ( rdh2->val() != (rdh1->val() + m_off) ) {
48 ATH_MSG_ERROR (rdh2.key() << " != " << rdh1.key() << " + " << (int) m_off);
49 } else {
50 ATH_MSG_INFO( "loop is ok");
51 }
52
53 return StatusCode::SUCCESS;
54
55}
56
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
unsigned int sleep() const
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition HiveAlgM.h:31
virtual StatusCode execute(const EventContext &ctx) const override
Definition HiveAlgM.cxx:26
SG::ReadHandleKey< HiveDataObj > m_rdh2
Definition HiveAlgM.h:32
virtual StatusCode initialize() override
Definition HiveAlgM.cxx:17
Gaudi::Property< int > m_off
Definition HiveAlgM.h:30
HiveAlgM(const std::string &name, ISvcLocator *pSvcLocator)
Definition HiveAlgM.cxx:10
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.