ATLAS Offline Software
Loading...
Searching...
No Matches
AlgD.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 "AlgD.h"
8
9AlgD::AlgD( const std::string& name,
10 ISvcLocator* pSvcLocator ) :
11 ::AthAlgorithm( name, pSvcLocator )
12{
13}
14
15//---------------------------------------------------------------------------
16
17StatusCode AlgD::initialize() {
18 ATH_MSG_DEBUG("initialize " << name());
19
20 ATH_CHECK( m_rdh1.initialize() );
21 ATH_CHECK( m_rch1.initialize() );
22 ATH_CHECK( m_rch2.initialize() );
23
24 ATH_MSG_INFO( "m_rdh1 id: " << m_rdh1.fullKey() );
25 ATH_MSG_INFO( "m_rch1 id: " << m_rch1.fullKey() );
26 ATH_MSG_INFO( "m_rch2 id: " << m_rch2.fullKey() );
27
28 return StatusCode::SUCCESS;
29}
30
31//---------------------------------------------------------------------------
32
33StatusCode AlgD::execute() {
34 ATH_MSG_DEBUG("execute " << name());
35
37 if (!rh1.isValid()) {
38 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << m_rdh1.key());
39 return StatusCode::FAILURE;
40 }
41
42 ATH_MSG_INFO(" read: " << rh1.key() << " = " << rh1->val() );
43
46
47 EventIDBase t( getContext().eventID() );
48
49 const CondDataObj *cdo = *ch1;
50 if (cdo != 0) {
51 ATH_MSG_INFO(" CDO1: " << *cdo );
52 } else {
53 ATH_MSG_ERROR(" CDO1 ptr == zero");
54 }
55
56 cdo = *ch2;
57 if (cdo != 0) {
58 ATH_MSG_INFO(" CDO2: " << *cdo );
59 } else {
60 ATH_MSG_ERROR(" CDO2 ptr == zero");
61 }
62
63 ATH_MSG_INFO("test: " << getContext().eventID().event_number() << " "
64 << rh1->val() << " " << **ch1 << " " << **ch2);
65
66 return StatusCode::SUCCESS;
67
68}
69
#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.
AlgD(const std::string &name, ISvcLocator *pSvcLocator)
Definition AlgD.cxx:9
virtual StatusCode initialize() override
Definition AlgD.cxx:17
SG::ReadCondHandleKey< CondDataObj > m_rch2
Definition AlgD.h:32
SG::ReadCondHandleKey< CondDataObj > m_rch1
Definition AlgD.h:31
virtual StatusCode execute() override
Definition AlgD.cxx:33
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition AlgD.h:29
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
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.