ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
SCT_RawDataByteStreamCnv
src
SCTEventFlagWriter.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 "
SCTEventFlagWriter.h
"
6
7
#include "
SCT_ConditionsTools/ISCT_ByteStreamErrorsTool.h
"
8
9
// Constructor
10
11
SCTEventFlagWriter::SCTEventFlagWriter
(
const
std::string& name, ISvcLocator* pSvcLocator) :
12
AthReentrantAlgorithm
(name, pSvcLocator)
13
{
14
}
15
16
// Initialize
17
18
StatusCode
SCTEventFlagWriter::initialize
()
19
{
20
ATH_CHECK
(
m_bsErrTool
.retrieve());
21
ATH_CHECK
(
m_xAODEvtInfoKey
.initialize());
22
23
return
StatusCode::SUCCESS;
24
}
25
26
// Execute
27
28
StatusCode
SCTEventFlagWriter::execute
(
const
EventContext& ctx)
const
29
{
30
long
unsigned
int
nLVL1IDErrors{
m_bsErrTool
->getErrorSet(SCT_ByteStreamErrors::LVL1IDError, ctx).size()};
31
long
unsigned
int
nROBFragmentErrors{
m_bsErrTool
->getErrorSet(SCT_ByteStreamErrors::ROBFragmentError, ctx).size()};
32
33
if
((nLVL1IDErrors > 500) or (nROBFragmentErrors > 1000)) {
// Check if number of errors exceed threshold
34
bool
setOK_xAOD{
false
};
35
SG::ReadHandle<xAOD::EventInfo>
xAODEvtInfo{
m_xAODEvtInfoKey
, ctx};
// Retrieve xAOD EventInfo
36
if
(xAODEvtInfo.
isValid
()) {
// Retrieving xAOD EventInfo successful
37
setOK_xAOD = xAODEvtInfo->updateErrorState(
xAOD::EventInfo::SCT
,
xAOD::EventInfo::Error
);
38
}
39
if
(not setOK_xAOD) {
40
ATH_MSG_ERROR
(
"Failed to retrieve EventInfo containers or to update error state"
);
41
return
StatusCode::RECOVERABLE;
42
}
43
}
44
45
return
StatusCode::SUCCESS;
46
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ISCT_ByteStreamErrorsTool.h
interface file for tool that keeps track of errors in the bytestream.
SCTEventFlagWriter.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SCTEventFlagWriter::execute
virtual StatusCode execute(const EventContext &ctx) const override
Execute.
Definition
SCTEventFlagWriter.cxx:28
SCTEventFlagWriter::SCTEventFlagWriter
SCTEventFlagWriter(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
SCTEventFlagWriter.cxx:11
SCTEventFlagWriter::m_xAODEvtInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_xAODEvtInfoKey
Read handle for the xAOD event info.
Definition
SCTEventFlagWriter.h:52
SCTEventFlagWriter::m_bsErrTool
ToolHandle< ISCT_ByteStreamErrorsTool > m_bsErrTool
Tool that keeps track of modules that give rise to errors in the bytestream.
Definition
SCTEventFlagWriter.h:48
SCTEventFlagWriter::initialize
virtual StatusCode initialize() override
Initialize.
Definition
SCTEventFlagWriter.cxx:18
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::EventInfo_v1::SCT
@ SCT
The SCT.
Definition
EventInfo_v1.h:333
xAOD::EventInfo_v1::Error
@ Error
The sub-detector issued an error.
Definition
EventInfo_v1.h:349
Generated on
for ATLAS Offline Software by
1.17.0