From 56a4afcf6e3ceb0a8e206ba4527397e90db3ad81 Mon Sep 17 00:00:00 2001 From: Ole Schmidt Date: Mon, 16 Oct 2023 09:21:10 +0200 Subject: [PATCH] TRD update data sizes and tracklets per event (#2013) --- Modules/TRD/include/TRD/RawData.h | 4 +-- Modules/TRD/include/TRD/TrackletsTask.h | 2 ++ Modules/TRD/src/RawData.cxx | 35 ++++++++++++++++--------- Modules/TRD/src/TrackletsTask.cxx | 8 ++++++ 4 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Modules/TRD/include/TRD/RawData.h b/Modules/TRD/include/TRD/RawData.h index 7faac5d8fa..88748af4b5 100644 --- a/Modules/TRD/include/TRD/RawData.h +++ b/Modules/TRD/include/TRD/RawData.h @@ -23,14 +23,13 @@ class TH1F; class TH2F; +class TProfile; using namespace o2::quality_control::core; namespace o2::quality_control_modules::trd { -/// \brief Example Quality Control DPL Task -/// \author My Name class RawData final : public TaskInterface { public: @@ -61,6 +60,7 @@ class RawData final : public TaskInterface TH1F* mDigitParsingTime = nullptr; TH1F* mDataVersionsMajor = nullptr; TH1F* mParsingErrors = nullptr; + TProfile* mDataVolumePerSectorProf = nullptr; std::array mLinkErrors; std::array mParsingErrors2d; bool mCheckDigitHCHeaderVersion = false; diff --git a/Modules/TRD/include/TRD/TrackletsTask.h b/Modules/TRD/include/TRD/TrackletsTask.h index 4c9f59ab46..9c7e612802 100644 --- a/Modules/TRD/include/TRD/TrackletsTask.h +++ b/Modules/TRD/include/TRD/TrackletsTask.h @@ -71,6 +71,8 @@ class TrackletsTask final : public TaskInterface TH1F* mTrackletPosition = nullptr; TH1F* mTrackletPositionRaw = nullptr; TH1F* mTrackletsPerEvent = nullptr; + TH1F* mTrackletsPerEventPP = nullptr; + TH1F* mTrackletsPerEventPbPb = nullptr; TH2F* mTrackletsPerHC2D = nullptr; std::array moHCMCMn; TH1F* mTrackletSlopen = nullptr; diff --git a/Modules/TRD/src/RawData.cxx b/Modules/TRD/src/RawData.cxx index 0b401f5402..c6a26354d1 100644 --- a/Modules/TRD/src/RawData.cxx +++ b/Modules/TRD/src/RawData.cxx @@ -17,6 +17,7 @@ #include "TCanvas.h" #include "TH1F.h" #include "TH2F.h" +#include "TProfile.h" #include "TMath.h" #include "QualityControl/QcInfoLogger.h" @@ -89,17 +90,21 @@ void RawData::buildHistograms() getObjectsManager()->startPublishing(mParsingErrors); getObjectsManager()->setDefaultDrawOptions(mParsingErrors->GetName(), "logy"); - mDataVolumePerHalfChamber = new TH2F("datavolumeperhalfchamber", "Data sizes from HalfCRU header;Half Chamber ID;Data Volume [kB/TF]", 1080, -0.5, 1079.5, 1000, 0, 100); + mDataVolumePerHalfChamber = new TH2F("datavolumeperhalfchamber", "Data sizes from HalfCRU header;Half Chamber ID;Data Volume [Bytes/TF]", 1080, -0.5, 1079.5, 1000, 0, 100); getObjectsManager()->startPublishing(mDataVolumePerHalfChamber); getObjectsManager()->setDefaultDrawOptions("datavolumeperhalfchamber", "COLZ"); getObjectsManager()->setDisplayHint(mDataVolumePerHalfChamber->GetName(), "logz"); - mDataVolumePerSector = new TH2F("datavolumepersector", "Data sizes from HalfCRU header;Sector;Data Volume [kB/TF]", 18, -0.5, 17.5, 1000, 0, 100); + mDataVolumePerSector = new TH2F("datavolumepersector", "Data sizes from HalfCRU header;Sector;Data Volume [Bytes/TF]", 18, -0.5, 17.5, 1000, 0, 4000); mDataVolumePerSector->SetStats(0); getObjectsManager()->startPublishing(mDataVolumePerSector); getObjectsManager()->setDefaultDrawOptions("datavolumepersector", "COLZ"); getObjectsManager()->setDisplayHint(mDataVolumePerSector->GetName(), "logz"); + mDataVolumePerSectorProf = new TProfile("datavolumepersectorProfile", "Data volume by sector;Sector;Data Volume [Bytes/TF]", 18, -0.5, 17.5); + mDataVolumePerSectorProf->Sumw2(); + getObjectsManager()->startPublishing(mDataVolumePerSectorProf); + for (int count = 0; count < o2::trd::TRDLastParsingError; ++count) { std::string label = fmt::format("parsingerrors_{0}", count); std::string title = ParsingErrorsString.at(count); @@ -206,13 +211,18 @@ void RawData::monitorData(o2::framework::ProcessingContext& ctx) mStats->AddBinContent(5, rawdatastats->mDigitsFound); // count total number of digits seen // data per TF per link. + std::array dataSizePerSector{ 0U }; for (int hcid = 0; hcid < MAXHALFCHAMBER; ++hcid) { if (rawdatastats->mLinkWords[hcid] > 0) { int sec = hcid / NHCPERSEC; mDataVolumePerHalfChamber->Fill(hcid, rawdatastats->mLinkWords[hcid] / 32.f); // one link word is 32 bytes, we want to display in units of kB per TF - mDataVolumePerSector->Fill(sec, rawdatastats->mLinkWords[hcid] / 32.f); + dataSizePerSector[sec] += rawdatastats->mLinkWords[hcid] / 32.f; } } + for (int iSec = 0; iSec < NSECTOR; ++iSec) { + mDataVolumePerSector->Fill(iSec, dataSizePerSector[iSec]); + mDataVolumePerSectorProf->Fill(iSec, dataSizePerSector[iSec]); + } // parsing errors for (int error = 0; error < TRDLastParsingError; ++error) { @@ -238,28 +248,28 @@ void RawData::monitorData(o2::framework::ProcessingContext& ctx) int stackLayer = HelperMethods::getStack(hcid / 2) * NLAYER + HelperMethods::getLayer(hcid / 2); int sectorSide = (hcid / NHCPERSEC) * 2 + (hcid % 2); if (rawdatastats->mLinkErrorFlag[hcid] == 0) { //"Count of Link had no errors during tf", - mLinkErrors[0]->Fill((double)sectorSide, (double)stackLayer); + mLinkErrors[0]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkErrorFlag[hcid] & 0x1) { //"Count of # times Linkerrors 0x1 seen per tf", - mLinkErrors[1]->Fill((double)sectorSide, (double)stackLayer, rawdatastats->mLinkErrorFlag[hcid]); + mLinkErrors[1]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkErrorFlag[hcid] & 0x2) { //"Count of # time Linkerrors 0x2 seen per tf", - mLinkErrors[2]->Fill((double)sectorSide, (double)stackLayer, rawdatastats->mLinkErrorFlag[hcid]); + mLinkErrors[2]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkErrorFlag[hcid] != 0) { //"Count of any Linkerror seen during tf", - mLinkErrors[3]->Fill((double)sectorSide, (double)stackLayer, rawdatastats->mLinkErrorFlag[hcid]); + mLinkErrors[3]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkWordsRejected[hcid] + rawdatastats->mLinkWordsRead[hcid] == 0) { - mLinkErrors[4]->Fill((double)sectorSide, (double)stackLayer); + mLinkErrors[4]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkWordsRead[hcid] > 0) { //"Link was seen with data during a tf", - mLinkErrors[5]->Fill((double)sectorSide, (double)stackLayer, rawdatastats->mLinkWordsRead[hcid]); + mLinkErrors[5]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkWordsRejected[hcid] > 0) { //"Links seen with corrupted data during tf" - mLinkErrors[6]->Fill((double)sectorSide, (double)stackLayer); + mLinkErrors[6]->Fill(sectorSide, stackLayer); } - if (rawdatastats->mLinkWordsRejected[hcid] == 0) { //"Links seen with out corrupted data during tf", "", - mLinkErrors[7]->Fill((double)sectorSide, (double)stackLayer); + if (rawdatastats->mLinkWordsRejected[hcid] == 0) { //"Links seen without corrupted data during tf" + mLinkErrors[7]->Fill(sectorSide, stackLayer); } if (rawdatastats->mLinkWordsRead[hcid] != 0) { ILOG(Debug, Devel) << "Accepted Data volume on link: " << rawdatastats->mLinkWordsRead[hcid] << ENDM; @@ -319,6 +329,7 @@ void RawData::resetHistograms() mParsingErrors->Reset(); mDataVolumePerHalfChamber->Reset(); mDataVolumePerSector->Reset(); + mDataVolumePerSectorProf->Reset(); } } // namespace o2::quality_control_modules::trd diff --git a/Modules/TRD/src/TrackletsTask.cxx b/Modules/TRD/src/TrackletsTask.cxx index fc938435e8..efec7afc59 100644 --- a/Modules/TRD/src/TrackletsTask.cxx +++ b/Modules/TRD/src/TrackletsTask.cxx @@ -158,6 +158,10 @@ void TrackletsTask::buildHistograms() mTrackletsPerEvent = new TH1F("trackletsperevent", "Number of Tracklets per event;Tracklets in Event;Counts", nLogBins, xBins); getObjectsManager()->startPublishing(mTrackletsPerEvent); getObjectsManager()->setDefaultDrawOptions(mTrackletsPerEvent->GetName(), "logx"); + mTrackletsPerEventPP = new TH1F("trackletspereventPP", "Number of Tracklets per event;Tracklets in Event;Counts", 1000, 0, 5000); + getObjectsManager()->startPublishing(mTrackletsPerEventPP); + mTrackletsPerEventPbPb = new TH1F("trackletspereventPbPb", "Number of Tracklets per event;Tracklets in Event;Counts", 1000, 0, 100000); + getObjectsManager()->startPublishing(mTrackletsPerEventPbPb); mTrackletsPerHC2D = new TH2F("trackletsperHC2D", "Tracklets distribution in half-chambers;Sector_Side;Stack_Side", 36, 0, 36, 30, 0, 30); mTrackletsPerHC2D->SetStats(0); mTrackletsPerHC2D->GetXaxis()->SetTitle("Sector_Side"); @@ -379,6 +383,8 @@ void TrackletsTask::monitorData(o2::framework::ProcessingContext& ctx) mTriggersPerTimeFrame->Fill(triggerrecords.size()); for (auto& trigger : triggerrecords) { mTrackletsPerEvent->Fill(trigger.getNumberOfTracklets()); + mTrackletsPerEventPP->Fill(trigger.getNumberOfTracklets()); + mTrackletsPerEventPbPb->Fill(trigger.getNumberOfTracklets()); for (int currenttracklet = trigger.getFirstTracklet(); currenttracklet < trigger.getFirstTracklet() + trigger.getNumberOfTracklets(); ++currenttracklet) { int detector = tracklets[currenttracklet].getDetector(); int sm = detector / 30; @@ -466,6 +472,8 @@ void TrackletsTask::reset() mTrackletPosition->Reset(); mTrackletPositionRaw->Reset(); mTrackletsPerEvent->Reset(); + mTrackletsPerEventPP->Reset(); + mTrackletsPerEventPbPb->Reset(); mTrackletsPerHC2D->Reset(); for (auto h : moHCMCMn) { h->Reset();