Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HiveAlgA.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 "HiveAlgA.h"
6 #include "GaudiKernel/ThreadLocalContext.h"
7 
8 HiveAlgA::HiveAlgA( const std::string& name,
9  ISvcLocator* pSvcLocator ) :
10  ::HiveAlgBase( name, pSvcLocator )
11 {
12 }
13 
14 HiveAlgA::~HiveAlgA() = default;
15 
16 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17 
19  ATH_MSG_DEBUG("initialize " << name());
20 
24 
25  // make sure we initialize the base class
26  return HiveAlgBase::initialize();
27 }
28 
29 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
30 
32 
33  ATH_MSG_DEBUG("execute " << name());
34 
36  if (!evt.isValid()) {
37  ATH_MSG_ERROR ("Could not retrieve EventInfo");
38  return StatusCode::FAILURE;
39  } else {
40  ATH_MSG_INFO(" EventInfo: r: " << evt->runNumber()
41  << " e: " << evt->eventNumber() );
42  }
43 
44  sleep();
45 
46  unsigned int i = Gaudi::Hive::currentContextEvt();
47 
49  ATH_CHECK(wrh1.record(std::make_unique< HiveDataObj >(10000 + evt->eventNumber()*100 + i)));
50 
52  ATH_CHECK(wrh2.record(std::make_unique< HiveDataObj >(10050+i)));
53 
54  ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() );
55  ATH_MSG_INFO(" write: " << wrh2.key() << " = " << wrh2->val() );
56 
57  return StatusCode::SUCCESS;
58 }
59 
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
HiveAlgBase::sleep
unsigned int sleep()
Definition: HiveAlgBase.cxx:40
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition: HiveAlgBase.cxx:23
HiveAlgA.h
Simple Algorithm that reads the EventInfo obj, and writes two HiveDataObjs to the store.
HiveAlgA::m_wrh2
SG::WriteHandleKey< HiveDataObj > m_wrh2
Definition: HiveAlgA.h:42
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
HiveAlgA::initialize
virtual StatusCode initialize() override
Definition: HiveAlgA.cxx:18
HiveAlgA::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition: HiveAlgA.h:39
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
HiveAlgA::~HiveAlgA
~HiveAlgA()
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
HiveAlgA::execute
virtual StatusCode execute() override
Definition: HiveAlgA.cxx:31
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
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
HiveAlgA::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition: HiveAlgA.h:41
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
HiveAlgA::HiveAlgA
HiveAlgA(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HiveAlgA.cxx:8
HiveDataObj::val
void val(int i)
Definition: HiveDataObj.h:22