Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITS/MFT decoder sends vector with certain errors details #13829

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ struct GBTLinkDecodingStat {
ClassDefNV(GBTLinkDecodingStat, 3);
};

struct ErrorMessage {
uint16_t id = -1;
uint16_t errType = 0;
uint16_t errInfo0 = 0;
uint16_t errInfo1 = 0;
ClassDefNV(ErrorMessage, 1)
};

} // namespace itsmft
} // namespace o2
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct RUDecodeData {
bool ROFRampUpStage = false; // flag that the data come from the ROF rate ramp-up stage
GBTCalibData calibData{}; // calibration info from GBT calibration word
std::unordered_map<uint32_t, std::pair<uint32_t, uint32_t>> chipErrorsTF{}; // vector of chip decoding errors seen in the given TF
std::vector<ErrorMessage> errMsgVecTF; // Specific errors info collected for sending for the whole TF

const RUInfo* ruInfo = nullptr;

RUDecodeData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class RawPixelDecoder final : public PixelReader
template <class CalibContainer>
void fillCalibData(CalibContainer& calib);

template <class LinkErrors, class DecErrors>
void collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors);
template <class LinkErrors, class DecErrors, class ErrMsgs>
void collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors, ErrMsgs& errInfos);

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

///______________________________________________________________________
template <class Mapping>
template <class LinkErrors, class DecErrors>
void RawPixelDecoder<Mapping>::collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors)
template <class LinkErrors, class DecErrors, class ErrMsgs>
void RawPixelDecoder<Mapping>::collectDecodingErrors(LinkErrors& linkErrors, DecErrors& decErrors, ErrMsgs& errInfos)
{
for (auto& lnk : mGBTLinks) {
if (lnk.gbtErrStatUpadated) {
linkErrors.push_back(lnk.statistics);
lnk.gbtErrStatUpadated = false;
}
}
size_t nerr = 0, nerrMsg = 0;
for (auto& ru : mRUDecodeVec) {
for (const auto& err : ru.chipErrorsTF) {
decErrors.emplace_back(ChipError{err.first, err.second.first, err.second.second}); // id, nerrors, errorFlags
nerr += ru.chipErrorsTF.size();
nerrMsg += ru.errMsgVecTF.size();
}
if (nerr || nerrMsg) {
decErrors.reserve(nerr);
errInfos.reserve(nerrMsg);
for (auto& ru : mRUDecodeVec) {
for (const auto& err : ru.chipErrorsTF) {
decErrors.emplace_back(ChipError{err.first, err.second.first, err.second.second}); // id, nerrors, errorFlags
}
for (auto& err : ru.errMsgVecTF) {
errInfos.push_back(err);
}
ru.chipErrorsTF.clear();
ru.errMsgVecTF.clear();
}
ru.chipErrorsTF.clear();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::itsmft::ClustererParam < o2::detectors::DetID::ITS>> + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::itsmft::ClustererParam < o2::detectors::DetID::MFT>> + ;

#pragma link C++ class o2::itsmft::ErrorMessage + ;
#pragma link C++ class std::vector < o2::itsmft::ErrorMessage> + ;

#endif
8 changes: 8 additions & 0 deletions Detectors/ITSMFT/common/reconstruction/src/RUDecodeData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ void RUDecodeData::fillChipStatistics(int icab, const ChipPixelData* chipData)
auto& chErr = chipErrorsTF[compid];
chErr.first++;
chErr.second |= chipData->getErrorFlags();

if (chipData->isErrorSet(ChipStat::RepeatingPixel)) {
auto& errMsg = errMsgVecTF.emplace_back();
errMsg.id = chipData->getChipID();
errMsg.errType = ChipStat::RepeatingPixel;
errMsg.errInfo0 = chipData->getErrorInfo() & 0xffff; // row
errMsg.errInfo1 = (chipData->getErrorInfo() >> 16) & 0xffff; // row
}
}
if (action & ChipStat::ErrActDump) {
linkHBFToDump[(uint64_t(cableLinkPtr[icab]->subSpec) << 32) + cableLinkPtr[icab]->hbfEntry] = cableLinkPtr[icab]->irHBF.orbit;
Expand Down
4 changes: 3 additions & 1 deletion Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
}
auto& linkErrors = pc.outputs().make<std::vector<GBTLinkDecodingStat>>(Output{orig, "LinkErrors", 0});
auto& decErrors = pc.outputs().make<std::vector<ChipError>>(Output{orig, "ChipErrors", 0});
mDecoder->collectDecodingErrors(linkErrors, decErrors);
auto& errMessages = pc.outputs().make<std::vector<ErrorMessage>>(Output{orig, "ErrorInfo", 0});
mDecoder->collectDecodingErrors(linkErrors, decErrors, errMessages);

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

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

outputs.emplace_back(inp.origin, "LinkErrors", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "ChipErrors", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "ErrorInfo", 0, Lifetime::Timeframe);
outputs.emplace_back(inp.origin, "CHIPSSTATUS", 0, Lifetime::Timeframe);

if (inp.askSTFDist) {
Expand Down
Loading