Skip to content

Commit 8b6178d

Browse files
committed
Make decoding errors treatment more robust
1 parent 223a52e commit 8b6178d

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct ChipStat {
5555
"Data truncated after LongData", // TruncatedLondData
5656
"LongData pattern has highest bit set", // WrongDataLongPattern
5757
"Region is not followed by Short or Long data", // NoDataFound
58-
"Unknow word" // UnknownWord
58+
"Unknown word" // UnknownWord
5959
};
6060

6161
uint16_t id = -1;

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,19 @@ int RUDecodeData::decodeROF(const Mapping& mp)
8181
auto chIdGetter = [this, &mp, cabHW](int cid) {
8282
return mp.getGlobalChipID(cid, cabHW, *this->ruInfo);
8383
};
84-
while (AlpideCoder::decodeChip(*chipData, cableData[icab], chIdGetter) || chipData->isErrorSet()) { // we register only chips with hits or errors flags set
84+
int ret = 0;
85+
while ((ret = AlpideCoder::decodeChip(*chipData, cableData[icab], chIdGetter)) || chipData->isErrorSet()) { // we register only chips with hits or errors flags set
8586
setROFInfo(chipData, cableLinkPtr[icab]);
86-
ntot += chipData->getData().size();
8787
#ifdef ALPIDE_DECODING_STAT
8888
fillChipStatistics(icab, chipData);
8989
#endif
90-
if (++nChipsFired < chipsData.size()) { // fetch next free chip
91-
chipData = &chipsData[nChipsFired];
92-
} else {
93-
break; // last chip decoded
90+
if (ret >= 0 && !chipData->isErrorSet()) { // make sure there was no error
91+
ntot += chipData->getData().size();
92+
if (++nChipsFired < chipsData.size()) { // fetch next free chip
93+
chipData = &chipsData[nChipsFired];
94+
} else {
95+
break; // last chip decoded
96+
}
9497
}
9598
}
9699
}

0 commit comments

Comments
 (0)