ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
xAODTestReadPLinks.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
10
11
#include "
xAODTestReadPLinks.h
"
12
#include "
StoreGate/ReadHandle.h
"
13
#include "
StoreGate/ReadDecorHandle.h
"
14
#include "
AthContainers/PackedLink.h
"
15
#include <sstream>
16
17
18
namespace
{
19
20
24
std::string formEL (
const
DMTest::xAODTestReadPLinks::EL
& el)
25
{
26
std::ostringstream
ss
;
27
ss
<<
"("
<<
el
.dataID() <<
":"
;
28
if
(
static_cast<
int
>
(
el
.index()) == -1) {
29
ss
<<
"inv"
;
30
}
31
else
{
32
ss
<<
el
.index();
33
}
34
ss
<<
")"
;
35
return
ss
.str();
36
}
37
38
42
std::string formDL (
const
DMTest::xAODTestReadPLinks::DL
& dl)
43
{
44
std::ostringstream
ss
;
45
ss
<<
"("
<<
dl
.dataID() <<
")"
;
46
return
ss
.str();
47
}
48
49
50
}
// anonymous namespace
51
52
53
namespace
DMTest
{
54
55
59
StatusCode
xAODTestReadPLinks::initialize
()
60
{
61
ATH_CHECK
(
m_plinksContainerKey
.initialize (
SG::AllowEmpty
) );
62
ATH_CHECK
(
m_plinksInfoKey
.initialize (
SG::AllowEmpty
) );
63
ATH_CHECK
(
m_plinksDecorLinkKey
.initialize (
SG::AllowEmpty
) );
64
ATH_CHECK
(
m_plinksDecorVLinksKey
.initialize (
SG::AllowEmpty
) );
65
ATH_CHECK
(
m_plinksInfoDecorLinkKey
.initialize (
SG::AllowEmpty
) );
66
ATH_CHECK
(
m_plinksInfoDecorVLinksKey
.initialize (
SG::AllowEmpty
) );
67
return
StatusCode::SUCCESS;
68
}
69
70
74
StatusCode
xAODTestReadPLinks::execute
(
const
EventContext& ctx)
const
75
{
76
static
const
SG::ConstAccessor< SG::PackedLink<CVec>
> acc_plink (
"plink"
);
77
78
if
(!
m_plinksContainerKey
.empty()) {
79
SG::ReadHandle<PLinksContainer>
plinkscont (
m_plinksContainerKey
, ctx);
80
ATH_MSG_INFO
(
m_plinksContainerKey
.key() );
81
82
std::ostringstream
ss
;
83
ss
<<
" plink_DLinks: "
;
84
for
(
const
DL
& dl : acc_plink.getDataLinkSpan (*plinkscont)) {
85
ss
<< formDL (dl) <<
" "
;
86
}
87
ATH_MSG_INFO
(
ss
.str() );
88
89
for
(
const
PLinks
* plinks : *plinkscont) {
90
ATH_CHECK
(
dumpPLinks
(*plinks) );
91
ATH_CHECK
(
dumpDecor
(ctx, *plinks) );
92
}
93
}
94
95
if
(!
m_plinksInfoKey
.empty()) {
96
SG::ReadHandle<PLinks>
plinksinfo (
m_plinksInfoKey
, ctx);
97
ATH_MSG_INFO
(
m_plinksInfoKey
.key() );
98
99
std::ostringstream
ss
;
100
ss
<<
" plinkInfo_DLinks: "
;
101
for
(
const
DL
& dl : acc_plink.getDataLinkSpan (*plinksinfo->container())) {
102
ss
<< formDL (dl) <<
" "
;
103
}
104
ATH_MSG_INFO
(
ss
.str() );
105
106
ATH_CHECK
(
dumpPLinks
(*plinksinfo) );
107
ATH_CHECK
(
dumpInfoDecor
(ctx, *plinksinfo) );
108
}
109
110
return
StatusCode::SUCCESS;
111
}
112
113
117
StatusCode
xAODTestReadPLinks::dumpPLinks
(
const
PLinks
& plinks)
const
118
{
119
std::ostringstream
ss
;
120
ss
<<
" link: "
<< formEL (plinks.
plink
());
121
ss
<<
" links:"
;
122
for
(
EL
el : plinks.
vlinks
()) {
123
ss
<<
" "
<< formEL (el);
124
}
125
ATH_MSG_INFO
(
ss
.str() );
126
return
StatusCode::SUCCESS;
127
}
128
129
133
StatusCode
134
xAODTestReadPLinks::dumpDecor
(
const
EventContext& ctx,
135
const
PLinks
& plinks)
const
136
{
137
std::ostringstream
ss
;
138
if
(!
m_plinksDecorLinkKey
.empty()) {
139
SG::ReadDecorHandle<PLinksContainer, SG::PackedLink<CVec>
> decor (
m_plinksDecorLinkKey
, ctx);
140
ss
<<
" decorLink: "
<< formEL (decor (plinks));
141
}
142
143
if
(!
m_plinksDecorVLinksKey
.empty()) {
144
SG::ReadDecorHandle<PLinksContainer, std::vector<SG::PackedLink<CVec>
> > decor (
m_plinksDecorVLinksKey
, ctx);
145
ss
<<
" decorVLinks:"
;
146
for
(
ElementLink<CVec>
el : decor (plinks)) {
147
ss
<<
" "
<< formEL (el);
148
}
149
}
150
ATH_MSG_INFO
(
ss
.str() );
151
return
StatusCode::SUCCESS;
152
}
153
154
158
StatusCode
159
xAODTestReadPLinks::dumpInfoDecor
(
const
EventContext& ctx,
160
const
PLinks
& plinks)
const
161
{
162
std::ostringstream
ss
;
163
if
(!
m_plinksInfoDecorLinkKey
.empty()) {
164
SG::ReadDecorHandle<PLinks, SG::PackedLink<CVec>
> decor (
m_plinksInfoDecorLinkKey
, ctx);
165
ss
<<
" decorLink: "
<< formEL (decor (plinks));
166
}
167
168
if
(!
m_plinksInfoDecorVLinksKey
.empty()) {
169
SG::ReadDecorHandle<PLinks, std::vector<SG::PackedLink<CVec>
> > decor (
m_plinksInfoDecorVLinksKey
, ctx);
170
ss
<<
" decorVLinks:"
;
171
for
(
ElementLink<CVec>
el : decor (plinks)) {
172
ss
<<
" "
<< formEL (el);
173
}
174
}
175
ATH_MSG_INFO
(
ss
.str() );
176
return
StatusCode::SUCCESS;
177
}
178
179
180
}
// namespace DMTest
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
PackedLink.h
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
ReadDecorHandle.h
Handle class for reading a decoration on an object.
ReadHandle.h
Handle class for reading from StoreGate.
DMTest::PLinks_v1::plink
ElementLink< CVec > plink() const
DMTest::PLinks_v1::vlinks
const_el_range vlinks() const
Get the vector of links, as a const range.
Definition
PLinks_v1.cxx:39
DMTest::xAODTestReadPLinks::EL
ElementLink< DMTest::CVec > EL
Definition
xAODTestReadPLinks.h:38
DMTest::xAODTestReadPLinks::m_plinksInfoDecorVLinksKey
SG::ReadDecorHandleKey< DMTest::PLinks > m_plinksInfoDecorVLinksKey
Definition
xAODTestReadPLinks.h:91
DMTest::xAODTestReadPLinks::m_plinksInfoKey
SG::ReadHandleKey< DMTest::PLinks > m_plinksInfoKey
Definition
xAODTestReadPLinks.h:79
DMTest::xAODTestReadPLinks::m_plinksDecorVLinksKey
SG::ReadDecorHandleKey< DMTest::PLinksContainer > m_plinksDecorVLinksKey
Definition
xAODTestReadPLinks.h:85
DMTest::xAODTestReadPLinks::dumpDecor
StatusCode dumpDecor(const EventContext &ctx, const PLinks &plinks) const
Dump decorations from a PLinks object.
Definition
xAODTestReadPLinks.cxx:134
DMTest::xAODTestReadPLinks::m_plinksContainerKey
SG::ReadHandleKey< DMTest::PLinksContainer > m_plinksContainerKey
Definition
xAODTestReadPLinks.h:76
DMTest::xAODTestReadPLinks::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
xAODTestReadPLinks.cxx:74
DMTest::xAODTestReadPLinks::m_plinksInfoDecorLinkKey
SG::ReadDecorHandleKey< DMTest::PLinks > m_plinksInfoDecorLinkKey
Definition
xAODTestReadPLinks.h:88
DMTest::xAODTestReadPLinks::DL
DataLink< DMTest::CVec > DL
Definition
xAODTestReadPLinks.h:39
DMTest::xAODTestReadPLinks::m_plinksDecorLinkKey
SG::ReadDecorHandleKey< DMTest::PLinksContainer > m_plinksDecorLinkKey
Definition
xAODTestReadPLinks.h:82
DMTest::xAODTestReadPLinks::dumpPLinks
StatusCode dumpPLinks(const PLinks &plinks) const
Dump a PLinks object.
Definition
xAODTestReadPLinks.cxx:117
DMTest::xAODTestReadPLinks::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
xAODTestReadPLinks.cxx:59
DMTest::xAODTestReadPLinks::dumpInfoDecor
StatusCode dumpInfoDecor(const EventContext &ctx, const PLinks &plinks) const
Dump decorations from a standalone PLinks object.
Definition
xAODTestReadPLinks.cxx:159
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition
StoreGate/StoreGate/ReadDecorHandle.h:94
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
DMTest
Definition
B.h:23
DMTest::PLinks
PLinks_v1 PLinks
Definition
PLinks.h:23
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
TestSUSYToolsAlg.dl
dl
Definition
TestSUSYToolsAlg.py:98
python.getProblemFolderFromLogs.el
dict el
Definition
getProblemFolderFromLogs.py:51
xAODTestReadPLinks.h
Generated on
for ATLAS Offline Software by
1.17.0