Skip to content

Commit e968aea

Browse files
authored
Additional warning for TRD (#11373)
1 parent cb062ee commit e968aea

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

Detectors/TRD/reconstruction/src/CruRawReader.cxx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ int CruRawReader::processHBFs()
180180
mCRUID = o2::raw::RDHUtils::getCRUID(rdh);
181181
mIR = o2::raw::RDHUtils::getTriggerIR(rdh); // the orbit counter is taken from the RDH here, the bc is overwritten later from the HalfCRUHeader
182182

183+
if (mTotalHBFPayLoad + memorySize >= mDataBufferSize) {
184+
// the size of the current RDH is larger than it can possibly be (we still expect a STOP RDH)
185+
if (mMaxErrsPrinted > 0) {
186+
LOGP(error, "RDH memory size of {} + HBF payload of {} >= total buffer size of {}. CRU for FEE ID {:#04x} misconfigured with too large number of HBFs per TF?",
187+
memorySize, mTotalHBFPayLoad, mDataBufferSize, mFEEID.word);
188+
checkNoErr();
189+
}
190+
return -1;
191+
}
192+
183193
// copy the contents of the current RDH into the buffer to be parsed, RDH payload is memory size minus header size
184194
std::memcpy((char*)&mHBFPayload[0] + mTotalHBFPayLoad, ((char*)rdh) + headerSize, rdhpayload);
185195
// copy the contents of the current rdh into the buffer to be parsed
@@ -369,7 +379,7 @@ bool CruRawReader::processHalfCRU(int iteration)
369379
// this should only hit that instance where the cru payload is a "blank event" of CRUPADDING32
370380
if (mHBFPayload[mHBFoffset32] == CRUPADDING32) {
371381
if (mOptions[TRDVerboseBit]) {
372-
LOG(info) << "blank rdh payload data at " << mHBFoffset32 << ": 0x " << std::hex << mHBFPayload[mHBFoffset32] << " and 0x" << mHBFPayload[mHBFoffset32 + 1];
382+
LOG(info) << "blank rdh payload data at " << mHBFoffset32 << ": 0x" << std::hex << mHBFPayload[mHBFoffset32] << " and 0x" << mHBFPayload[mHBFoffset32 + 1];
373383
}
374384
int loopcount = 0;
375385
while (mHBFPayload[mHBFoffset32] == CRUPADDING32 && loopcount < 8) { // can only ever be an entire 256 bit word hence a limit of 8 here.
@@ -1073,14 +1083,10 @@ void CruRawReader::run()
10731083
checkNoWarn();
10741084
}
10751085
break;
1076-
} else if (dataRead == 0) {
1077-
if (mMaxWarnPrinted > 0) {
1078-
LOG(warn) << "Did not process any data for given HBF. Probably STOP bit was set in first RDH";
1079-
checkNoWarn();
1080-
}
1081-
break;
10821086
} else {
1083-
LOG(debug) << "Done processing HBFs. Total input size was " << dataRead << " bytes (including all headers and padding words)";
1087+
if (mOptions[TRDVerboseBit]) {
1088+
LOGP(info, "Done processing HBFs. Total input size was {} bytes (including all headers and padding words)", dataRead);
1089+
}
10841090
}
10851091
}
10861092
};

0 commit comments

Comments
 (0)