ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTestReadCLinks.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
12#include "xAODTestReadCLinks.h"
14#include <sstream>
15
16
17namespace {
18
19
21
22
26std::string formEL (const EL& el)
27{
28 std::ostringstream ss;
29 ss << "(" << el.dataID() << ":";
30 if (static_cast<int>(el.index()) == -1) {
31 ss << "inv";
32 }
33 else {
34 ss << el.index();
35 }
36 ss << ")";
37 return ss.str();
38}
39
40
41} // anonymous namespace
42
43
44namespace DMTest {
45
46
51{
52 ATH_CHECK( m_clinksKey.initialize (SG::AllowEmpty) );
55 return StatusCode::SUCCESS;
56}
57
58
62StatusCode xAODTestReadCLinks::execute (const EventContext& ctx) const
63{
64 if (!m_clinksKey.empty()) {
67 ATH_CHECK( dumpCLinks (*clinks) );
68 }
69
70 if (!m_clinksContainerKey.empty()) {
73 for (const CLinks* clinks : *clinkscont) {
74 ATH_CHECK( dumpCLinks (*clinks) );
75 }
76 }
77
78 if (!m_clinksAODKey.empty()) {
81
82 std::ostringstream ss1;
83 ss1 << " ";
84 for (const EL& el : clinksaod->vel()) {
85 ss1 << formEL (el) << " ";
86 }
87 ATH_MSG_INFO (ss1.str());
88
89 std::ostringstream ss2;
90 ss2 << " ";
91 for (const EL el : clinksaod->elv()) {
92 ss2 << formEL (el) << " ";
93 }
94 ATH_MSG_INFO (ss2.str());
95 }
96
97 return StatusCode::SUCCESS;
98}
99
100
104StatusCode xAODTestReadCLinks::dumpCLinks (const CLinks& clinks) const
105{
106 std::ostringstream ss;
107 ss << " link: " << formEL (clinks.link()) << " links: ";
108 for (const EL& el : clinks.links()) {
109 ss << formEL (el) << " ";
110 }
111 ATH_MSG_INFO( ss.str() );
112 return StatusCode::SUCCESS;
113}
114
115
116} // 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 from StoreGate.
Definition B.h:23
CLinks_v1 CLinks
Definition CLinks.h:23
This module defines the arguments passed from the BATCH driver to the BATCH worker.