ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloByteStream
src
L1CaloErrorByteStreamTool.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
6
#include <utility>
7
8
#include "GaudiKernel/IInterface.h"
9
#include "GaudiKernel/MsgStream.h"
10
#include "GaudiKernel/StatusCode.h"
11
12
#include "
L1CaloErrorByteStreamTool.h
"
13
14
namespace
LVL1BS
{
15
16
// Interface ID
17
18
static
const
InterfaceID
IID_IL1CaloErrorByteStreamTool
(
19
"L1CaloErrorByteStreamTool"
, 1, 1);
20
21
const
InterfaceID&
L1CaloErrorByteStreamTool::interfaceID
()
22
{
23
return
IID_IL1CaloErrorByteStreamTool
;
24
}
25
26
// Constructor
27
28
L1CaloErrorByteStreamTool::L1CaloErrorByteStreamTool
(
const
std::string&
type
,
29
const
std::string& name,
30
const
IInterface* parent)
31
:
AthAlgTool
(
type
, name, parent)
32
{
33
declareInterface<L1CaloErrorByteStreamTool>(
this
);
34
}
35
36
// Destructor
37
38
L1CaloErrorByteStreamTool::~L1CaloErrorByteStreamTool
()
39
{
40
}
41
42
// Initialize
43
44
45
StatusCode
L1CaloErrorByteStreamTool::initialize
()
46
{
47
msg
(MSG::INFO) <<
"Initializing "
<< name() <<
endmsg
;
48
49
return
StatusCode::SUCCESS;
50
}
51
52
// Finalize
53
54
StatusCode
L1CaloErrorByteStreamTool::finalize
()
55
{
56
return
StatusCode::SUCCESS;
57
}
58
59
// Set ROB status error
60
61
void
L1CaloErrorByteStreamTool::robError
(
const
uint32_t robid,
62
const
unsigned
int
err)
const
63
{
64
ErrorMaps
& maps = *m_maps;
65
std::scoped_lock
lock
(maps.
m_mutex
);
66
if
(err && maps.
m_robMap
.find(robid) == maps.
m_robMap
.end()) {
67
maps.
m_robMap
.insert(std::make_pair(robid, err));
68
}
69
return
;
70
}
71
72
// Set ROD unpacking error
73
74
void
L1CaloErrorByteStreamTool::rodError
(
const
uint32_t robid,
75
const
unsigned
int
err)
const
76
{
77
ErrorMaps
& maps = *m_maps;
78
std::scoped_lock
lock
(maps.
m_mutex
);
79
if
(err && maps.
m_rodMap
.find(robid) == maps.
m_rodMap
.end()) {
80
maps.
m_rodMap
.insert(std::make_pair(robid, err));
81
}
82
return
;
83
}
84
85
// Fill vector with accumulated errors and reset
86
87
StatusCode
L1CaloErrorByteStreamTool::errors
(std::vector<unsigned int>*
88
const
errColl)
const
89
{
90
ErrorMaps
& maps = *m_maps;
91
std::scoped_lock
lock
(maps.
m_mutex
);
92
if
(!maps.
m_robMap
.empty() || !maps.
m_rodMap
.empty()) {
93
errColl->push_back(maps.
m_robMap
.size());
94
ErrorMap::const_iterator iter = maps.
m_robMap
.begin();
95
ErrorMap::const_iterator iterE = maps.
m_robMap
.end();
96
for
(; iter != iterE; ++iter) {
97
errColl->push_back(iter->first);
98
errColl->push_back(iter->second);
99
}
100
maps.
m_robMap
.clear();
101
iter = maps.
m_rodMap
.begin();
102
iterE = maps.
m_rodMap
.end();
103
for
(; iter != iterE; ++iter) {
104
errColl->push_back(iter->first);
105
errColl->push_back(iter->second);
106
}
107
maps.
m_rodMap
.clear();
108
}
109
return
StatusCode::SUCCESS;
110
}
111
112
}
// end namespace
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
L1CaloErrorByteStreamTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
LVL1BS::L1CaloErrorByteStreamTool::L1CaloErrorByteStreamTool
L1CaloErrorByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
L1CaloErrorByteStreamTool.cxx:28
LVL1BS::L1CaloErrorByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition
L1CaloErrorByteStreamTool.cxx:21
LVL1BS::L1CaloErrorByteStreamTool::finalize
virtual StatusCode finalize() override
Definition
L1CaloErrorByteStreamTool.cxx:54
LVL1BS::L1CaloErrorByteStreamTool::rodError
void rodError(uint32_t robid, unsigned int err) const
Set ROD unpacking error.
Definition
L1CaloErrorByteStreamTool.cxx:74
LVL1BS::L1CaloErrorByteStreamTool::initialize
virtual StatusCode initialize() override
Definition
L1CaloErrorByteStreamTool.cxx:45
LVL1BS::L1CaloErrorByteStreamTool::robError
void robError(uint32_t robid, unsigned int err) const
Set ROB status error.
Definition
L1CaloErrorByteStreamTool.cxx:61
LVL1BS::L1CaloErrorByteStreamTool::errors
StatusCode errors(std::vector< unsigned int > *errColl) const
Fill vector with accumulated errors and reset.
Definition
L1CaloErrorByteStreamTool.cxx:87
LVL1BS::L1CaloErrorByteStreamTool::~L1CaloErrorByteStreamTool
virtual ~L1CaloErrorByteStreamTool()
Definition
L1CaloErrorByteStreamTool.cxx:38
LVL1BS
Definition
ZdcModifySlices.h:10
LVL1BS::IID_IL1CaloErrorByteStreamTool
static const InterfaceID IID_IL1CaloErrorByteStreamTool("L1CaloErrorByteStreamTool", 1, 1)
type
LVL1BS::L1CaloErrorByteStreamTool::ErrorMaps
Definition
L1CaloErrorByteStreamTool.h:53
LVL1BS::L1CaloErrorByteStreamTool::ErrorMaps::m_rodMap
ErrorMap m_rodMap
Definition
L1CaloErrorByteStreamTool.h:56
LVL1BS::L1CaloErrorByteStreamTool::ErrorMaps::m_robMap
ErrorMap m_robMap
Definition
L1CaloErrorByteStreamTool.h:55
LVL1BS::L1CaloErrorByteStreamTool::ErrorMaps::m_mutex
std::mutex m_mutex
Definition
L1CaloErrorByteStreamTool.h:57
Generated on
for ATLAS Offline Software by
1.17.0