Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Control
AthenaExamples
AthExHive
src
HiveAlgV.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 "
HiveAlgV.h
"
6
#include <vector>
7
8
HiveAlgV::HiveAlgV
(
const
std::string&
name
,
9
ISvcLocator* pSvcLocator ) :
10
::
HiveAlgBase
(
name
, pSvcLocator )
11
{}
12
13
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14
HiveAlgV::~HiveAlgV
() =
default
;
15
16
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17
StatusCode
HiveAlgV::initialize
() {
18
ATH_MSG_DEBUG
(
"initialize "
<<
name
());
19
20
ATH_CHECK
(
m_rhv
.initialize() );
21
ATH_CHECK
(
m_whv
.initialize() );
22
23
ATH_MSG_INFO
(
m_rhv
.keys() <<
" : "
<<
m_rhv
.size());
24
ATH_MSG_INFO
(
m_whv
.keys() <<
" : "
<<
m_whv
.size());
25
26
// initialize base class
27
return
HiveAlgBase::initialize
();
28
}
29
30
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
31
StatusCode
HiveAlgV::execute
() {
32
33
ATH_MSG_DEBUG
(
"execute "
<<
name
());
34
35
sleep
();
36
37
if
(
m_writeFirst
) {
38
ATH_CHECK
(
write
());
39
ATH_CHECK
(
read
());
40
}
else
{
41
ATH_CHECK
(
read
());
42
ATH_CHECK
(
write
());
43
}
44
45
return
StatusCode::SUCCESS;
46
}
47
48
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
49
StatusCode
50
HiveAlgV::read
()
const
{
51
StatusCode
sc
{ StatusCode::SUCCESS };
52
std::vector< SG::ReadHandle<HiveDataObj> > rhv =
m_rhv
.makeHandles();
53
for
(
auto
&hnd : rhv) {
54
if
(!hnd.isValid()) {
55
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< hnd.key());
56
sc
= StatusCode::FAILURE;
57
}
else
{
58
ATH_MSG_INFO
(
" read: "
<< hnd.key() <<
" = "
<< hnd->val() );
59
}
60
}
61
return
sc
;
62
}
63
64
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
65
StatusCode
66
HiveAlgV::write
() {
67
std::vector< SG::WriteHandle<HiveDataObj> > whv =
m_whv
.makeHandles();
68
for
(
auto
&hnd : whv) {
69
ATH_CHECK
(hnd.record(std::make_unique<HiveDataObj>( 10101 )));
70
ATH_MSG_INFO
(
" write: "
<< hnd.key() <<
" = "
<< hnd->val() );
71
}
72
return
StatusCode::SUCCESS;
73
}
74
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition:
AthMsgStreamMacros.h:31
HiveAlgV::write
StatusCode write()
Definition:
HiveAlgV.cxx:66
HiveAlgBase::sleep
unsigned int sleep()
Definition:
HiveAlgBase.cxx:40
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition:
HiveAlgBase.cxx:23
HiveAlgV::initialize
virtual StatusCode initialize() override
Definition:
HiveAlgV.cxx:17
AthenaPoolTestRead.sc
sc
Definition:
AthenaPoolTestRead.py:27
HiveAlgV::m_whv
SG::WriteHandleKeyArray< HiveDataObj > m_whv
Definition:
HiveAlgV.h:44
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
HiveAlgV::execute
virtual StatusCode execute() override
Definition:
HiveAlgV.cxx:31
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
HiveAlgV::~HiveAlgV
~HiveAlgV()
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
HiveAlgBase
Definition:
HiveAlgBase.h:26
HiveAlgV.h
Simple Algorithm that reads an array of HiveDataObjs, and then writes an array of them.
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:240
HiveAlgV::m_writeFirst
Gaudi::Property< bool > m_writeFirst
Definition:
HiveAlgV.h:37
HiveAlgV::m_rhv
SG::ReadHandleKeyArray< HiveDataObj > m_rhv
Definition:
HiveAlgV.h:40
HiveAlgV::read
StatusCode read() const
Definition:
HiveAlgV.cxx:50
HiveAlgV::HiveAlgV
HiveAlgV(const std::string &name, ISvcLocator *pSvcLocator)
Definition:
HiveAlgV.cxx:8
Generated on Thu May 22 2025 21:10:48 for ATLAS Offline Software by
1.8.18