Skip to content

Commit

Permalink
TRD update data sizes and tracklets per event (#2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
martenole authored Oct 16, 2023
1 parent 6a90fc5 commit 56a4afc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Modules/TRD/include/TRD/RawData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -61,6 +60,7 @@ class RawData final : public TaskInterface
TH1F* mDigitParsingTime = nullptr;
TH1F* mDataVersionsMajor = nullptr;
TH1F* mParsingErrors = nullptr;
TProfile* mDataVolumePerSectorProf = nullptr;
std::array<TH2F*, 10> mLinkErrors;
std::array<TH2F*, o2::trd::ParsingErrors::TRDLastParsingError> mParsingErrors2d;
bool mCheckDigitHCHeaderVersion = false;
Expand Down
2 changes: 2 additions & 0 deletions Modules/TRD/include/TRD/TrackletsTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<TH2F*, 18> moHCMCMn;
TH1F* mTrackletSlopen = nullptr;
Expand Down
35 changes: 23 additions & 12 deletions Modules/TRD/src/RawData.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "TCanvas.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TProfile.h"
#include "TMath.h"

#include "QualityControl/QcInfoLogger.h"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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<uint32_t, NSECTOR> 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) {
Expand All @@ -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;
Expand Down Expand Up @@ -319,6 +329,7 @@ void RawData::resetHistograms()
mParsingErrors->Reset();
mDataVolumePerHalfChamber->Reset();
mDataVolumePerSector->Reset();
mDataVolumePerSectorProf->Reset();
}

} // namespace o2::quality_control_modules::trd
8 changes: 8 additions & 0 deletions Modules/TRD/src/TrackletsTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 56a4afc

Please sign in to comment.