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

Do not encode TDC errors to compressed output stream #5180

Merged
merged 2 commits into from Jan 14, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Detectors/TOF/compression/src/Compressor.cxx
Expand Up @@ -418,7 +418,9 @@ bool Compressor<RDH, verbose>::processDRM()
/** check event **/
checkerCheck();
*mEncoderPointer |= mCheckerSummary.nDiagnosticWords;
#if ENCODE_TDC_ERRORS
*mEncoderPointer |= (mCheckerSummary.nTDCErrors << 16);
#endif

if (verbose && mEncoderVerbose) {
auto CrateTrailer = reinterpret_cast<compressed::CrateTrailer_t*>(mEncoderPointer);
Expand All @@ -445,6 +447,7 @@ bool Compressor<RDH, verbose>::processDRM()
/** encode TDC errors **/
for (int itrm = 0; itrm < 10; ++itrm) {
for (int ichain = 0; ichain < 2; ++ichain) {
#if ENCODE_TDC_ERRORS
for (int ierror = 0; ierror < mDecoderSummary.trmErrors[itrm][ichain]; ++ierror) {
*mEncoderPointer = *mDecoderSummary.trmError[itrm][ichain][ierror];
*mEncoderPointer &= 0xFF07FFFF;
Expand All @@ -460,6 +463,7 @@ bool Compressor<RDH, verbose>::processDRM()
}
encoderNext();
}
#endif
mDecoderSummary.trmErrors[itrm][ichain] = 0;
}
}
Expand Down
17 changes: 12 additions & 5 deletions Detectors/TOF/workflow/src/CompressedDecodingTask.cxx
Expand Up @@ -131,13 +131,13 @@ void CompressedDecodingTask::run(ProcessingContext& pc)
{
mTimer.Start(false);

if (pc.inputs().getNofParts(0) && !mConetMode) {
if (pc.inputs().getNofParts(0) && !mConetMode && 0) { // it doesn't work
//RS set the 1st orbit of the TF from the O2 header, relying on rdhHandler is not good (in fact, the RDH might be eliminated in the derived data)
const auto* dh = o2::header::get<o2::header::DataHeader*>(pc.inputs().getByPos(0).header);
mInitOrbit = dh->firstTForbit;
}

mDecoder.setFirstIR({0, mInitOrbit});
// mDecoder.setFirstIR({0, mInitOrbit});

/** loop over inputs routes **/
for (auto iit = pc.inputs().begin(), iend = pc.inputs().end(); iit != iend; ++iit) {
Expand Down Expand Up @@ -179,6 +179,9 @@ void CompressedDecodingTask::headerHandler(const CrateHeader_t* crateHeader, con
LOG(DEBUG) << "Crate found" << crateHeader->drmID;

mInitOrbit = crateOrbit->orbitID;
if (mNCrateOpenTF == 0) {
mDecoder.setFirstIR({0, mInitOrbit});
}

mNCrateOpenTF++;
}
Expand All @@ -203,7 +206,6 @@ void CompressedDecodingTask::trailerHandler(const CrateHeader_t* crateHeader, co

/*
int islot = (*val & 15);
printf("DRM = %d (orbit = %d) slot = %d: \n", crateHeader->drmID, crateOrbit->orbitID, islot);
if (islot == 1) {
if (o2::tof::diagnostic::DRM_HEADER_MISSING & *val) {
printf("DRM_HEADER_MISSING\n");
Expand Down Expand Up @@ -323,6 +325,7 @@ void CompressedDecodingTask::trailerHandler(const CrateHeader_t* crateHeader, co
printf("------\n");
*/
}

for (int i = 0; i < numberOfErrors; i++) {
const uint32_t* val = reinterpret_cast<const uint32_t*>(&(errors[i]));
mDecoder.addError(*val, crateHeader->drmID);
Expand All @@ -331,12 +334,16 @@ void CompressedDecodingTask::trailerHandler(const CrateHeader_t* crateHeader, co

void CompressedDecodingTask::rdhHandler(const o2::header::RAWDataHeader* rdh)
{
const auto& rdhr = *rdh;
// set first orbtìt here (to be check in future), please not remove this!!!
if (mNCrateOpenTF == 0) {
mInitOrbit = RDHUtils::getHeartBeatOrbit(rdhr);
mDecoder.setFirstIR({0, mInitOrbit});
}

// rdh close
const auto& rdhr = *rdh;
if (RDHUtils::getStop(rdhr) && RDHUtils::getHeartBeatOrbit(rdhr) == o2::raw::HBFUtils::Instance().getNOrbitsPerTF() - 1 + mInitOrbit) {
mNCrateCloseTF++;
// printf("New TF close RDH %d\n", int(rdh->feeId));
return;
}

Expand Down