Skip to content

Commit 19088bc

Browse files
bazinskidavidrohr
authored andcommitted
TRD fix datarates in logs
1 parent b6e1050 commit 19088bc

5 files changed

Lines changed: 66 additions & 75 deletions

File tree

Detectors/TRD/reconstruction/src/CruRawReader.cxx

Lines changed: 58 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,17 @@ bool CruRawReader::checkRDH(const o2::header::RDHAny* rdh)
135135
TRDFeeID feeid;
136136
feeid.word = o2::raw::RDHUtils::getFEEID(rdh);
137137
if (((feeid.word) >> 4) == 0xfff) { // error condition is 0xfff? as the end point is known to the cru, but the rest is configured.
138-
if (mVerbose) {
139-
LOG(error) << "failed due to 0xfff? : " << std::hex << feeid.word << " whole feeid : " << std::hex << (unsigned int)feeid.word;
138+
if (mMaxWarnPrinted > 0) {
139+
LOG(warn) << "failed due to 0xfff? : " << std::hex << feeid.word << " whole feeid : " << std::hex << (unsigned int)feeid.word;
140+
checkNoWarn();
140141
}
141142
incrementErrors(TRDFEEIDIsFFFF, 0, 0, 0, 0);
142143
return false;
143144
}
144145
if (feeid.supermodule > 17) {
145-
if (mVerbose) {
146-
LOG(info) << "failed due to supermodule : " << std::dec << (int)feeid.supermodule << " whole feeid : " << std::hex << (unsigned int)feeid.word;
146+
if (mMaxWarnPrinted > 0) {
147+
LOG(warn) << "failed due to supermodule : " << std::dec << (int)feeid.supermodule << " whole feeid : " << std::hex << (unsigned int)feeid.word;
148+
checkNoWarn();
147149
}
148150
incrementErrors(TRDFEEIDBadSector, 0, 0, 0, 0);
149151
return false;
@@ -154,58 +156,43 @@ bool CruRawReader::checkRDH(const o2::header::RDHAny* rdh)
154156
bool CruRawReader::compareRDH(const o2::header::RDHAny* firstrdh, const o2::header::RDHAny* rdh)
155157
{
156158
if (o2::raw::RDHUtils::getFEEID(firstrdh) != o2::raw::RDHUtils::getFEEID(rdh)) {
157-
if (mMaxErrsPrinted > 0) {
158-
LOG(error) << "ERDH FEEID are not identical in rdh.";
159-
checkNoErr();
159+
if (mMaxWarnPrinted > 0) {
160+
LOG(warn) << "ERDH FEEID are not identical in rdh.";
161+
checkNoWarn();
160162
}
161163
incrementErrors(TRDParsingBadRDHFEEID, 0, 0, 0, 0);
162-
if (mVerbose) {
163-
LOG(error) << "ERDH FEEID are not identical in rdh.";
164-
}
165164
return false;
166165
}
167166
if (o2::raw::RDHUtils::getEndPointID(firstrdh) != o2::raw::RDHUtils::getEndPointID(rdh)) {
168-
if (mMaxErrsPrinted > 0) {
169-
LOG(error) << "ERDH EndPointID are not identical in rdh.";
170-
checkNoErr();
167+
if (mMaxWarnPrinted > 0) {
168+
LOG(warn) << "ERDH EndPointID are not identical in rdh.";
169+
checkNoWarn();
171170
}
172171
incrementErrors(TRDParsingBadRDHEndPoint, 0, 0, 0, 0);
173-
if (mVerbose) {
174-
LOG(error) << "ERDH EndPointID are not identical in rdh.";
175-
}
176172
return false;
177173
}
178174
if (o2::raw::RDHUtils::getTriggerOrbit(firstrdh) != o2::raw::RDHUtils::getTriggerOrbit(rdh)) {
179-
if (mMaxErrsPrinted > 0) {
180-
LOG(error) << "ERDH Orbit are not identical in rdh.";
181-
checkNoErr();
175+
if (mMaxWarnPrinted > 0) {
176+
LOG(warn) << "ERDH Orbit are not identical in rdh.";
177+
checkNoWarn();
182178
}
183179
incrementErrors(TRDParsingBadRDHOrbit, 0, 0, 0, 0);
184-
if (mVerbose) {
185-
LOG(error) << "ERDH Orbit are not identical in rdh.";
186-
}
187180
return false;
188181
}
189182
if (o2::raw::RDHUtils::getCRUID(firstrdh) != o2::raw::RDHUtils::getCRUID(rdh)) {
190-
if (mMaxErrsPrinted > 0) {
191-
LOG(error) << "ERDH CRUID are not identical in rdh.";
192-
checkNoErr();
183+
if (mMaxWarnPrinted > 0) {
184+
LOG(warn) << "ERDH CRUID are not identical in rdh.";
185+
checkNoWarn();
193186
}
194187
incrementErrors(TRDParsingBadRDHCRUID, 0, 0, 0, 0);
195-
if (mVerbose) {
196-
LOG(error) << "ERDH CRUID are not identical in rdh.";
197-
}
198188
return false;
199189
}
200190
if (o2::raw::RDHUtils::getPacketCounter(firstrdh) == o2::raw::RDHUtils::getPacketCounter(rdh) + 1) {
201-
if (mMaxErrsPrinted > 0) {
202-
LOG(error) << "ERDH PacketCounters are not sequential in rdh.";
203-
checkNoErr();
191+
if (mMaxWarnPrinted > 0) {
192+
LOG(warn) << "ERDH PacketCounters are not sequential in rdh.";
193+
checkNoWarn();
204194
}
205195
incrementErrors(TRDParsingBadRDHPacketCounter, 0, 0, 0, 0);
206-
if (mVerbose) {
207-
LOG(error) << "ERDH PacketCounters are not sequential in rdh.";
208-
}
209196
return false;
210197
}
211198
return true;
@@ -316,7 +303,7 @@ bool CruRawReader::processHBFs(int datasizealreadyread, bool verbose)
316303
LOG(info) << "ignored rdh event ";
317304
break;
318305
case 0:
319-
LOG(error) << "figure out what now";
306+
LOG(warn) << "figure out what now";
320307
break;
321308
case 1:
322309
LOG(info) << "all good parsing half cru";
@@ -411,7 +398,7 @@ int CruRawReader::parseDigitHCHeader()
411398
mDigitHCHeader.minor = 42; // to keep me entertained
412399
mDigitHCHeader.numberHCW = mHalfChamberWords;
413400
if (mHalfChamberWords == 0 || mHalfChamberMajor == 0) {
414-
//LOG(warn) << "we have a messed up halfchamber header and you have only set the halfchamber command line option to zero, hex dump of data and revisit what it should be.";
401+
LOG(warn) << "we have a messed up halfchamber header and you have only set the halfchamber command line option to zero, hex dump of data and revisit what it should be.";
415402
// already in histograms
416403
}
417404
}
@@ -420,10 +407,10 @@ int CruRawReader::parseDigitHCHeader()
420407
if (additionalHeaderWords >= 3) {
421408
incrementErrors(TRDParsingDigitHeaderCountGT3, mFEEID.supermodule, mHalfChamberSide[0], mStack[0], mLayer[0]);
422409
//TODO graph this and stats it
423-
if (mMaxErrsPrinted > 0) {
424-
LOG(alarm) << "Error parsing DigitHCHeader, too many additional words count=" << additionalHeaderWords << " header:" << std::hex << mDigitHCHeader.word;
410+
if (mMaxWarnPrinted > 0) {
411+
LOG(warn) << "Error parsing DigitHCHeader, too many additional words count=" << additionalHeaderWords << " header:" << std::hex << mDigitHCHeader.word;
425412
//printDigitHCHeader(mDigitHCHeader, &headers[0]);
426-
checkNoErr();
413+
checkNoWarn();
427414
}
428415
return -1;
429416
}
@@ -439,16 +426,19 @@ int CruRawReader::parseDigitHCHeader()
439426
case 1: // header header1;
440427
if (headersfound.test(0)) {
441428
// we have a problem, we already have a Digit HC Header1, we are hereby lost, so as Monty Python said, .... run away , run away, run away.
442-
if (mMaxErrsPrinted > 0) {
443-
LOG(alarm) << "We have a >1 Digit HC Header 1 : " << std::hex << " raw: 0x" << headers[headerwordcount];
444-
checkNoErr();
429+
if (mMaxWarnPrinted > 0) {
430+
LOG(warn) << "We have a >1 Digit HC Header 1 : " << std::hex << " raw: 0x" << headers[headerwordcount];
431+
checkNoWarn();
445432
}
446433
incrementErrors(TRDParsingDigitHCHeader1);
447434
}
448435
mDigitHCHeader1.word = headers[headerwordcount];
449436
headersfound.set(0);
450437
if (mDigitHCHeader1.res != 0x1) {
451-
LOG(alarm) << "Digit HC Header 1 reserved : 0x" << std::hex << mDigitHCHeader1.res << " raw: 0x" << mDigitHCHeader1.word;
438+
if (mMaxWarnPrinted > 0) {
439+
LOG(warn) << "Digit HC Header 1 reserved : 0x" << std::hex << mDigitHCHeader1.res << " raw: 0x" << mDigitHCHeader1.word;
440+
checkNoWarn();
441+
}
452442
incrementErrors(TRDParsingDigitHeaderWrong1);
453443
}
454444
if ((mDigitHCHeader1.numtimebins > o2::trd::constants::TIMEBINS) || (mDigitHCHeader1.numtimebins < 3)) {
@@ -468,40 +458,40 @@ int CruRawReader::parseDigitHCHeader()
468458
case 2: // header header2;
469459
if (headersfound.test(1)) {
470460
// we have a problem, we already have a Digit HC Header2, we are hereby lost, so as Monty Python said, .... run away , run away, run away.
471-
if (mMaxErrsPrinted > 0) {
472-
LOG(alarm) << "We have a >1 Digit HC Header 2 : " << std::hex << " raw: 0x" << headers[headerwordcount];
473-
checkNoErr();
461+
if (mMaxWarnPrinted > 0) {
462+
LOG(warn) << "We have a >1 Digit HC Header 2 : " << std::hex << " raw: 0x" << headers[headerwordcount];
463+
checkNoWarn();
474464
}
475465
incrementErrors(TRDParsingDigitHCHeader2);
476466
LOG(info) << "We have a >1 Digit HC Header 2 reserved : " << std::hex << headers[headerwordcount];
477467
}
478468
mDigitHCHeader2.word = headers[headerwordcount];
479469
headersfound.set(1);
480470
if (mDigitHCHeader2.res != 0b110001) {
481-
// LOG(alarm) << "Digit HC Header 2 reserved : " << std::hex << mDigitHCHeader2.res << " raw: 0x" << mDigitHCHeader2.word;
471+
// LOG(warn) << "Digit HC Header 2 reserved : " << std::hex << mDigitHCHeader2.res << " raw: 0x" << mDigitHCHeader2.word;
482472
incrementErrors(TRDParsingDigitHeaderWrong2);
483473
}
484474
break;
485475
case 3: // header header3;
486476
if (headersfound.test(2)) {
487477
// we have a problem, we already have a Digit HC Header2, we are hereby lost, so as Monty Python said, .... run away , run away, run away.
488-
if (mMaxErrsPrinted > 0) {
489-
LOG(alarm) << "We have a >1 Digit HC Header 2 : " << std::hex << " raw: 0x" << headers[headerwordcount];
490-
checkNoErr();
478+
if (mMaxWarnPrinted > 0) {
479+
LOG(warn) << "We have a >1 Digit HC Header 2 : " << std::hex << " raw: 0x" << headers[headerwordcount];
480+
checkNoWarn();
491481
}
492482
incrementErrors(TRDParsingDigitHCHeader3);
493483
}
494484
mDigitHCHeader3.word = headers[headerwordcount];
495485
headersfound.set(2);
496486
if (mDigitHCHeader3.res != 0b110101) {
497-
// LOG(alarm) << "Digit HC Header 3 reserved : " << std::hex << mDigitHCHeader3.res << " raw: 0x" << mDigitHCHeader3.word;
487+
// LOG(warn) << "Digit HC Header 3 reserved : " << std::hex << mDigitHCHeader3.res << " raw: 0x" << mDigitHCHeader3.word;
498488
incrementErrors(TRDParsingDigitHeaderWrong3);
499489
}
500490
if (mPreviousDigitHCHeadersvnver != 0xffffffff && mPreviousDigitHCHeadersvnrver != 0xffffffff) {
501491
if ((mDigitHCHeader3.svnver != mPreviousDigitHCHeadersvnver) && (mDigitHCHeader3.svnrver != mPreviousDigitHCHeadersvnrver)) {
502-
if (mMaxErrsPrinted > 0) {
503-
LOG(alarm) << "Digit HC Header 3 svn ver : " << std::hex << mDigitHCHeader3.svnver << " svn release ver : 0x" << mDigitHCHeader3.svnrver;
504-
checkNoErr();
492+
if (mMaxWarnPrinted > 0) {
493+
LOG(warn) << "Digit HC Header 3 svn ver : " << std::hex << mDigitHCHeader3.svnver << " svn release ver : 0x" << mDigitHCHeader3.svnrver;
494+
checkNoWarn();
505495
}
506496
incrementErrors(TRDParsingDigitHCHeaderSVNMismatch);
507497
return -1;
@@ -513,7 +503,7 @@ int CruRawReader::parseDigitHCHeader()
513503
}
514504
break;
515505
default:
516-
//LOG(alarm) << "Error parsing DigitHCHeader at word:" << headerwordcount << " looking at 0x:" << std::hex << mHBFPayload[mHBFoffset32 - 1];
506+
//LOG(warn) << "Error parsing DigitHCHeader at word:" << headerwordcount << " looking at 0x:" << std::hex << mHBFPayload[mHBFoffset32 - 1];
517507
incrementErrors(TRDParsingDigitHeaderWrong4);
518508
}
519509
}
@@ -553,7 +543,7 @@ int CruRawReader::processHalfCRU(int cruhbfstartoffset, int numberOfPreviousCRU,
553543
//TODO put maxdatawrittentobuffer in a qc plot
554544
if (mHBFPayload.size() < cruhbfstartoffset || cruhbfstartoffset > maxdatawrittentobuffer) {
555545
if (mMaxErrsPrinted > 0) {
556-
LOG(alarm) << "Error parsing HalfCRUHeader, HBFPayload size = " << mHBFPayload.size() << " payload offset:" << cruhbfstartoffset << " max data written to buffer : " << maxdatawrittentobuffer;
546+
LOG(warn) << "Error parsing HalfCRUHeader, HBFPayload size = " << mHBFPayload.size() << " payload offset:" << cruhbfstartoffset << " max data written to buffer : " << maxdatawrittentobuffer;
557547
checkNoErr();
558548
}
559549
mHBFoffset32++;
@@ -615,19 +605,20 @@ int CruRawReader::processHalfCRU(int cruhbfstartoffset, int numberOfPreviousCRU,
615605
memcpy((char*)&mPreviousHalfCRUHeader, (void*)(&mHBFPayload[cruhbfstartoffset]), sizeof(mCurrentHalfCRUHeader));
616606
//can this half cru length fit into the available space of the rdh accumulated payload
617607
if (mTotalHalfCRUDataLength32 > mTotalHBFPayLoad - mHBFoffset32) {
618-
if (mMaxErrsPrinted > 0) {
619-
LOG(alarm) << "Next HalfCRU header says it contains more data than in the rdh payloads! " << mTotalHalfCRUDataLength32 << " < " << mTotalHBFPayLoad << "-" << mHBFoffset32 << " sector:side:endpoint: " << (unsigned int)mFEEID.supermodule << ":" << (unsigned int)mFEEID.side << ":" << (unsigned int)mFEEID.endpoint;
620-
checkNoErr();
608+
if (mMaxWarnPrinted > 0) {
609+
LOG(warn) << "Next HalfCRU header says it contains more data than in the rdh payloads! " << mTotalHalfCRUDataLength32 << " < " << mTotalHBFPayLoad << "-" << mHBFoffset32 << " sector:side:endpoint: " << (unsigned int)mFEEID.supermodule << ":" << (unsigned int)mFEEID.side << ":" << (unsigned int)mFEEID.endpoint;
610+
checkNoWarn();
621611
}
622612
incrementErrors(TRDParsingHalfCRUSumLength);
623613
mWordsRejected += mTotalHalfCRUDataLength32;
614+
mHBFoffset32 += mTotalHalfCRUDataLength32; // go to the end of this halfcruheader and payload.
624615

625616
return -2;
626617
}
627618
if (!halfCRUHeaderSanityCheck(mCurrentHalfCRUHeader, mCurrentHalfCRULinkLengths, mCurrentHalfCRULinkErrorFlags)) {
628-
if (mMaxErrsPrinted > 0) {
629-
LOG(alarm) << "HalfCRU header failed sanity check for FEEID with sector:side:endpoint: " << (unsigned int)mFEEID.supermodule << ":" << (unsigned int)mFEEID.side << ":" << (unsigned int)mFEEID.endpoint;
630-
checkNoErr();
619+
if (mMaxWarnPrinted > 0) {
620+
LOG(warn) << "HalfCRU header failed sanity check for FEEID with sector:side:endpoint: " << (unsigned int)mFEEID.supermodule << ":" << (unsigned int)mFEEID.side << ":" << (unsigned int)mFEEID.endpoint;
621+
checkNoWarn();
631622
}
632623
// let incrementErrors catch the undefined values of sector side stack and layer as if not set it will go so zero in the method, however if set, it means this is the second half cru header, and we have the values from the last one we read which
633624
// *SHOULD* be the same as this halfcruheader.
@@ -724,7 +715,7 @@ int CruRawReader::processHalfCRU(int cruhbfstartoffset, int numberOfPreviousCRU,
724715
int dioffset = dataoffsetstart32 + linksizeAccum32;
725716
if (dioffset % 8 != 0) {
726717
if (mMaxErrsPrinted > 0) {
727-
LOG(alarm) << " we are not 256 bit aligned ... this should never happen";
718+
LOG(warn) << " we are not 256 bit aligned ... this should never happen";
728719
checkNoErr();
729720
}
730721
}
@@ -762,7 +753,7 @@ int CruRawReader::processHalfCRU(int cruhbfstartoffset, int numberOfPreviousCRU,
762753
if (mTrackletWordsRead == -1) {
763754
//something went wrong bailout of here.
764755
if (mMaxErrsPrinted > 0) {
765-
LOG(alarm) << "TrackletParser returned -1 for LINK # " << currentlinkindex << " an FEEID:" << std::hex << mFEEID.word << " det:" << std::dec << mDetector[1] << " is > the lenght stored in the cruhalfchamber header : " << mCurrentHalfCRULinkLengths[currentlinkindex];
756+
LOG(warn) << "TrackletParser returned -1 for LINK # " << currentlinkindex << " an FEEID:" << std::hex << mFEEID.word << " det:" << std::dec << mDetector[1] << " is > the lenght stored in the cruhalfchamber header : " << mCurrentHalfCRULinkLengths[currentlinkindex];
766757
checkNoErr();
767758
}
768759
incrementErrors(TRDParsingTrackletsReturnedMinusOne, mFEEID.supermodule, mFEEID.side, mStack[0], mLayer[0]);
@@ -813,13 +804,13 @@ int CruRawReader::processHalfCRU(int cruhbfstartoffset, int numberOfPreviousCRU,
813804
//move over the DigitHCHeader mHBFoffset32 has already been moved in the reading.
814805
if (mHBFoffset32 - hfboffsetbeforehcparse != 1 + mDigitHCHeader.numberHCW) {
815806
if (mMaxErrsPrinted > 0) {
816-
LOG(alarm) << "Seems data offset is out of sync with number of HC Headers words " << mHBFoffset32 << "-" << hfboffsetbeforehcparse << "!=" << 1 << "+" << mDigitHCHeader.numberHCW;
807+
LOG(warn) << "Seems data offset is out of sync with number of HC Headers words " << mHBFoffset32 << "-" << hfboffsetbeforehcparse << "!=" << 1 << "+" << mDigitHCHeader.numberHCW;
817808
checkNoErr();
818809
}
819810
}
820811
if (hcparse == -1) {
821812
if (mMaxWarnPrinted > 0) {
822-
LOG(alarm) << "Parsing Digit HCHeader returned a -1";
813+
LOG(warn) << "Parsing Digit HCHeader returned a -1";
823814
checkNoWarn();
824815
}
825816
} else {
@@ -997,7 +988,7 @@ void CruRawReader::buildDPLOutputs(o2::framework::ProcessingContext& pc)
997988
void CruRawReader::checkNoWarn()
998989
{
999990
if (!mVerbose && --mMaxWarnPrinted == 0) {
1000-
LOG(alarm) << "Warnings limit reached, the following ones will be suppressed";
991+
LOG(warn) << "Warnings limit reached, the following ones will be suppressed";
1001992
}
1002993
}
1003994

Detectors/TRD/reconstruction/src/DataReaderTask.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ void DataReaderTask::init(InitContext& ic)
4545
ic.services().get<CallbackService>().set(CallbackService::Id::Stop, finishFunction);
4646
mDigitPreviousTotal = mReader.getDigitsFound();
4747
mTrackletsPreviousTotal = mReader.getTrackletsFound();
48+
mWordsRead = 0;
49+
mWordsRejected = 0;
4850
}
4951

5052
void DataReaderTask::endOfStream(o2::framework::EndOfStreamContext& ec)
@@ -140,17 +142,13 @@ void DataReaderTask::run(ProcessingContext& pc)
140142
if (mVerbose) {
141143
LOG(info) << " parsing non compressed data in the data reader task with a payload of " << payloadInSize << " payload size";
142144
}
143-
// LOG(info) << "start of data is at ref.payload=0x"<< std::hex << " payloadSize:0x" << payloadInSize <<" dh->headerSize:0x" <<dh->headerSize;
144145
total1 += payloadInSize;
145146
total2 += dh->headerSize;
146-
// LOG(info) << "start of data is at ref.payload=0x"<< std::hex << " total1:0x" << total1 <<" total2:0x" <<total2;
147147
mReader.setDataBuffer(payloadIn);
148148
mReader.setDataBufferSize(payloadInSize);
149149
mReader.configure(mTrackletHCHeaderState, mHalfChamberWords, mHalfChamberMajor, mOptions);
150150
//mReader.setStats(&mTimeFrameStats);
151151
mReader.run();
152-
mWordsRead += mReader.getWordsRead();
153-
mWordsRejected += mReader.getWordsRejected();
154152
if (mVerbose) {
155153
LOG(info) << "relevant vectors to read : " << mReader.sumTrackletsFound() << " tracklets and " << mReader.sumDigitsFound() << " compressed digits";
156154
}
@@ -161,6 +159,8 @@ void DataReaderTask::run(ProcessingContext& pc)
161159
mCompressedReader.run();
162160
}
163161
}
162+
mWordsRead += mReader.getWordsRead();
163+
mWordsRejected += mReader.getWordsRejected();
164164

165165
sendData(pc, false);
166166
std::chrono::duration<double, std::milli> dataReadTime = std::chrono::high_resolution_clock::now() - dataReadStart;

Detectors/TRD/reconstruction/src/DigitsParser.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ int DigitsParser::Parse(bool verbose)
295295
incParsingError(TRDParsingDigitADCChannel21);
296296
}
297297
if (mCurrentADCChannel > 22) {
298-
LOG(error) << "invalid bitpattern (read a zero) for this mcm 0x" << std::hex << mADCMask << " at offset " << std::distance(mStartParse, word);
298+
LOG(warn) << "invalid bitpattern (read a zero) for this mcm 0x" << std::hex << mADCMask << " at offset " << std::distance(mStartParse, word);
299299
incParsingError(TRDParsingDigitADCChannelGT22);
300300
mCurrentADCChannel = 100 * bitsinmask + overchannelcount++;
301301
if (mHeaderVerbose) {

Detectors/TRD/reconstruction/src/EventRecord.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ EventRecord& EventStorage::getEventRecord(InteractionRecord& ir)
320320
void EventRecord::popTracklets(int popcount)
321321
{
322322
if (popcount > 3 || popcount < 0) {
323-
LOG(error) << " been asked to pop more than 3 tracklets:" << popcount;
323+
LOG(warn) << " been asked to pop more than 3 tracklets:" << popcount;
324324
} else {
325325
while (popcount > 0) {
326326
mTracklets.pop_back();

0 commit comments

Comments
 (0)