ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigDataAccess
TrigDataAccessMonitoring
src
ROBDataMonitor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <iomanip>
6
#include "
TrigDataAccessMonitoring/ROBDataMonitor.h
"
7
8
using namespace
robmonitor
;
9
10
//
11
//--- ROBDataStruct
12
// -------------
13
ROBDataStruct::ROBDataStruct
(
const
uint32_t srcId)
14
:
rob_id
(srcId)
15
{}
16
17
bool
ROBDataStruct::isUnclassified
()
const
{
18
return
((
rob_history
==
robmonitor::UNCLASSIFIED
) ?
true
:
false
);
19
}
20
21
bool
ROBDataStruct::isHLTCached
()
const
{
22
return
((
rob_history
==
robmonitor::HLT_CACHED
) ?
true
:
false
);
23
}
24
25
bool
ROBDataStruct::isDCMCached
()
const
{
26
return
((
rob_history
==
robmonitor::DCM_CACHED
) ?
true
:
false
);
27
}
28
29
bool
ROBDataStruct::isRetrieved
()
const
{
30
return
((
rob_history
==
robmonitor::RETRIEVED
) ?
true
:
false
);
31
}
32
33
bool
ROBDataStruct::isIgnored
()
const
{
34
return
((
rob_history
==
robmonitor::IGNORED
) ?
true
:
false
);
35
}
36
37
bool
ROBDataStruct::isUndefined
()
const
{
38
return
((
rob_history
==
robmonitor::UNDEFINED
) ?
true
:
false
);
39
}
40
41
bool
ROBDataStruct::isStatusOk
()
const
{
42
return
(
rob_status_word
== 0) ? true :
false
;
43
}
44
45
// Extraction operator for ROBDataStruct
46
std::ostream&
robmonitor::operator<<
(std::ostream& os,
const
ROBDataStruct
& rhs) {
47
os <<
"[SourceID,Size(words),History,(Status words)]=["
48
<< std::hex << std::setfill(
'0'
) <<
"0x"
<< std::setw(6) << rhs.
rob_id
49
<< std::dec << std::setfill(
' '
)
50
<<
","
<< std::setw(8) << rhs.
rob_size
;
51
os <<
","
<< std::setw(12);
52
if
(rhs.
rob_history
==
robmonitor::UNCLASSIFIED
) {
53
os <<
"UNCLASSIFIED"
;
54
}
else
if
(rhs.
rob_history
==
robmonitor::RETRIEVED
) {
55
os <<
"RETRIEVED"
;
56
}
else
if
(rhs.
rob_history
==
robmonitor::HLT_CACHED
) {
57
os <<
"HLT_CACHED"
;
58
}
else
if
(rhs.
rob_history
==
robmonitor::DCM_CACHED
) {
59
os <<
"DCM_CACHED"
;
60
}
else
if
(rhs.
rob_history
==
robmonitor::IGNORED
) {
61
os <<
"IGNORED"
;
62
}
else
if
(rhs.
rob_history
==
robmonitor::UNDEFINED
) {
63
os <<
"UNDEFINED"
;
64
}
else
{
65
os <<
"invalid code"
;
66
}
67
os <<
",("
;
68
os << std::hex << std::setfill(
'0'
) <<
"0x"
<< std::setw(8) << rhs.
rob_status_word
;
69
os <<
")]"
;
70
return
os;
71
}
72
73
//
74
//--- ROBDataMonitorStruct
75
// --------------------
76
ROBDataMonitorStruct::ROBDataMonitorStruct
(
const
uint32_t l1_id,
const
std::string& req_nam=
"UNKNOWN"
)
77
:
lvl1ID
(l1_id),
78
requestor_name
(req_nam)
79
{}
80
81
ROBDataMonitorStruct::ROBDataMonitorStruct
(
const
uint32_t l1_id,
82
const
std::vector<uint32_t>& req_robs,
83
const
std::string& req_nam=
"UNKNOWN"
)
84
:
lvl1ID
(l1_id),
85
requestor_name
(req_nam)
86
{
87
for
(uint32_t rob : req_robs) {
88
requested_ROBs
[ rob ] =
robmonitor::ROBDataStruct
( rob ) ;
89
}
90
}
91
92
unsigned
ROBDataMonitorStruct::allROBs
()
const
{
93
return
requested_ROBs
.size();
94
}
95
96
unsigned
ROBDataMonitorStruct::unclassifiedROBs
()
const
{
97
ptrdiff_t ret=0;
98
for
(
const
auto
& p :
requested_ROBs
) {
99
if
(p.second.isUnclassified()) ++ret;
100
}
101
return
ret;
102
}
103
104
unsigned
ROBDataMonitorStruct::HLTcachedROBs
()
const
{
105
ptrdiff_t ret=0;
106
for
(
const
auto
& p :
requested_ROBs
) {
107
if
(p.second.isHLTCached()) ++ret;
108
}
109
return
ret;
110
}
111
112
unsigned
ROBDataMonitorStruct::DCMcachedROBs
()
const
{
113
ptrdiff_t ret=0;
114
for
(
const
auto
& p :
requested_ROBs
) {
115
if
(p.second.isDCMCached()) ++ret;
116
}
117
return
ret;
118
}
119
120
unsigned
ROBDataMonitorStruct::retrievedROBs
()
const
{
121
ptrdiff_t ret=0;
122
for
(
const
auto
& p :
requested_ROBs
) {
123
if
(p.second.isRetrieved()) ++ret;
124
}
125
return
ret;
126
}
127
128
unsigned
ROBDataMonitorStruct::ignoredROBs
()
const
{
129
ptrdiff_t ret=0;
130
for
(
const
auto
& p :
requested_ROBs
) {
131
if
(p.second.isIgnored()) ++ret;
132
}
133
return
ret;
134
}
135
136
unsigned
ROBDataMonitorStruct::undefinedROBs
()
const
{
137
ptrdiff_t ret=0;
138
for
(
const
auto
& p :
requested_ROBs
) {
139
if
(p.second.isUndefined()) ++ret;
140
}
141
return
ret;
142
}
143
144
unsigned
ROBDataMonitorStruct::statusOkROBs
()
const
{
145
ptrdiff_t ret=0;
146
for
(
const
auto
& p :
requested_ROBs
) {
147
if
(p.second.isStatusOk()) ++ret;
148
}
149
return
ret;
150
}
151
152
float
ROBDataMonitorStruct::elapsedTime
()
const
{
153
float
secs = 0 ;
154
if
(
end_time
>=
start_time
)
155
secs = (
end_time
-
start_time
)/1e3;
156
return
secs;
157
}
158
159
// Extraction operator for ROBDataMonitorStruct
160
std::ostream&
robmonitor::operator<<
(std::ostream& os,
const
ROBDataMonitorStruct
& rhs) {
161
const
std::string prefix(
" "
);
162
const
std::string prefix2(
"-> "
);
163
os <<
"ROB Request for L1 ID = "
<< std::dec << rhs.
lvl1ID
<<
" (decimal), L1 ID = 0x"
164
<< std::hex << rhs.
lvl1ID
<<
" (hex)"
<< std::dec;
165
os <<
"\n"
<< prefix <<
"Requestor name = "
<< rhs.
requestor_name
;
166
167
const
std::time_t s_time(rhs.
start_time
/
static_cast<
int
>
(1e6));
168
struct
tm buf;
169
gmtime_r(&s_time, &buf);
170
os <<
"\n"
<< prefix <<
"Start time of ROB request = "
171
<< std::put_time(&buf,
"%c"
)
172
<<
" UTC + "
<< (rhs.
start_time
%
static_cast<
int
>
(1e6)) / 1000.0f <<
" [ms]"
;
173
174
const
std::time_t e_time(rhs.
end_time
/
static_cast<
int
>
(1e6));
175
gmtime_r(&e_time, &buf);
176
os <<
"\n"
<< prefix <<
"Stop time of ROB request = "
177
<< std::put_time(&buf,
"%c"
)
178
<<
" UTC + "
<< (rhs.
end_time
%
static_cast<
int
>
(1e6)) / 1000.0f <<
" [ms]"
;
179
os <<
"\n"
<< prefix <<
"Elapsed time for ROB request [ms] = "
<< rhs.
elapsedTime
();
180
os <<
"\n"
<< prefix <<
"Requested ROBs:"
;
181
os <<
"\n"
<< prefix << prefix2 <<
"All "
<< rhs.
allROBs
() ;
182
os <<
"\n"
<< prefix << prefix2 <<
"Unclassified "
<< rhs.
unclassifiedROBs
() ;
183
os <<
"\n"
<< prefix << prefix2 <<
"HLT Cached "
<< rhs.
HLTcachedROBs
() ;
184
os <<
"\n"
<< prefix << prefix2 <<
"DCM Cached "
<< rhs.
DCMcachedROBs
() ;
185
os <<
"\n"
<< prefix << prefix2 <<
"Retrieved "
<< rhs.
retrievedROBs
() ;
186
os <<
"\n"
<< prefix << prefix2 <<
"Ignored "
<< rhs.
ignoredROBs
() ;
187
os <<
"\n"
<< prefix << prefix2 <<
"Undefined "
<< rhs.
undefinedROBs
() ;
188
os <<
"\n"
<< prefix << prefix2 <<
"Status OK "
<< rhs.
statusOkROBs
() ;
189
for
(
const
auto
& [
id
, rob] : rhs.
requested_ROBs
) {
190
os <<
"\n"
<< prefix << prefix2 << rob;
191
}
192
return
os;
193
}
ROBDataMonitor.h
robmonitor::ROBDataMonitorStruct
The structure which is used to monitor the ROB data request in L2 It is created for every addROBData ...
Definition
ROBDataMonitor.h:79
robmonitor::ROBDataMonitorStruct::start_time
uint64_t start_time
map of ROBs requested
Definition
ROBDataMonitor.h:112
robmonitor::ROBDataMonitorStruct::retrievedROBs
unsigned retrievedROBs() const
number of retrieved ROBs in structure
Definition
ROBDataMonitor.cxx:120
robmonitor::ROBDataMonitorStruct::ignoredROBs
unsigned ignoredROBs() const
number of ignored ROBs in structure
Definition
ROBDataMonitor.cxx:128
robmonitor::ROBDataMonitorStruct::elapsedTime
float elapsedTime() const
elapsed time for ROB request in [ms]
Definition
ROBDataMonitor.cxx:152
robmonitor::ROBDataMonitorStruct::HLTcachedROBs
unsigned HLTcachedROBs() const
number of ROBDataProviderSvc cached ROBs in structure
Definition
ROBDataMonitor.cxx:104
robmonitor::ROBDataMonitorStruct::lvl1ID
uint32_t lvl1ID
Definition
ROBDataMonitor.h:107
robmonitor::ROBDataMonitorStruct::undefinedROBs
unsigned undefinedROBs() const
number of undefined ROBs in structure
Definition
ROBDataMonitor.cxx:136
robmonitor::ROBDataMonitorStruct::requested_ROBs
std::map< const uint32_t, robmonitor::ROBDataStruct > requested_ROBs
name of requesting algorithm
Definition
ROBDataMonitor.h:109
robmonitor::ROBDataMonitorStruct::statusOkROBs
unsigned statusOkROBs() const
number of ROBs with no status words set in structure
Definition
ROBDataMonitor.cxx:144
robmonitor::ROBDataMonitorStruct::allROBs
unsigned allROBs() const
stop time of ROB request (microsec since epoch)
Definition
ROBDataMonitor.cxx:92
robmonitor::ROBDataMonitorStruct::requestor_name
std::string requestor_name
current L1 ID from L1 ROBs
Definition
ROBDataMonitor.h:108
robmonitor::ROBDataMonitorStruct::ROBDataMonitorStruct
ROBDataMonitorStruct()=default
default constructor
robmonitor::ROBDataMonitorStruct::unclassifiedROBs
unsigned unclassifiedROBs() const
number of unclassified ROBs in structure
Definition
ROBDataMonitor.cxx:96
robmonitor::ROBDataMonitorStruct::end_time
uint64_t end_time
start time of ROB request (microsec since epoch)
Definition
ROBDataMonitor.h:113
robmonitor::ROBDataMonitorStruct::DCMcachedROBs
unsigned DCMcachedROBs() const
number of DCM cached ROBs in structure
Definition
ROBDataMonitor.cxx:112
robmonitor::ROBDataStruct
A structure with data about ROB properties.
Definition
ROBDataMonitor.h:37
robmonitor::ROBDataStruct::rob_status_word
uint32_t rob_status_word
Definition
ROBDataMonitor.h:52
robmonitor::ROBDataStruct::ROBDataStruct
ROBDataStruct()=default
default constructor
robmonitor::ROBDataStruct::isUndefined
bool isUndefined() const
ROB was not enabled.
Definition
ROBDataMonitor.cxx:37
robmonitor::ROBDataStruct::rob_size
uint32_t rob_size
Definition
ROBDataMonitor.h:50
robmonitor::ROBDataStruct::isIgnored
bool isIgnored() const
ROB was ignored.
Definition
ROBDataMonitor.cxx:33
robmonitor::ROBDataStruct::rob_id
uint32_t rob_id
Definition
ROBDataMonitor.h:49
robmonitor::ROBDataStruct::isHLTCached
bool isHLTCached() const
ROB was found in ROBDataProviderSvc cache.
Definition
ROBDataMonitor.cxx:21
robmonitor::ROBDataStruct::isStatusOk
bool isStatusOk() const
ROB has no status words set.
Definition
ROBDataMonitor.cxx:41
robmonitor::ROBDataStruct::isUnclassified
bool isUnclassified() const
ROB is unclassified.
Definition
ROBDataMonitor.cxx:17
robmonitor::ROBDataStruct::isRetrieved
bool isRetrieved() const
ROB was retrieved over network.
Definition
ROBDataMonitor.cxx:29
robmonitor::ROBDataStruct::isDCMCached
bool isDCMCached() const
ROB was found in DCM cache.
Definition
ROBDataMonitor.cxx:25
robmonitor::ROBDataStruct::rob_history
robmonitor::ROBHistory rob_history
Definition
ROBDataMonitor.h:51
robmonitor
Definition
ROBDataMonitor.h:19
robmonitor::operator<<
std::ostream & operator<<(std::ostream &os, const ROBDataStruct &rhs)
Definition
ROBDataMonitor.cxx:46
robmonitor::RETRIEVED
@ RETRIEVED
Definition
ROBDataMonitor.h:26
robmonitor::DCM_CACHED
@ DCM_CACHED
Definition
ROBDataMonitor.h:28
robmonitor::UNDEFINED
@ UNDEFINED
Definition
ROBDataMonitor.h:30
robmonitor::UNCLASSIFIED
@ UNCLASSIFIED
Definition
ROBDataMonitor.h:25
robmonitor::HLT_CACHED
@ HLT_CACHED
Definition
ROBDataMonitor.h:27
robmonitor::IGNORED
@ IGNORED
Definition
ROBDataMonitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0