ATLAS Offline Software
Loading...
Searching...
No Matches
AlgC.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 "AlgC.h"
8
9AlgC::AlgC( const std::string& name,
10 ISvcLocator* pSvcLocator ) :
11 ::AthAlgorithm( name, pSvcLocator )
12{}
13
14//---------------------------------------------------------------------------
15
16StatusCode AlgC::initialize() {
17 ATH_MSG_DEBUG("initialize " << name());
18
19 ATH_CHECK(m_rdh1.initialize());
20 ATH_CHECK(m_rch.initialize());
21
22 ATH_MSG_INFO( "m_rdh1 id: " << m_rdh1.fullKey() );
23 ATH_MSG_INFO( "m_rch id: " << m_rch.fullKey() );
24
25
26 return StatusCode::SUCCESS;
27}
28
29//---------------------------------------------------------------------------
30
31StatusCode AlgC::execute() {
32 ATH_MSG_DEBUG("execute " << name());
33
35 if (!rh1.isValid()) {
36 ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << m_rdh1.key());
37 return StatusCode::FAILURE;
38 }
39
40 ATH_MSG_INFO(" read: " << rh1.key() << " = " << rh1->val() );
41
42 EventIDBase t( getContext().eventID() );
43
45 const CondDataObj *cdo = *rch;
46 if (cdo != 0) {
47 ATH_MSG_INFO(" read CH: " << rch.key() << " = " << *cdo );
48 } else {
49 ATH_MSG_ERROR(" CDO ptr for " << rch.key() << " == zero");
50 }
51
52 return StatusCode::SUCCESS;
53
54}
55
#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.
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition AlgC.h:29
SG::ReadCondHandleKey< CondDataObj > m_rch
Definition AlgC.h:31
virtual StatusCode initialize() override
Definition AlgC.cxx:16
AlgC(const std::string &name, ISvcLocator *pSvcLocator)
Definition AlgC.cxx:9
virtual StatusCode execute() override
Definition AlgC.cxx:31
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const std::string & key() const
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.