ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
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
"
13
#include "
StoreGate/ReadHandle.h
"
14
#include <sstream>
15
16
17
namespace
{
18
19
20
typedef
ElementLink<DMTest::CVec>
EL
;
21
22
26
std::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
44
namespace
DMTest
{
45
46
50
StatusCode
xAODTestReadCLinks::initialize
()
51
{
52
ATH_CHECK
(
m_clinksKey
.initialize (
SG::AllowEmpty
) );
53
ATH_CHECK
(
m_clinksContainerKey
.initialize (
SG::AllowEmpty
) );
54
ATH_CHECK
(
m_clinksAODKey
.initialize (
SG::AllowEmpty
) );
55
return
StatusCode::SUCCESS;
56
}
57
58
62
StatusCode
xAODTestReadCLinks::execute
(
const
EventContext& ctx)
const
63
{
64
if
(!
m_clinksKey
.empty()) {
65
SG::ReadHandle<CLinks>
clinks (
m_clinksKey
, ctx);
66
ATH_MSG_INFO
(
m_clinksKey
.key() );
67
ATH_CHECK
(
dumpCLinks
(*clinks) );
68
}
69
70
if
(!
m_clinksContainerKey
.empty()) {
71
SG::ReadHandle<CLinksContainer>
clinkscont (
m_clinksContainerKey
, ctx);
72
ATH_MSG_INFO
(
m_clinksContainerKey
.key() );
73
for
(
const
CLinks
* clinks : *clinkscont) {
74
ATH_CHECK
(
dumpCLinks
(*clinks) );
75
}
76
}
77
78
if
(!
m_clinksAODKey
.empty()) {
79
SG::ReadHandle<CLinksAOD>
clinksaod (
m_clinksAODKey
, ctx);
80
ATH_MSG_INFO
(
m_clinksAODKey
.key() );
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
104
StatusCode
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
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
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
ReadHandle.h
Handle class for reading from StoreGate.
DMTest::CLinks_v1::link
const ElementLink< CVec > & link() const
DMTest::CLinks_v1::links
const std::vector< ElementLink< CVec > > & links() const
DMTest::xAODTestReadCLinks::m_clinksAODKey
SG::ReadHandleKey< DMTest::CLinksAOD > m_clinksAODKey
Definition
xAODTestReadCLinks.h:63
DMTest::xAODTestReadCLinks::m_clinksContainerKey
SG::ReadHandleKey< DMTest::CLinksContainer > m_clinksContainerKey
Definition
xAODTestReadCLinks.h:60
DMTest::xAODTestReadCLinks::dumpCLinks
StatusCode dumpCLinks(const CLinks &clinks) const
Dump a CLinks object.
Definition
xAODTestReadCLinks.cxx:104
DMTest::xAODTestReadCLinks::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
xAODTestReadCLinks.cxx:62
DMTest::xAODTestReadCLinks::m_clinksKey
SG::ReadHandleKey< DMTest::CLinks > m_clinksKey
Definition
xAODTestReadCLinks.h:57
DMTest::xAODTestReadCLinks::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
xAODTestReadCLinks.cxx:50
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
DMTest
Definition
B.h:23
DMTest::CLinks
CLinks_v1 CLinks
Definition
CLinks.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
python.getProblemFolderFromLogs.el
dict el
Definition
getProblemFolderFromLogs.py:51
xAODTestReadCLinks.h
Read and dump CLinks/CLinksAOD objects.
Generated on
for ATLAS Offline Software by
1.17.0