Skip to content

Commit de69a31

Browse files
authored
[FOCAL-8] Adding payload size histograms for pixels and TF (#1833)
- Payload size pixels in number of GBT words - Payload TF in Byte
1 parent 12a8bfb commit de69a31

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

Modules/FOCAL/include/FOCAL/TestbeamRawTask.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ class TestbeamRawTask final : public TaskInterface
115115
TH1* mNumLinksTF = nullptr; ///< Number of links per timeframe
116116
TH1* mNumHBFPerCRU = nullptr; ///< Number of HBFs per CRU
117117
TH2* mCRUcounter = nullptr; ///< CRU counter
118+
TH1* mPayloadSizeTF = nullptr; ///< Payload size per timeframe
118119

119120
/////////////////////////////////////////////////////////////////////////////////////
120121
/// Pad histograms
121122
/////////////////////////////////////////////////////////////////////////////////////
122-
TH1* mPayloadSizePadsGBT; ///< Payload size GBT words of pad data
123+
TH1* mPayloadSizePadsGBT = nullptr; ///< Payload size GBT words of pad data
123124
std::array<TH2*, PAD_ASICS> mPadASICChannelADC; ///< ADC per channel for each ASIC
124125
std::array<TH2*, PAD_ASICS> mPadASICChannelTOA; ///< TOA per channel for each ASIC
125126
std::array<TH2*, PAD_ASICS> mPadASICChannelTOT; ///< TOT per channel for each ASIC
@@ -151,6 +152,7 @@ class TestbeamRawTask final : public TaskInterface
151152
/////////////////////////////////////////////////////////////////////////////////////
152153
/// Pixel histograms
153154
/////////////////////////////////////////////////////////////////////////////////////
155+
TH1* mPayloadSizePixelsGBT = nullptr; ///< Payload size pixel data in GBT word
154156
TH1* mLinksWithPayloadPixel = nullptr; ///< HBF with payload per link
155157
TH2* mTriggersFeePixel = nullptr; ///< Nunber of triggers per HBF and FEE ID
156158
TProfile2D* mAverageHitsChipPixel = nullptr; ///< Average number of hits / chip

Modules/FOCAL/src/TestbeamRawTask.cxx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ TestbeamRawTask::~TestbeamRawTask()
7070
for (auto& hist : mPadASICChannelTOT) {
7171
delete hist;
7272
};
73+
if (mPayloadSizePadsGBT) {
74+
delete mPayloadSizePadsGBT;
75+
}
76+
if (mPayloadSizePixelsGBT) {
77+
delete mPayloadSizePixelsGBT;
78+
}
79+
if (mPayloadSizeTF) {
80+
delete mPayloadSizeTF;
81+
}
7382
if (mLinksWithPayloadPixel) {
7483
delete mLinksWithPayloadPixel;
7584
}
@@ -280,6 +289,9 @@ void TestbeamRawTask::initialize(o2::framework::InitContext& /*ctx*/)
280289
mCRUcounter->GetYaxis()->SetTitle("Link ID");
281290
getObjectsManager()->startPublishing(mCRUcounter);
282291

292+
mPayloadSizeTF = new TH1D("PayloadSizeTF", "Payload size TF", 10000, 0., 10000.);
293+
getObjectsManager()->startPublishing(mPayloadSizeTF);
294+
283295
/////////////////////////////////////////////////////////////////
284296
/// PAD histograms
285297
/////////////////////////////////////////////////////////////////
@@ -420,6 +432,9 @@ void TestbeamRawTask::initialize(o2::framework::InitContext& /*ctx*/)
420432
mPixelChipsIDsHits->SetDirectory(nullptr);
421433
getObjectsManager()->startPublishing(mPixelChipsIDsHits);
422434

435+
mPayloadSizePixelsGBT = new TH1D("PayloadSizePixelsGBT", "Payload size GBT words", 10000, 0., 10000.);
436+
getObjectsManager()->startPublishing(mPayloadSizePixelsGBT);
437+
423438
for (int ifee = 0; ifee < 4; ifee++) {
424439
mPixelLaneIDChipIDFEE[ifee] = new TH2D(Form("Pixel_LaneIDChipID_FEE%d", ifee), Form("Lane ID vs. Chip ID for FEE %d; Lane ID; ChipID", ifee), 57, -0.5, 56.5, 31, -0.5, 30.5);
425440
mPixelLaneIDChipIDFEE[ifee]->SetDirectory(nullptr);
@@ -512,6 +527,7 @@ void TestbeamRawTask::monitorData(o2::framework::ProcessingContext& ctx)
512527
for (const auto& rawData : framework::InputRecordWalker(ctx.inputs())) {
513528
if (rawData.header != nullptr && rawData.payload != nullptr) {
514529
const auto payloadSize = o2::framework::DataRefUtils::getPayloadSize(rawData);
530+
mPayloadSizeTF->Fill(payloadSize);
515531
auto header = o2::framework::DataRefUtils::getHeader<o2::header::DataHeader*>(rawData);
516532
ILOG(Debug, Support) << "Channel " << header->dataOrigin.str << "/" << header->dataDescription.str << "/" << header->subSpecification << ENDM;
517533

@@ -559,6 +575,7 @@ void TestbeamRawTask::monitorData(o2::framework::ProcessingContext& ctx)
559575
if (!mDisablePads) {
560576
ILOG(Debug, Support) << "Processing PAD data" << ENDM;
561577
auto payloadsizeGBT = rawbuffer.size() * sizeof(char) / sizeof(o2::focal::PadGBTWord);
578+
mPayloadSizePadsGBT->Fill(payloadsizeGBT);
562579
ILOG(Debug) << "Found pixel payload of size " << rawbuffer.size() << " (" << payloadsizeGBT << " GBT words)" << ENDM;
563580
processPadPayload(gsl::span<const o2::focal::PadGBTWord>(reinterpret_cast<const o2::focal::PadGBTWord*>(rawbuffer.data()), payloadsizeGBT));
564581
}
@@ -568,6 +585,7 @@ void TestbeamRawTask::monitorData(o2::framework::ProcessingContext& ctx)
568585
auto feeID = o2::raw::RDHUtils::getFEEID(rdh);
569586
ILOG(Debug, Support) << "Processing Pixel data from FEE " << feeID << ENDM;
570587
auto payloadsizeGBT = rawbuffer.size() * sizeof(char) / sizeof(o2::itsmft::GBTWord);
588+
mPayloadSizePixelsGBT->Fill(payloadsizeGBT);
571589
ILOG(Debug, Support) << "Found pixel payload of size " << rawbuffer.size() << " (" << payloadsizeGBT << " GBT words)" << ENDM;
572590
processPixelPayload(gsl::span<const o2::itsmft::GBTWord>(reinterpret_cast<const o2::itsmft::GBTWord*>(rawbuffer.data()), payloadsizeGBT), feeID);
573591
}
@@ -857,6 +875,9 @@ void TestbeamRawTask::processPixelPayload(gsl::span<const o2::itsmft::GBTWord> p
857875

858876
mPixelDecoder.reset();
859877
mPixelDecoder.decodeEvent(pixelpayload);
878+
if (pixelpayload.size()) {
879+
ILOG(Debug, Support) << "Found pixel payload of size: " << pixelpayload.size() << " -> " << mPixelDecoder.getChipData().size() << " chips" << ENDM;
880+
}
860881

861882
mTriggersFeePixel->Fill(useFEE, mPixelDecoder.getChipData().size());
862883

@@ -987,6 +1008,7 @@ void TestbeamRawTask::reset()
9871008
mNumLinksTF->Reset();
9881009
mNumHBFPerCRU->Reset();
9891010
mCRUcounter->Reset();
1011+
mPayloadSizeTF->Reset();
9901012
if (!mDisablePads) {
9911013
mPayloadSizePadsGBT->Reset();
9921014
for (auto padadc : mPadASICChannelADC) {
@@ -1063,6 +1085,7 @@ void TestbeamRawTask::reset()
10631085
}
10641086

10651087
if (!mDisablePixels) {
1088+
mPayloadSizePixelsGBT->Reset();
10661089
if (mLinksWithPayloadPixel) {
10671090
mLinksWithPayloadPixel->Reset();
10681091
}

0 commit comments

Comments
 (0)