ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTestReadCLinks.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
10
11
12#include "xAODTestReadCLinks.h"
14#include <format>
15#include <print>
16#include <sstream>
17
18
19namespace {
20
21
23
24
28std::string formEL (const EL& el)
29{
30 return std::format ("({}:{})",
31 el.dataID(),
32 static_cast<int>(el.index()) == -1 ? "inv" : std::to_string(el.index()));
33}
34
35
36} // anonymous namespace
37
38
39namespace DMTest {
40
41
46{
47 ATH_CHECK( m_clinksKey.initialize (SG::AllowEmpty) );
50 return StatusCode::SUCCESS;
51}
52
53
57StatusCode xAODTestReadCLinks::execute (const EventContext& ctx) const
58{
59 if (!m_clinksKey.empty()) {
62 ATH_CHECK( dumpCLinks (*clinks) );
63 }
64
65 if (!m_clinksContainerKey.empty()) {
68 for (const CLinks* clinks : *clinkscont) {
69 ATH_CHECK( dumpCLinks (*clinks) );
70 }
71 }
72
73 if (!m_clinksAODKey.empty()) {
76
77 std::ostringstream ss1;
78 std::print (ss1, " ");
79 for (const EL& el : clinksaod->vel()) {
80 std::print (ss1, "{} ", formEL (el));
81 }
82 ATH_MSG_INFO (ss1.str());
83
84 std::ostringstream ss2;
85 std::print (ss2, " ");
86 for (const EL el : clinksaod->elv()) {
87 std::print (ss2, "{} ", formEL (el));
88 }
89 ATH_MSG_INFO (ss2.str());
90 }
91
92 return StatusCode::SUCCESS;
93}
94
95
99StatusCode xAODTestReadCLinks::dumpCLinks (const CLinks& clinks) const
100{
101 std::ostringstream ss;
102 std::print (ss, " link: {} links: ", formEL (clinks.link()));
103 for (const EL& el : clinks.links()) {
104 std::print (ss, "{} ", formEL (el));
105 }
106 ATH_MSG_INFO( ss.str() );
107 return StatusCode::SUCCESS;
108}
109
110
111} // 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.