ATLAS Offline Software
Loading...
Searching...
No Matches
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"
15#include <sstream>
16
17
18namespace {
19
20
24std::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
42std::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
53namespace DMTest {
54
55
69
70
74StatusCode xAODTestReadPLinks::execute (const EventContext& ctx) const
75{
76 static const SG::ConstAccessor< SG::PackedLink<CVec> > acc_plink ( "plink" );
77
78 if (!m_plinksContainerKey.empty()) {
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()) {
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
117StatusCode 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
133StatusCode
134xAODTestReadPLinks::dumpDecor (const EventContext& ctx,
135 const PLinks& plinks) const
136{
137 std::ostringstream ss;
138 if (!m_plinksDecorLinkKey.empty()) {
140 ss << " decorLink: " << formEL (decor (plinks));
141 }
142
143 if (!m_plinksDecorVLinksKey.empty()) {
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
158StatusCode
159xAODTestReadPLinks::dumpInfoDecor (const EventContext& ctx,
160 const PLinks& plinks) const
161{
162 std::ostringstream ss;
163 if (!m_plinksInfoDecorLinkKey.empty()) {
165 ss << " decorLink: " << formEL (decor (plinks));
166 }
167
168 if (!m_plinksInfoDecorVLinksKey.empty()) {
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
static Double_t ss
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
Helper class to provide constant type-safe access to aux data.
Handle class for reading a decoration on an object.
Definition B.h:23
PLinks_v1 PLinks
Definition PLinks.h:23
This module defines the arguments passed from the BATCH driver to the BATCH worker.