ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ZDC
ZdcCnv
ZdcByteStream
src
ZdcL1CaloErrorByteStreamTool.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 "
ZdcByteStream/ZdcL1CaloErrorByteStreamTool.h
"
13
14
//namespace LVL1BS {
15
16
// Interface ID
17
18
static
const
InterfaceID
IID_IZdcL1CaloErrorByteStreamTool
(
19
"L1CaloErrorByteStreamTool"
, 1, 1);
20
21
const
InterfaceID&
ZdcL1CaloErrorByteStreamTool::interfaceID
()
22
{
23
return
IID_IZdcL1CaloErrorByteStreamTool
;
24
}
25
26
// Constructor
27
28
ZdcL1CaloErrorByteStreamTool::ZdcL1CaloErrorByteStreamTool
(
const
std::string&
type
,
29
const
std::string& name,
30
const
IInterface* parent)
31
:
AthAlgTool
(
type
, name, parent)
32
{
33
declareInterface<ZdcL1CaloErrorByteStreamTool>(
this
);
34
}
35
36
37
// Set ROB status error
38
39
void
ZdcL1CaloErrorByteStreamTool::robError
(
const
uint32_t robid,
40
const
unsigned
int
err)
const
41
{
42
ErrorMaps
& maps = *m_maps;
43
std::scoped_lock
lock
(maps.
m_mutex
);
44
if
(err && maps.
m_robMap
.find(robid) == maps.
m_robMap
.end()) {
45
maps.
m_robMap
.insert(std::make_pair(robid, err));
46
}
47
return
;
48
}
49
50
// Set ROD unpacking error
51
52
void
ZdcL1CaloErrorByteStreamTool::rodError
(
const
uint32_t robid,
53
const
unsigned
int
err)
const
54
{
55
ErrorMaps
& maps = *m_maps;
56
std::scoped_lock
lock
(maps.
m_mutex
);
57
if
(err && maps.
m_rodMap
.find(robid) == maps.
m_rodMap
.end()) {
58
maps.
m_rodMap
.insert(std::make_pair(robid, err));
59
}
60
return
;
61
}
62
63
// Fill vector with accumulated errors and reset
64
65
StatusCode
ZdcL1CaloErrorByteStreamTool::errors
(std::vector<unsigned int>*
66
const
errColl)
const
67
{
68
ErrorMaps
& maps = *m_maps;
69
std::scoped_lock
lock
(maps.
m_mutex
);
70
if
(!maps.
m_robMap
.empty() || !maps.
m_rodMap
.empty()) {
71
errColl->push_back(maps.
m_robMap
.size());
72
ErrorMap::const_iterator iter = maps.
m_robMap
.begin();
73
ErrorMap::const_iterator iterE = maps.
m_robMap
.end();
74
for
(; iter != iterE; ++iter) {
75
errColl->push_back(iter->first);
76
errColl->push_back(iter->second);
77
}
78
maps.
m_robMap
.clear();
79
iter = maps.
m_rodMap
.begin();
80
iterE = maps.
m_rodMap
.end();
81
for
(; iter != iterE; ++iter) {
82
errColl->push_back(iter->first);
83
errColl->push_back(iter->second);
84
}
85
maps.
m_rodMap
.clear();
86
}
87
return
StatusCode::SUCCESS;
88
}
89
90
//} // end namespace
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
IID_IZdcL1CaloErrorByteStreamTool
static const InterfaceID IID_IZdcL1CaloErrorByteStreamTool("L1CaloErrorByteStreamTool", 1, 1)
ZdcL1CaloErrorByteStreamTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
ZdcL1CaloErrorByteStreamTool::rodError
void rodError(uint32_t robid, unsigned int err) const
Set ROD unpacking error.
Definition
ZdcL1CaloErrorByteStreamTool.cxx:52
ZdcL1CaloErrorByteStreamTool::errors
StatusCode errors(std::vector< unsigned int > *errColl) const
Fill vector with accumulated errors and reset.
Definition
ZdcL1CaloErrorByteStreamTool.cxx:65
ZdcL1CaloErrorByteStreamTool::interfaceID
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
Definition
ZdcL1CaloErrorByteStreamTool.cxx:21
ZdcL1CaloErrorByteStreamTool::ZdcL1CaloErrorByteStreamTool
ZdcL1CaloErrorByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ZdcL1CaloErrorByteStreamTool.cxx:28
ZdcL1CaloErrorByteStreamTool::robError
void robError(uint32_t robid, unsigned int err) const
Set ROB status error.
Definition
ZdcL1CaloErrorByteStreamTool.cxx:39
type
ZdcL1CaloErrorByteStreamTool::ErrorMaps
Definition
ZdcL1CaloErrorByteStreamTool.h:50
ZdcL1CaloErrorByteStreamTool::ErrorMaps::m_robMap
ErrorMap m_robMap
Definition
ZdcL1CaloErrorByteStreamTool.h:52
ZdcL1CaloErrorByteStreamTool::ErrorMaps::m_mutex
std::mutex m_mutex
Definition
ZdcL1CaloErrorByteStreamTool.h:54
ZdcL1CaloErrorByteStreamTool::ErrorMaps::m_rodMap
ErrorMap m_rodMap
Definition
ZdcL1CaloErrorByteStreamTool.h:53
Generated on
for ATLAS Offline Software by
1.17.0