Skip to content

Commit f5d37d2

Browse files
committed
ITS/MFT decoder sends vector with certain errors details
An output vector<o2::itsmft::ErrorMessage> is added with information about ChipStat::RepeatingPixel error details (at the moment, other errors may be added). Each element of ErrorMessage is assigned as: errMsg.id = chipID errMsg.errType = ChipStat::RepeatingPixel (at the moment) errMsg.errInfo0 = row errMsg.errInfo1 = col
1 parent 6374d89 commit f5d37d2

File tree

6 files changed

+44
-8
lines changed

6 files changed

+44
-8
lines changed

Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/DecodingStat.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ struct GBTLinkDecodingStat {
290290
ClassDefNV(GBTLinkDecodingStat, 3);
291291
};
292292

293+
struct ErrorMessage {
294+
uint16_t id = -1;
295+
uint16_t errType = 0;
296+
uint16_t errInfo0 = 0;
297+
uint16_t errInfo1 = 0;
298+
ClassDefNV(ErrorMessage, 1)
299+
};
300+
293301
} // namespace itsmft
294302
} // namespace o2
295303
#endif

Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RUDecodeData.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ struct RUDecodeData {
5454
bool ROFRampUpStage = false; // flag that the data come from the ROF rate ramp-up stage
5555
GBTCalibData calibData{}; // calibration info from GBT calibration word
5656
std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> chipErrorsTF{}; // vector of chip decoding errors seen in the given TF
57+
std::vector<ErrorMessage> errMsgVecTF; // Specific errors info collected for sending for the whole TF
58+
5759
const RUInfo* ruInfo = nullptr;
5860

5961
RUDecodeData()

Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ class RawPixelDecoder final : public PixelReader
6969
template <class CalibContainer>
7070
void fillCalibData(CalibContainer& calib);
7171

72-
template <class LinkErrors, class DecErrors>
73-
void collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors);
72+
template <class LinkErrors, class DecErrors, class ErrMsgs>
73+
void collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors, ErrMsgs& errInfos);
7474

7575
const RUDecodeData* getRUDecode(int ruSW) const { return mRUEntry[ruSW] < 0 ? nullptr : &mRUDecodeVec[mRUEntry[ruSW]]; }
7676
const GBTLink* getGBTLink(int i) const { return i < 0 ? nullptr : &mGBTLinks[i]; }
@@ -267,20 +267,33 @@ void RawPixelDecoder<Mapping>::fillCalibData(CalibContainer& calib)
267267

268268
///______________________________________________________________________
269269
template <class Mapping>
270-
template <class LinkErrors, class DecErrors>
271-
void RawPixelDecoder<Mapping>::collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors)
270+
template <class LinkErrors, class DecErrors, class ErrMsgs>
271+
void RawPixelDecoder<Mapping>::collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors, ErrMsgs& errInfos)
272272
{
273273
for (auto& lnk : mGBTLinks) {
274274
if (lnk.gbtErrStatUpadated) {
275275
linkErrors.push_back(lnk.statistics);
276276
lnk.gbtErrStatUpadated = false;
277277
}
278278
}
279+
size_t nerr = 0, nerrMsg = 0;
279280
for (auto& ru : mRUDecodeVec) {
280-
for (const auto& err : ru.chipErrorsTF) {
281-
decErrors.emplace_back(ChipError{err.first, err.second.first, err.second.second}); // id, nerrors, errorFlags
281+
nerr += ru.chipErrorsTF.size();
282+
nerrMsg += ru.errMsgVecTF.size();
283+
}
284+
if (nerr || nerrMsg) {
285+
decErrors.reserve(nerr);
286+
errInfos.reserve(nerrMsg);
287+
for (auto& ru : mRUDecodeVec) {
288+
for (const auto& err : ru.chipErrorsTF) {
289+
decErrors.emplace_back(ChipError{err.first, err.second.first, err.second.second}); // id, nerrors, errorFlags
290+
}
291+
for (auto& err : ru.errMsgVecTF) {
292+
errInfos.push_back(err);
293+
}
294+
ru.chipErrorsTF.clear();
295+
ru.errMsgVecTF.clear();
282296
}
283-
ru.chipErrorsTF.clear();
284297
}
285298
}
286299

Detectors/ITSMFT/common/reconstruction/src/ITSMFTReconstructionLinkDef.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,7 @@
5555
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::itsmft::ClustererParam < o2::detectors::DetID::ITS>> + ;
5656
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::itsmft::ClustererParam < o2::detectors::DetID::MFT>> + ;
5757

58+
#pragma link C++ class o2::itsmft::ErrorMessage + ;
59+
#pragma link C++ class std::vector < o2::itsmft::ErrorMessage> + ;
60+
5861
#endif

Detectors/ITSMFT/common/reconstruction/src/RUDecodeData.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ void RUDecodeData::fillChipStatistics(int icab, const ChipPixelData* chipData)
6262
auto& chErr = chipErrorsTF[compid];
6363
chErr.first++;
6464
chErr.second |= chipData->getErrorFlags();
65+
66+
if (chipData->isErrorSet(ChipStat::RepeatingPixel)) {
67+
auto& errMsg = errMsgVecTF.emplace_back();
68+
errMsg.id = chipData->getChipID();
69+
errMsg.errType = ChipStat::RepeatingPixel;
70+
errMsg.errInfo0 = chipData->getErrorInfo() & 0xffff; // row
71+
errMsg.errInfo1 = (chipData->getErrorInfo() >> 16) & 0xffff; // row
72+
}
6573
}
6674
if (action & ChipStat::ErrActDump) {
6775
linkHBFToDump[(uint64_t(cableLinkPtr[icab]->subSpec) << 32) + cableLinkPtr[icab]->hbfEntry] = cableLinkPtr[icab]->irHBF.orbit;

Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
247247
}
248248
auto& linkErrors = pc.outputs().make<std::vector<GBTLinkDecodingStat>>(Output{orig, "LinkErrors", 0});
249249
auto& decErrors = pc.outputs().make<std::vector<ChipError>>(Output{orig, "ChipErrors", 0});
250-
mDecoder->collectDecodingErrors(linkErrors, decErrors);
250+
auto& errMessages = pc.outputs().make<std::vector<ErrorMessage>>(Output{orig, "ErrorInfo", 0});
251+
mDecoder->collectDecodingErrors(linkErrors, decErrors, errMessages);
251252

252253
pc.outputs().snapshot(Output{orig, "PHYSTRIG", 0}, mDecoder->getExternalTriggers());
253254

@@ -398,6 +399,7 @@ DataProcessorSpec getSTFDecoderSpec(const STFDecoderInp& inp)
398399

399400
outputs.emplace_back(inp.origin, "LinkErrors", 0, Lifetime::Timeframe);
400401
outputs.emplace_back(inp.origin, "ChipErrors", 0, Lifetime::Timeframe);
402+
outputs.emplace_back(inp.origin, "ErrorInfo", 0, Lifetime::Timeframe);
401403
outputs.emplace_back(inp.origin, "CHIPSSTATUS", 0, Lifetime::Timeframe);
402404

403405
if (inp.askSTFDist) {

0 commit comments

Comments
 (0)