Skip to content

Commit ace19c2

Browse files
authored
ITS/FEE: better resource handling for payload (#2511)
* Added option for old-style payload and optimized new one * Code refactoring + new plot for empty payload * clang * Moved empty payload plot to Decoding Check
1 parent 28933e2 commit ace19c2

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
lines changed

Modules/ITS/include/ITS/ITSFeeTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class ITSFeeTask final : public TaskInterface
184184
int mNPayloadSizeBins = 4096;
185185
bool mResetLaneStatus = false;
186186
bool mResetPayload = false;
187+
bool precisePayload = false;
187188
int mPayloadParseEvery_n_HBF_per_TF = 32; // -1 to disable, 1 to process all the HBFs
188189
int mPayloadParseEvery_n_TF = 1; // Use >= 1 values
189190
bool mEnableIHWReading = 0;

Modules/ITS/itsFee.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"PayloadParsingEvery_n_HBFperTF": "0",
4444
"PayloadParsingEvery_n_TF": "1",
4545
"DecodeCDW": "0",
46-
"nResetCycle": "3"
46+
"nResetCycle": "3",
47+
"precisePayload": "1"
4748
}
4849
}
4950
},

Modules/ITS/src/ITSFeeTask.cxx

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ void ITSFeeTask::initialize(o2::framework::InitContext& /*ctx*/)
8181

8282
void ITSFeeTask::createFeePlots()
8383
{
84+
8485
mTrigger = new TH1I("TriggerFlag", "Trigger vs counts", mTriggerType.size(), 0.5, mTriggerType.size() + 0.5);
8586
getObjectsManager()->startPublishing(mTrigger); // mTrigger
8687

@@ -142,7 +143,7 @@ void ITSFeeTask::createFeePlots()
142143
mFlag1Check = new TH2I("Flag1Check", "Flag 1 Check", NFees, 0, NFees, 3, 0, 3); // Row 1 : transmission_timeout, Row 2 : packet_overflow, Row 3 : lane_starts_violation
143144
getObjectsManager()->startPublishing(mFlag1Check); // mFlag1Check
144145

145-
mDecodingCheck = new TH2I("DecodingCheck", "Error in parsing data", NFees, 0, NFees, 5, 0, 5); // 0: DataFormat not recognized, 1: DDW index != 0, 2: DDW wrong identifier, 3: IHW wrong identifier, 4: CDW wrong version -- adapt y range!
146+
mDecodingCheck = new TH2I("DecodingCheck", "Error in parsing data", NFees, 0, NFees, 6, 0, 6); // 0: DataFormat not recognized, 1: DDW index != 0, 2: DDW wrong identifier, 3: IHW wrong identifier, 4: CDW wrong version, 5: Empty Payload -- adapt y range!
146147
getObjectsManager()->startPublishing(mDecodingCheck);
147148

148149
mPayloadSize = new TH2F("PayloadSize", "Payload Size", NFees, 0, NFees, mNPayloadSizeBins, 0, 4.096e5);
@@ -513,7 +514,10 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
513514

514515
} // if doLookForTDT || mDecodeCDW
515516

516-
//
517+
// Check on empty payload
518+
if (!it.size()) {
519+
mDecodingCheck->Fill(ifee, 5);
520+
}
517521

518522
// Operations at the first page of each orbit
519523
// - decoding ITS header work and fill histogram with number of active lanes
@@ -546,12 +550,34 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
546550
}
547551

548552
// Operations at last page of each orbit:
553+
549554
// - decoding Diagnostic Word DDW0 and fill lane status plots and vectors
550555
if ((int)(o2::raw::RDHUtils::getStop(rdh)) && it.size()) {
551556

552-
for (int i = 0; i < NFees; i++) {
553-
mPayloadSize->Fill(i, (float)payloadTot[i]);
554-
payloadTot[i] = 0;
557+
// - read triggers in RDH and fill histogram
558+
// - fill histogram with packet_done TDTs counted so far and reset counter
559+
// fill trailer count histo and reset counters
560+
if (doLookForTDT) {
561+
562+
if (!RampOngoing && !clockEvt) {
563+
mTrailerCount->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
564+
mTrailerCount_reset->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
565+
}
566+
TDTcounter[ifee] = 0;
567+
}
568+
569+
nStops[ifee]++;
570+
for (int i = 0; i < mTriggerType.size(); i++) {
571+
if (((o2::raw::RDHUtils::getTriggerType(rdh)) >> mTriggerType.at(i).first & 1) == 1) {
572+
mTrigger->Fill(i + 1);
573+
mTriggerVsFeeId->Fill(ifee, i + 1);
574+
mTriggerVsFeeId_reset->Fill(ifee, i + 1);
575+
}
576+
}
577+
578+
if (precisePayload) {
579+
mPayloadSize->Fill(ifee, payloadTot[ifee]);
580+
payloadTot[ifee] = 0;
555581
}
556582

557583
const GBTDiagnosticWord* ddw;
@@ -604,29 +630,6 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
604630
}
605631
}
606632
}
607-
608-
// Operations at last page of each orbit:
609-
// - read triggers in RDH and fill histogram
610-
// - fill histogram with packet_done TDTs counted so far and reset counter
611-
if ((int)(o2::raw::RDHUtils::getStop(rdh))) {
612-
// fill trailer count histo and reset counters
613-
if (doLookForTDT) {
614-
615-
if (!RampOngoing && !clockEvt) {
616-
mTrailerCount->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
617-
mTrailerCount_reset->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1);
618-
}
619-
TDTcounter[ifee] = 0;
620-
}
621-
nStops[ifee]++;
622-
for (int i = 0; i < mTriggerType.size(); i++) {
623-
if (((o2::raw::RDHUtils::getTriggerType(rdh)) >> mTriggerType.at(i).first & 1) == 1) {
624-
mTrigger->Fill(i + 1);
625-
mTriggerVsFeeId->Fill(ifee, i + 1);
626-
mTriggerVsFeeId_reset->Fill(ifee, i + 1);
627-
}
628-
}
629-
}
630633
}
631634

632635
// Filling histograms: loop over mStatusFlagNumber[ilayer][istave][ilane][iflag]
@@ -671,6 +674,16 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx)
671674
mLaneStatusOverview[1]->SetBinError(istave + 1 + StaveBoundary[ilayer], 1e-15);
672675
}
673676
}
677+
678+
if (!precisePayload) {
679+
for (int i = 0; i < NFees; i++) {
680+
if (nStops[i]) {
681+
float payloadAvg = (float)payloadTot[i] / nStops[i];
682+
mPayloadSize->Fill(i, payloadAvg);
683+
}
684+
}
685+
}
686+
674687
mTimeFrameId++;
675688
mTFInfo->Fill(mTimeFrameId % 10000);
676689
end = std::chrono::high_resolution_clock::now();
@@ -691,6 +704,7 @@ void ITSFeeTask::getParameters()
691704
mEnableIHWReading = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "EnableIHWReading", mEnableIHWReading);
692705
mDecodeCDW = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "DecodeCDW", mDecodeCDW);
693706
nResetCycle = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "nResetCycle", nResetCycle);
707+
precisePayload = o2::quality_control_modules::common::getFromConfig<bool>(mCustomParameters, "precisePayload", precisePayload);
694708
}
695709

696710
void ITSFeeTask::getStavePoint(int layer, int stave, double* px, double* py)

0 commit comments

Comments
 (0)