ATLAS Offline Software
Loading...
Searching...
No Matches
AlgD.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 "AlgD.h"
8
9//---------------------------------------------------------------------------
10
11StatusCode AlgD::initialize() {
12 ATH_MSG_DEBUG("initialize " << name());
13
14 ATH_CHECK( m_rdh1.initialize() );
15 ATH_CHECK( m_rch1.initialize() );
16 ATH_CHECK( m_rch2.initialize() );
17
18 ATH_MSG_INFO( "m_rdh1 id: " << m_rdh1.fullKey() );
19 ATH_MSG_INFO( "m_rch1 id: " << m_rch1.fullKey() );
20 ATH_MSG_INFO( "m_rch2 id: " << m_rch2.fullKey() );
21
22 return StatusCode::SUCCESS;
23}
24
25//---------------------------------------------------------------------------
26
27StatusCode AlgD::execute(const EventContext& ctx) const {
28 ATH_MSG_DEBUG("execute " << name());
29
31 if (!rh1.isValid()) {
32 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << m_rdh1.key());
33 return StatusCode::FAILURE;
34 }
35
36 ATH_MSG_INFO(" read: " << rh1.key() << " = " << rh1->val() );
37
40
41 const CondDataObj *cdo = *ch1;
42 if (cdo != 0) {
43 ATH_MSG_INFO(" CDO1: " << *cdo );
44 } else {
45 ATH_MSG_ERROR(" CDO1 ptr == zero");
46 }
47
48 cdo = *ch2;
49 if (cdo != 0) {
50 ATH_MSG_INFO(" CDO2: " << *cdo );
51 } else {
52 ATH_MSG_ERROR(" CDO2 ptr == zero");
53 }
54
55 ATH_MSG_INFO("test: " << ctx.eventID().event_number() << " "
56 << rh1->val() << " " << **ch1 << " " << **ch2);
57
58 return StatusCode::SUCCESS;
59
60}
61
#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)
Handle class for reading from StoreGate.
virtual StatusCode execute(const EventContext &ctx) const override
Definition AlgD.cxx:27
virtual StatusCode initialize() override
Definition AlgD.cxx:11
SG::ReadCondHandleKey< CondDataObj > m_rch2
Definition AlgD.h:28
SG::ReadCondHandleKey< CondDataObj > m_rch1
Definition AlgD.h:27
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition AlgD.h:25
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.