ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigMonitoringEvent
src
TrigMonROBData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// C/C++
6
#include <iostream>
7
#include <sstream>
8
9
#include "
AthenaKernel/errorcheck.h
"
10
#include "
TrigMonitoringEvent/TrigMonROB.h
"
11
12
namespace
ROBbits
13
{
14
const
uint32_t
maskHistory
= 0x0000000f;
15
const
uint32_t
maskStatus
= 0x000000f0;
16
const
uint32_t
maskState
= 0x000000ff;
17
const
uint32_t
maskSize
= 0xffffff00;
18
const
uint32_t
shiftSize
= 8;
19
}
20
21
22
//--------------------------------------------------------------------------------------
23
TrigMonROBData::TrigMonROBData
()
24
:
m_rob_id
(0),
25
m_word
(0)
26
{
27
}
28
29
//--------------------------------------------------------------------------------------
30
TrigMonROBData::TrigMonROBData
(uint32_t rob_id, uint32_t rob_size)
31
:
m_rob_id
(rob_id),
32
m_word
(0)
33
{
34
if
(rob_size >= 16777215) {
35
REPORT_MESSAGE_WITH_CONTEXT
(MSG::ERROR,
"TrigMonROBData"
)
36
<<
"Size out of range"
;
37
}
38
else
{
39
m_word
|= (rob_size <<
ROBbits::shiftSize
);
40
}
41
}
42
43
//--------------------------------------------------------------------------------------
44
void
TrigMonROBData::setHistory
(
History
hist)
45
{
46
//
47
// Set history enum.
48
//
49
m_word
=
m_word
& (
~ROBbits
::maskHistory);
50
m_word
|= hist;
51
}
52
53
//--------------------------------------------------------------------------------------
54
void
TrigMonROBData::setStatusOK
()
55
{
56
//
57
// Set status bit
58
//
59
m_word
|=
kOK
;
60
}
61
62
//--------------------------------------------------------------------------------------
63
void
TrigMonROBData::setStatusPREFETCH
()
64
{
65
//
66
// Set status bit
67
//
68
m_word
|=
kPREFETCH
;
69
}
70
71
//--------------------------------------------------------------------------------------
72
bool
TrigMonROBData::isStatusOk
()
const
73
{
74
//
75
// Return status bit
76
//
77
return
(
m_word
&
kOK
);
78
}
79
80
//--------------------------------------------------------------------------------------
81
bool
TrigMonROBData::isStatusPrefetched
()
const
82
{
83
//
84
// Return status bit
85
//
86
return
(
m_word
&
kPREFETCH
);
87
}
88
89
//--------------------------------------------------------------------------------------
90
uint32_t
TrigMonROBData::getROBSize
()
const
91
{
92
//
93
// Get data size
94
//
95
return
((
m_word
&
ROBbits::maskSize
) >>
ROBbits::shiftSize
);
96
}
97
98
//--------------------------------------------------------------------------------------
99
uint32_t
TrigMonROBData::getEncodedState
()
const
100
{
101
//
102
// Return encoded Status and History integer
103
//
104
return
(
m_word
&
ROBbits::maskState
);
105
}
106
107
//--------------------------------------------------------------------------------------
108
TrigMonROBData::History
TrigMonROBData::getHistory
()
const
109
{
110
//
111
// Mask history bits and get history
112
//
113
return
Trig::getROBHistory
(
m_word
);
114
}
115
116
//--------------------------------------------------------------------------------------
117
TrigMonROBData::Status
TrigMonROBData::getStatus
()
const
118
{
119
//
120
// Mask status bits and get status
121
//
122
return
Trig::getROBStatus
(
m_word
);
123
}
124
125
//--------------------------------------------------------------------------------------
126
void
TrigMonROBData::print
(std::ostream &os)
const
127
{
128
os <<
str
(*
this
) <<
"\n"
;
129
}
130
131
//--------------------------------------------------------------------------------------
132
std::string
str
(
const
TrigMonROBData
&o)
133
{
134
std::stringstream
str
;
135
str
<<
"TrigMonROBData: rob id="
<< o.
getROBId
()
136
<<
" size="
<< o.
getROBSize
();
137
138
return
str
.str();
139
}
140
141
//--------------------------------------------------------------------------------------
142
TrigMonROBData::History
Trig::getROBHistory
(
unsigned
int
val)
143
{
144
const
uint32_t hist = val &
ROBbits::maskHistory
;
145
146
if
(hist == 1)
return
TrigMonROBData::kRETRIEVED
;
147
if
(hist == 2)
return
TrigMonROBData::kCACHED
;
148
if
(hist == 4)
return
TrigMonROBData::kIGNORED
;
149
if
(hist == 8)
return
TrigMonROBData::kDISABLED
;
150
151
return
TrigMonROBData::kUNCLASSIFIED
;
152
}
153
154
//--------------------------------------------------------------------------------------
155
TrigMonROBData::Status
Trig::getROBStatus
(
unsigned
int
val)
156
{
157
const
uint32_t stat = val &
ROBbits::maskStatus
;
158
159
if
(stat &
TrigMonROBData::kOK
)
return
TrigMonROBData::kOK
;
160
if
(stat &
TrigMonROBData::kPREFETCH
)
return
TrigMonROBData::kPREFETCH
;
161
162
return
TrigMonROBData::kUNKNOWN
;
163
}
164
165
//--------------------------------------------------------------------------------------
166
std::string
Trig::AsStringROBHistory
(
TrigMonROBData::History
hist)
167
{
168
if
(hist ==
TrigMonROBData::kUNCLASSIFIED
)
return
"UNCLASSIFIED"
;
169
if
(hist ==
TrigMonROBData::kRETRIEVED
)
return
"RETRIEVED"
;
170
if
(hist ==
TrigMonROBData::kCACHED
)
return
"CACHED"
;
171
if
(hist ==
TrigMonROBData::kIGNORED
)
return
"IGNORED"
;
172
if
(hist ==
TrigMonROBData::kDISABLED
)
return
"DISABLED"
;
173
174
return
"UNCLASSIFIED"
;
175
}
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:345
TrigMonROB.h
TrigMonROBData
Definition
TrigMonROBData.h:27
TrigMonROBData::isStatusOk
bool isStatusOk() const
Definition
TrigMonROBData.cxx:72
TrigMonROBData::print
void print(std::ostream &os=std::cout) const
Definition
TrigMonROBData.cxx:126
TrigMonROBData::Status
Status
Definition
TrigMonROBData.h:37
TrigMonROBData::kUNKNOWN
@ kUNKNOWN
Definition
TrigMonROBData.h:38
TrigMonROBData::kOK
@ kOK
Definition
TrigMonROBData.h:40
TrigMonROBData::kPREFETCH
@ kPREFETCH
Definition
TrigMonROBData.h:39
TrigMonROBData::m_word
uint32_t m_word
Definition
TrigMonROBData.h:72
TrigMonROBData::isStatusPrefetched
bool isStatusPrefetched() const
Definition
TrigMonROBData.cxx:81
TrigMonROBData::History
History
Definition
TrigMonROBData.h:30
TrigMonROBData::kCACHED
@ kCACHED
Definition
TrigMonROBData.h:33
TrigMonROBData::kIGNORED
@ kIGNORED
Definition
TrigMonROBData.h:34
TrigMonROBData::kRETRIEVED
@ kRETRIEVED
Definition
TrigMonROBData.h:32
TrigMonROBData::kDISABLED
@ kDISABLED
Definition
TrigMonROBData.h:35
TrigMonROBData::kUNCLASSIFIED
@ kUNCLASSIFIED
Definition
TrigMonROBData.h:31
TrigMonROBData::getROBSize
uint32_t getROBSize() const
Definition
TrigMonROBData.cxx:90
TrigMonROBData::m_rob_id
uint32_t m_rob_id
Definition
TrigMonROBData.h:71
TrigMonROBData::setStatusOK
void setStatusOK()
Definition
TrigMonROBData.cxx:54
TrigMonROBData::setHistory
void setHistory(History hist)
Definition
TrigMonROBData.cxx:44
TrigMonROBData::TrigMonROBData
TrigMonROBData()
Definition
TrigMonROBData.cxx:23
TrigMonROBData::getStatus
Status getStatus() const
Definition
TrigMonROBData.cxx:117
TrigMonROBData::getEncodedState
uint32_t getEncodedState() const
Definition
TrigMonROBData.cxx:99
TrigMonROBData::getROBId
uint32_t getROBId() const
Definition
TrigMonROBData.h:59
TrigMonROBData::setStatusPREFETCH
void setStatusPREFETCH()
Definition
TrigMonROBData.cxx:63
TrigMonROBData::getHistory
History getHistory() const
Definition
TrigMonROBData.cxx:108
ROBbits
Definition
TrigMonROBData.cxx:13
ROBbits::maskState
const uint32_t maskState
Definition
TrigMonROBData.cxx:16
ROBbits::maskHistory
const uint32_t maskHistory
Definition
TrigMonROBData.cxx:14
ROBbits::maskSize
const uint32_t maskSize
Definition
TrigMonROBData.cxx:17
ROBbits::shiftSize
const uint32_t shiftSize
Definition
TrigMonROBData.cxx:18
ROBbits::maskStatus
const uint32_t maskStatus
Definition
TrigMonROBData.cxx:15
Trig::getROBStatus
TrigMonROBData::Status getROBStatus(unsigned int val)
Definition
TrigMonROBData.cxx:155
Trig::getROBHistory
TrigMonROBData::History getROBHistory(unsigned int val)
Definition
TrigMonROBData.cxx:142
Trig::AsStringROBHistory
std::string AsStringROBHistory(TrigMonROBData::History hist)
Definition
TrigMonROBData.cxx:166
str
Definition
BTagTrackIpAccessor.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0