ATLAS Offline Software
AlgC.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "AlgC.h"
6 
8 
9 #include "GaudiKernel/ServiceHandle.h"
10 #include <thread>
11 #include <chrono>
12 #include <memory>
13 
14 
15 AlgC::AlgC( const std::string& name,
16  ISvcLocator* pSvcLocator ) :
17  ::AthAlgorithm( name, pSvcLocator )
18 {}
19 
20 //---------------------------------------------------------------------------
21 
23 
24 //---------------------------------------------------------------------------
25 
27  ATH_MSG_DEBUG("initialize " << name());
28 
31 
32  ATH_MSG_INFO( "m_rdh1 id: " << m_rdh1.fullKey() );
33  ATH_MSG_INFO( "m_rch id: " << m_rch.fullKey() );
34 
35 
36  return StatusCode::SUCCESS;
37 }
38 
39 //---------------------------------------------------------------------------
40 
42  ATH_MSG_DEBUG("finalize " << name());
43  return StatusCode::SUCCESS;
44 }
45 
46 //---------------------------------------------------------------------------
47 
49  ATH_MSG_DEBUG("execute " << name());
50 
52  if (!rh1.isValid()) {
53  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << m_rdh1.key());
54  return StatusCode::FAILURE;
55  }
56 
57  ATH_MSG_INFO(" read: " << rh1.key() << " = " << rh1->val() );
58 
59  EventIDBase t( getContext().eventID() );
60 
61  // const CondDataObj *cdo = m_rch.retrieve(t);
62  // const CondDataObj *cdo = m_rch.retrieve();
63 
65  const CondDataObj *cdo = *rch;
66  if (cdo != 0) {
67  ATH_MSG_INFO(" read CH: " << rch.key() << " = " << *cdo );
68  } else {
69  ATH_MSG_ERROR(" CDO ptr for " << rch.key() << " == zero");
70  }
71 
72  return StatusCode::SUCCESS;
73 
74 }
75 
AlgC::~AlgC
virtual ~AlgC()
Definition: AlgC.cxx:22
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AlgC::AlgC
AlgC(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AlgC.cxx:15
AlgC::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition: AlgC.h:32
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
AlgC.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CondDataObj
Definition: CondDataObj.h:8
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
AlgC::m_rch
SG::ReadCondHandleKey< CondDataObj > m_rch
Definition: AlgC.h:34
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ReadCondHandleKey.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
AlgC::initialize
virtual StatusCode initialize() override
Definition: AlgC.cxx:26
HiveDataObj::val
void val(int i)
Definition: HiveDataObj.h:22
SG::ReadCondHandle::key
const std::string & key() const
Definition: ReadCondHandle.h:59
AlgC::execute
virtual StatusCode execute() override
Definition: AlgC.cxx:48
AlgC::finalize
virtual StatusCode finalize() override
Definition: AlgC.cxx:41