ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
HiveAlgR.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
HiveAlgR.h
"
6
#include "GaudiKernel/ServiceHandle.h"
7
8
HiveAlgR::HiveAlgR
(
const
std::string& name,
9
ISvcLocator* pSvcLocator ) :
10
::
AthReentrantAlgorithm
( name, pSvcLocator )
11
{}
12
13
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14
HiveAlgR::~HiveAlgR
() =
default
;
15
16
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17
StatusCode
HiveAlgR::initialize
() {
18
19
info() <<
"initialize: "
<<
index
() <<
endmsg
;
20
21
ATH_CHECK
(
m_wrh1
.initialize() );
22
ATH_CHECK
(
m_evt
.initialize() );
23
24
return
StatusCode::SUCCESS;
25
}
26
27
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28
StatusCode
HiveAlgR::finalize
() {
29
info() <<
"finalize: "
<<
index
() <<
endmsg
;
30
return
StatusCode::SUCCESS;
31
}
32
33
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
34
StatusCode
HiveAlgR::execute
(
const
EventContext& ctx)
const
{
35
36
info() <<
"execute: "
<<
index
() <<
" on "
<< ctx <<
endmsg
;
37
38
SG::ReadHandle<xAOD::EventInfo>
evt(
m_evt
,ctx);
39
ATH_MSG_INFO
(
" EventInfo: r: "
<< evt->runNumber()
40
<<
" e: "
<< evt->eventNumber() );
41
42
SG::WriteHandle<HiveDataObj>
wh1(
m_wrh1
,ctx);
43
ATH_CHECK
(wh1.
record
(std::make_unique<HiveDataObj>(10000 +evt->eventNumber()*100)));
44
45
ATH_MSG_INFO
(
" write: "
<< wh1.
key
() <<
" = "
<< wh1->val() );
46
47
return
StatusCode::SUCCESS;
48
49
}
50
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
HiveAlgR.h
Re-entrant Algorithm that reads the EventInfo obj, and writes a HiveDataObjs to the store.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
HiveAlgR::~HiveAlgR
~HiveAlgR()
HiveAlgR::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition
HiveAlgR.h:41
HiveAlgR::finalize
virtual StatusCode finalize() override
Definition
HiveAlgR.cxx:28
HiveAlgR::HiveAlgR
HiveAlgR(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgR.cxx:8
HiveAlgR::execute
virtual StatusCode execute(const EventContext &) const override
Definition
HiveAlgR.cxx:34
HiveAlgR::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition
HiveAlgR.h:43
HiveAlgR::initialize
virtual StatusCode initialize() override
Definition
HiveAlgR.cxx:17
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
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
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0