ATLAS Offline Software
HiveAlgF.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 "HiveAlgF.h"
6 
7 HiveAlgF::HiveAlgF( const std::string& name,
8  ISvcLocator* pSvcLocator ) :
9  ::HiveAlgBase( name, pSvcLocator )
10 {
11 }
12 
13 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18  ATH_MSG_DEBUG("initialize " << name());
19 
26 
27  // initialize base class
28  return HiveAlgBase::initialize ();
29 }
30 
31 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
33  ATH_MSG_DEBUG("finalize " << name());
34  return StatusCode::SUCCESS;
35 }
36 
37 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
39 
40  ATH_MSG_DEBUG("execute " << name());
41 
42  sleep();
43 
45  if (!rdh1.isValid()) {
46  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh1.key());
47  return StatusCode::FAILURE;
48  }
49 
51  if (!rdh2.isValid()) {
52  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh2.key());
53  return StatusCode::FAILURE;
54  }
55 
57  if (!rdh3.isValid()) {
58  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh3.key());
59  return StatusCode::FAILURE;
60  }
61 
63  if (!rdh4.isValid()) {
64  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh4.key());
65  return StatusCode::FAILURE;
66  }
67 
69  if (!rdh5.isValid()) {
70  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh5.key());
71  return StatusCode::FAILURE;
72  }
73 
75  if (!rdh6.isValid()) {
76  ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << rdh6.key());
77  return StatusCode::FAILURE;
78  }
79 
80  ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() );
81  ATH_MSG_INFO(" read: " << rdh2.key() << " = " << rdh2->val() );
82  ATH_MSG_INFO(" read: " << rdh3.key() << " = " << rdh3->val() );
83 
84  ATH_MSG_INFO("test: " << getContext().eventID().event_number() << " "
85  << rdh1->val() + rdh2->val() + rdh3->val()
86  << " " << rdh1->val()
87  << " " << rdh2->val()
88  << " " << rdh3->val()
89  << " " << rdh4->val()
90  << " " << rdh5->val()
91  << " " << rdh6->val()
92  );
93 
94  return StatusCode::SUCCESS;
95 
96 }
97 
HiveAlgF::execute
virtual StatusCode execute() override
Definition: HiveAlgF.cxx:38
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
HiveAlgBase::sleep
unsigned int sleep()
Definition: HiveAlgBase.cxx:42
HiveAlgF.h
Simple Algorithm that reads 6 HiveDataObjs created by HiveAlgA, HiveAlgB, HiveAlgC,...
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition: HiveAlgBase.cxx:25
HiveAlgF::m_rdh3
SG::ReadHandleKey< HiveDataObj > m_rdh3
Definition: HiveAlgF.h:39
HiveAlgF::finalize
virtual StatusCode finalize() override
Definition: HiveAlgF.cxx:32
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HiveAlgF::m_rdh6
SG::ReadHandleKey< HiveDataObj > m_rdh6
Definition: HiveAlgF.h:42
HiveAlgF::m_rdh2
SG::ReadHandleKey< HiveDataObj > m_rdh2
Definition: HiveAlgF.h:38
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
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
HiveAlgBase
Definition: HiveAlgBase.h:26
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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
HiveAlgF::HiveAlgF
HiveAlgF(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HiveAlgF.cxx:7
HiveAlgF::m_rdh4
SG::ReadHandleKey< HiveDataObj > m_rdh4
Definition: HiveAlgF.h:40
HiveDataObj::val
void val(int i)
Definition: HiveDataObj.h:22
HiveAlgF::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition: HiveAlgF.h:37
HiveAlgF::m_rdh5
SG::ReadHandleKey< HiveDataObj > m_rdh5
Definition: HiveAlgF.h:41
HiveAlgF::initialize
virtual StatusCode initialize() override
Definition: HiveAlgF.cxx:17
HiveAlgF::~HiveAlgF
~HiveAlgF()
Definition: HiveAlgF.cxx:14