From 2c3fdc2c843af9969b15925d5453d743247f95b5 Mon Sep 17 00:00:00 2001 From: Isakov Artem Date: Fri, 21 Feb 2025 10:09:27 +0100 Subject: [PATCH 1/4] Added option for old-style payload and optimized new one --- Modules/ITS/include/ITS/ITSFeeTask.h | 1 + Modules/ITS/src/ITSFeeTask.cxx | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Modules/ITS/include/ITS/ITSFeeTask.h b/Modules/ITS/include/ITS/ITSFeeTask.h index ea66549dfd..666518c709 100644 --- a/Modules/ITS/include/ITS/ITSFeeTask.h +++ b/Modules/ITS/include/ITS/ITSFeeTask.h @@ -184,6 +184,7 @@ class ITSFeeTask final : public TaskInterface int mNPayloadSizeBins = 4096; bool mResetLaneStatus = false; bool mResetPayload = false; + bool precisePayload = false; int mPayloadParseEvery_n_HBF_per_TF = 32; // -1 to disable, 1 to process all the HBFs int mPayloadParseEvery_n_TF = 1; // Use >= 1 values bool mEnableIHWReading = 0; diff --git a/Modules/ITS/src/ITSFeeTask.cxx b/Modules/ITS/src/ITSFeeTask.cxx index 286b4420dd..0acaf915e3 100644 --- a/Modules/ITS/src/ITSFeeTask.cxx +++ b/Modules/ITS/src/ITSFeeTask.cxx @@ -549,9 +549,9 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) // - decoding Diagnostic Word DDW0 and fill lane status plots and vectors if ((int)(o2::raw::RDHUtils::getStop(rdh)) && it.size()) { - for (int i = 0; i < NFees; i++) { - mPayloadSize->Fill(i, (float)payloadTot[i]); - payloadTot[i] = 0; + if (precisePayload){ + mPayloadSize->Fill(ifee, payloadTot[ifee]); + payloadTot[ifee] = 0; } const GBTDiagnosticWord* ddw; @@ -671,6 +671,17 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) mLaneStatusOverview[1]->SetBinError(istave + 1 + StaveBoundary[ilayer], 1e-15); } } + + if (! precisePayload){ + for (int i = 0; i < NFees; i++) { + if (nStops[i]) { + float payloadAvg = (float)payloadTot[i] / nStops[i]; + mPayloadSize->Fill(i, payloadAvg); + } + } + } + + mTimeFrameId++; mTFInfo->Fill(mTimeFrameId % 10000); end = std::chrono::high_resolution_clock::now(); @@ -691,6 +702,7 @@ void ITSFeeTask::getParameters() mEnableIHWReading = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "EnableIHWReading", mEnableIHWReading); mDecodeCDW = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "DecodeCDW", mDecodeCDW); nResetCycle = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "nResetCycle", nResetCycle); + precisePayload = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "precisePayload", precisePayload); } void ITSFeeTask::getStavePoint(int layer, int stave, double* px, double* py) From c3f18401350601214bc7ef04036671934f530688 Mon Sep 17 00:00:00 2001 From: Isakov Artem Date: Fri, 21 Feb 2025 10:42:27 +0100 Subject: [PATCH 2/4] Code refactoring + new plot for empty payload --- Modules/ITS/include/ITS/ITSFeeTask.h | 1 + Modules/ITS/src/ITSFeeTask.cxx | 56 ++++++++++++++++------------ 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/Modules/ITS/include/ITS/ITSFeeTask.h b/Modules/ITS/include/ITS/ITSFeeTask.h index 666518c709..6363936eac 100644 --- a/Modules/ITS/include/ITS/ITSFeeTask.h +++ b/Modules/ITS/include/ITS/ITSFeeTask.h @@ -218,6 +218,7 @@ class ITSFeeTask final : public TaskInterface TH1I* mProcessingTime; TH1D* mProcessingTime2; TH2F* mPayloadSize; // average payload size vs linkID + TH1I* mEmptyPayload; // TH1D* mInfoCanvas;//TODO: default, not implemented yet }; diff --git a/Modules/ITS/src/ITSFeeTask.cxx b/Modules/ITS/src/ITSFeeTask.cxx index 0acaf915e3..443ffcb0fd 100644 --- a/Modules/ITS/src/ITSFeeTask.cxx +++ b/Modules/ITS/src/ITSFeeTask.cxx @@ -81,6 +81,10 @@ void ITSFeeTask::initialize(o2::framework::InitContext& /*ctx*/) void ITSFeeTask::createFeePlots() { + + mEmptyPayload = new TH1I("EmptyPayload", "Numer of orbits with empty payload", NFees, 0, NFees); + getObjectsManager()->startPublishing(mEmptyPayload); + mTrigger = new TH1I("TriggerFlag", "Trigger vs counts", mTriggerType.size(), 0.5, mTriggerType.size() + 0.5); getObjectsManager()->startPublishing(mTrigger); // mTrigger @@ -546,9 +550,36 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) } // Operations at last page of each orbit: + + if ((int)(o2::raw::RDHUtils::getStop(rdh)) && !it.size()){ + mEmptyPayload->Fill(ifee) + } + // - decoding Diagnostic Word DDW0 and fill lane status plots and vectors if ((int)(o2::raw::RDHUtils::getStop(rdh)) && it.size()) { + // - read triggers in RDH and fill histogram + // - fill histogram with packet_done TDTs counted so far and reset counter + // fill trailer count histo and reset counters + if (doLookForTDT) { + + if (!RampOngoing && !clockEvt) { + mTrailerCount->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1); + mTrailerCount_reset->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1); + } + TDTcounter[ifee] = 0; + } + + nStops[ifee]++; + for (int i = 0; i < mTriggerType.size(); i++) { + if (((o2::raw::RDHUtils::getTriggerType(rdh)) >> mTriggerType.at(i).first & 1) == 1) { + mTrigger->Fill(i + 1); + mTriggerVsFeeId->Fill(ifee, i + 1); + mTriggerVsFeeId_reset->Fill(ifee, i + 1); + } + } + + if (precisePayload){ mPayloadSize->Fill(ifee, payloadTot[ifee]); payloadTot[ifee] = 0; @@ -604,30 +635,7 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) } } } - - // Operations at last page of each orbit: - // - read triggers in RDH and fill histogram - // - fill histogram with packet_done TDTs counted so far and reset counter - if ((int)(o2::raw::RDHUtils::getStop(rdh))) { - // fill trailer count histo and reset counters - if (doLookForTDT) { - - if (!RampOngoing && !clockEvt) { - mTrailerCount->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1); - mTrailerCount_reset->Fill(ifee, TDTcounter[ifee] < 21 ? TDTcounter[ifee] : -1); - } - TDTcounter[ifee] = 0; - } - nStops[ifee]++; - for (int i = 0; i < mTriggerType.size(); i++) { - if (((o2::raw::RDHUtils::getTriggerType(rdh)) >> mTriggerType.at(i).first & 1) == 1) { - mTrigger->Fill(i + 1); - mTriggerVsFeeId->Fill(ifee, i + 1); - mTriggerVsFeeId_reset->Fill(ifee, i + 1); - } - } - } - } +} // Filling histograms: loop over mStatusFlagNumber[ilayer][istave][ilane][iflag] int counterSummary[4][3] = { { 0 } }; From a6245ad0d9e31b843b6ec2c6d6eba45ea04dfed0 Mon Sep 17 00:00:00 2001 From: Isakov Artem Date: Fri, 21 Feb 2025 12:29:54 +0100 Subject: [PATCH 3/4] clang --- Modules/ITS/itsFee.json | 3 ++- Modules/ITS/src/ITSFeeTask.cxx | 42 ++++++++++++++++------------------ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Modules/ITS/itsFee.json b/Modules/ITS/itsFee.json index 578dc90e61..fc2a8f09be 100644 --- a/Modules/ITS/itsFee.json +++ b/Modules/ITS/itsFee.json @@ -43,7 +43,8 @@ "PayloadParsingEvery_n_HBFperTF": "0", "PayloadParsingEvery_n_TF": "1", "DecodeCDW": "0", - "nResetCycle": "3" + "nResetCycle": "3", + "precisePayload": "1" } } }, diff --git a/Modules/ITS/src/ITSFeeTask.cxx b/Modules/ITS/src/ITSFeeTask.cxx index 443ffcb0fd..95f6db0c49 100644 --- a/Modules/ITS/src/ITSFeeTask.cxx +++ b/Modules/ITS/src/ITSFeeTask.cxx @@ -82,9 +82,9 @@ void ITSFeeTask::initialize(o2::framework::InitContext& /*ctx*/) void ITSFeeTask::createFeePlots() { - mEmptyPayload = new TH1I("EmptyPayload", "Numer of orbits with empty payload", NFees, 0, NFees); - getObjectsManager()->startPublishing(mEmptyPayload); - + mEmptyPayload = new TH1I("EmptyPayload", "Numer of orbits with empty payload", NFees, 0, NFees); + getObjectsManager()->startPublishing(mEmptyPayload); + mTrigger = new TH1I("TriggerFlag", "Trigger vs counts", mTriggerType.size(), 0.5, mTriggerType.size() + 0.5); getObjectsManager()->startPublishing(mTrigger); // mTrigger @@ -550,16 +550,16 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) } // Operations at last page of each orbit: - - if ((int)(o2::raw::RDHUtils::getStop(rdh)) && !it.size()){ - mEmptyPayload->Fill(ifee) + + if ((int)(o2::raw::RDHUtils::getStop(rdh)) && !it.size()) { + mEmptyPayload->Fill(ifee); } // - decoding Diagnostic Word DDW0 and fill lane status plots and vectors if ((int)(o2::raw::RDHUtils::getStop(rdh)) && it.size()) { - // - read triggers in RDH and fill histogram - // - fill histogram with packet_done TDTs counted so far and reset counter + // - read triggers in RDH and fill histogram + // - fill histogram with packet_done TDTs counted so far and reset counter // fill trailer count histo and reset counters if (doLookForTDT) { @@ -578,10 +578,9 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) mTriggerVsFeeId_reset->Fill(ifee, i + 1); } } - - - if (precisePayload){ - mPayloadSize->Fill(ifee, payloadTot[ifee]); + + if (precisePayload) { + mPayloadSize->Fill(ifee, payloadTot[ifee]); payloadTot[ifee] = 0; } @@ -635,7 +634,7 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) } } } -} + } // Filling histograms: loop over mStatusFlagNumber[ilayer][istave][ilane][iflag] int counterSummary[4][3] = { { 0 } }; @@ -679,16 +678,15 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) mLaneStatusOverview[1]->SetBinError(istave + 1 + StaveBoundary[ilayer], 1e-15); } } - - if (! precisePayload){ - for (int i = 0; i < NFees; i++) { - if (nStops[i]) { - float payloadAvg = (float)payloadTot[i] / nStops[i]; - mPayloadSize->Fill(i, payloadAvg); + + if (!precisePayload) { + for (int i = 0; i < NFees; i++) { + if (nStops[i]) { + float payloadAvg = (float)payloadTot[i] / nStops[i]; + mPayloadSize->Fill(i, payloadAvg); + } } } - } - mTimeFrameId++; mTFInfo->Fill(mTimeFrameId % 10000); @@ -710,7 +708,7 @@ void ITSFeeTask::getParameters() mEnableIHWReading = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "EnableIHWReading", mEnableIHWReading); mDecodeCDW = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "DecodeCDW", mDecodeCDW); nResetCycle = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "nResetCycle", nResetCycle); - precisePayload = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "precisePayload", precisePayload); + precisePayload = o2::quality_control_modules::common::getFromConfig(mCustomParameters, "precisePayload", precisePayload); } void ITSFeeTask::getStavePoint(int layer, int stave, double* px, double* py) From 41c73628d16ecc54fba569c704c81fb1aee7a0d4 Mon Sep 17 00:00:00 2001 From: Isakov Artem Date: Mon, 24 Feb 2025 10:52:02 +0100 Subject: [PATCH 4/4] Moved empty payload plot to Decoding Check --- Modules/ITS/include/ITS/ITSFeeTask.h | 1 - Modules/ITS/src/ITSFeeTask.cxx | 14 +++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Modules/ITS/include/ITS/ITSFeeTask.h b/Modules/ITS/include/ITS/ITSFeeTask.h index 6363936eac..666518c709 100644 --- a/Modules/ITS/include/ITS/ITSFeeTask.h +++ b/Modules/ITS/include/ITS/ITSFeeTask.h @@ -218,7 +218,6 @@ class ITSFeeTask final : public TaskInterface TH1I* mProcessingTime; TH1D* mProcessingTime2; TH2F* mPayloadSize; // average payload size vs linkID - TH1I* mEmptyPayload; // TH1D* mInfoCanvas;//TODO: default, not implemented yet }; diff --git a/Modules/ITS/src/ITSFeeTask.cxx b/Modules/ITS/src/ITSFeeTask.cxx index 95f6db0c49..e676ebbbd6 100644 --- a/Modules/ITS/src/ITSFeeTask.cxx +++ b/Modules/ITS/src/ITSFeeTask.cxx @@ -82,9 +82,6 @@ void ITSFeeTask::initialize(o2::framework::InitContext& /*ctx*/) void ITSFeeTask::createFeePlots() { - mEmptyPayload = new TH1I("EmptyPayload", "Numer of orbits with empty payload", NFees, 0, NFees); - getObjectsManager()->startPublishing(mEmptyPayload); - mTrigger = new TH1I("TriggerFlag", "Trigger vs counts", mTriggerType.size(), 0.5, mTriggerType.size() + 0.5); getObjectsManager()->startPublishing(mTrigger); // mTrigger @@ -146,7 +143,7 @@ void ITSFeeTask::createFeePlots() 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 getObjectsManager()->startPublishing(mFlag1Check); // mFlag1Check - 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! + 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! getObjectsManager()->startPublishing(mDecodingCheck); mPayloadSize = new TH2F("PayloadSize", "Payload Size", NFees, 0, NFees, mNPayloadSizeBins, 0, 4.096e5); @@ -517,7 +514,10 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) } // if doLookForTDT || mDecodeCDW - // + // Check on empty payload + if (!it.size()) { + mDecodingCheck->Fill(ifee, 5); + } // Operations at the first page of each orbit // - decoding ITS header work and fill histogram with number of active lanes @@ -551,10 +551,6 @@ void ITSFeeTask::monitorData(o2::framework::ProcessingContext& ctx) // Operations at last page of each orbit: - if ((int)(o2::raw::RDHUtils::getStop(rdh)) && !it.size()) { - mEmptyPayload->Fill(ifee); - } - // - decoding Diagnostic Word DDW0 and fill lane status plots and vectors if ((int)(o2::raw::RDHUtils::getStop(rdh)) && it.size()) {