Skip to content

Commit b525a4e

Browse files
MID:: TaskDigits : Add CRU,EP, GBTRate
1 parent 43c72f0 commit b525a4e

File tree

7 files changed

+118
-21
lines changed

7 files changed

+118
-21
lines changed

Modules/MUON/MID/include/MID/DigitsQcTask.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class DigitsQcTask final : public TaskInterface
6969
std::unique_ptr<TH1F> mNbLBHighRate{ nullptr };
7070
std::unique_ptr<TH1F> mLBHighRate{ nullptr };
7171

72+
std::unique_ptr<TH1F> mGBTRate{ nullptr };
73+
std::unique_ptr<TH1F> mCRURate{ nullptr };
74+
std::unique_ptr<TH1F> mEPRate{ nullptr };
75+
7276
std::array<std::unique_ptr<TH1F>, 5> mMultHitB{};
7377
std::array<std::unique_ptr<TH1F>, 5> mMultHitNB{};
7478
std::unique_ptr<TH1F> mMeanMultiHits;
@@ -82,6 +86,8 @@ class DigitsQcTask final : public TaskInterface
8286
std::array<std::unique_ptr<TH2F>, 4> mNBendHitsMap{};
8387

8488
std::unique_ptr<TH1F> mDigitBCCounts{ nullptr };
89+
90+
o2::mid::Mapping mMapping;
8591
};
8692

8793
} // namespace o2::quality_control_modules::mid

Modules/MUON/MID/src/ClustQcTask.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void ClustQcTask::monitorData(o2::framework::ProcessingContext& ctx)
184184
}
185185
}
186186
} // loop on MT //
187-
} // cluster in ROF //
187+
} // cluster in ROF //
188188
mMultClust11->Fill(multClusterMT11);
189189
mMultClust12->Fill(multClusterMT12);
190190
mMultClust21->Fill(multClusterMT21);

Modules/MUON/MID/src/DigitsHelper.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <fmt/format.h>
1818
#include "TH1.h"
1919
#include "TH2.h"
20+
#include "MIDRaw/CrateMapper.h"
21+
#include "MIDRaw/CrateParameters.h"
2022
#include "MIDBase/DetectorParameters.h"
2123
#include "MIDBase/GeometryParameters.h"
2224
#include "MIDGlobalMapping/GlobalMapper.h"
@@ -32,6 +34,7 @@ void DigitsHelper::initMaps()
3234
{
3335
o2::mid::GlobalMapper gm;
3436
auto infos = gm.buildStripsInfo();
37+
o2::mid::CrateMapper cm;
3538

3639
auto stripHistoB = makeStripMapHisto("templateStripB", "templateStripB", 0);
3740
auto stripHistoNB = makeStripMapHisto("templateStripNB", "templateStripNB", 1);
@@ -238,4 +241,4 @@ void DigitsHelper::fillStripHisto(const o2::mid::ColumnData& col, TH1* histo) co
238241
}
239242
}
240243

241-
} // namespace o2::quality_control_modules::mid
244+
} // namespace o2::quality_control_modules::mid

Modules/MUON/MID/src/DigitsQcCheck.cxx

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,21 +263,56 @@ void DigitsQcCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkRes
263263
}
264264
mHistoHelper.updateTitleWithNTF(histo);
265265
histo->SetStats(0);
266-
} else {
266+
} else if (mo->getName().find("BendHitsMap") != std::string::npos) { // Strips Display
267+
// This matches both [N]BendHitsMap*
268+
int maxStrip = 20; // 20kHz Max Display
269+
auto histo = dynamic_cast<TH2F*>(mo->getObject());
270+
mHistoHelper.normalizeHistoTokHz(histo);
271+
histo->SetMaximum(zcontoursStrip.back());
272+
histo->SetContour(zcontoursStrip.size(), zcontoursStrip.data());
273+
histo->SetStats(0);
274+
} else if (mo->getName() == "Hits") {
275+
auto histo = dynamic_cast<TH1F*>(mo->getObject());
276+
mHistoHelper.normalizeHistoTokHz(histo);
277+
histo->SetStats(0);
278+
}
267279

268-
// Strips Display
269-
if (mo->getName().find("BendHitsMap") != std::string::npos) {
270-
// This matches both [N]BendHitsMap*
271-
int maxStrip = 20; // 20kHz Max Display
272-
auto histo = dynamic_cast<TH2F*>(mo->getObject());
280+
else if (mo->getName() == "GBTRate") {
281+
auto histo = dynamic_cast<TH1F*>(mo->getObject());
282+
if (histo) {
283+
// if (mHistoHelper.getNTFs() > 0)
273284
mHistoHelper.normalizeHistoTokHz(histo);
274-
histo->SetMaximum(zcontoursStrip.back());
275-
histo->SetContour(zcontoursStrip.size(), zcontoursStrip.data());
276-
histo->SetStats(0);
277-
} else if (mo->getName() == "Hits") {
278-
auto histo = dynamic_cast<TH1F*>(mo->getObject());
285+
histo->SetMinimum(0.);
286+
TString XLabel[32] = { "5R0", "5R1", "4R0", "4R1", "1R0", "1R1", "0R0", "0R1",
287+
"2R0", "2R1", "3R0", "3R1", "7R0", "7R1", "6R0", "6R1",
288+
"5L0", "5L1", "4L0", "4L1", "1L0", "1L1", "0L0", "0L1",
289+
"2L0", "2L1", "3L0", "3L1", "7L0", "7L1", "6L0", "6L1" };
290+
for (Int_t i = 0; i < 32; ++i)
291+
histo->GetXaxis()->SetBinLabel(i + 1, XLabel[i]);
292+
histo->GetXaxis()->SetLabelSize(0.07);
293+
histo->GetXaxis()->SetLabelColor(4);
294+
}
295+
} else if (mo->getName() == "EPRate") {
296+
auto histo = dynamic_cast<TH1F*>(mo->getObject());
297+
if (histo) {
298+
mHistoHelper.normalizeHistoTokHz(histo);
299+
histo->SetMinimum(0.);
300+
histo->GetXaxis()->SetBinLabel(1, "CRU0(990)-EP0");
301+
histo->GetXaxis()->SetBinLabel(2, "CRU0(990)-EP1");
302+
histo->GetXaxis()->SetBinLabel(3, "CRU1(974)-EP0");
303+
histo->GetXaxis()->SetBinLabel(4, "CRU1(974)-EP1");
304+
histo->GetXaxis()->SetLabelSize(0.07);
305+
histo->GetXaxis()->SetLabelColor(4);
306+
}
307+
} else if (mo->getName() == "CRURate") {
308+
auto histo = dynamic_cast<TH1F*>(mo->getObject());
309+
if (histo) {
279310
mHistoHelper.normalizeHistoTokHz(histo);
280-
histo->SetStats(0);
311+
histo->SetMinimum(0.);
312+
histo->GetXaxis()->SetBinLabel(1, "CRU0 (990)");
313+
histo->GetXaxis()->SetBinLabel(2, "CRU1 (974)");
314+
histo->GetXaxis()->SetLabelSize(0.07);
315+
histo->GetXaxis()->SetLabelColor(4);
281316
}
282317
}
283318
}

Modules/MUON/MID/src/DigitsQcTask.cxx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@
2424
#include <Framework/InputRecord.h>
2525
#include "DataFormatsMID/ColumnData.h"
2626
#include "DataFormatsMID/ROFRecord.h"
27+
#include "MIDBase/Mapping.h"
2728
#include "MIDBase/DetectorParameters.h"
2829
#include "MIDBase/GeometryParameters.h"
2930
#include "MIDWorkflow/ColumnDataSpecsUtils.h"
31+
#include "MIDGlobalMapping/GlobalMapper.h"
32+
#include "MIDRaw/CrateMapper.h"
33+
#include "MIDRaw/CrateParameters.h"
34+
#include "MIDRaw/Decoder.h"
3035
#include "MID/DigitsHelper.h"
3136

3237
namespace o2::quality_control_modules::mid
@@ -52,6 +57,15 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/)
5257
mLBHighRate = std::make_unique<TH1F>("LBHighRate", "LocalBoardHigherRate", 1, 0, 1.);
5358
getObjectsManager()->startPublishing(mLBHighRate.get());
5459

60+
mGBTRate = std::make_unique<TH1F>("GBTRate", "GBTRate", 32, 0, 32.);
61+
getObjectsManager()->startPublishing(mGBTRate.get());
62+
63+
mCRURate = std::make_unique<TH1F>("CRURate", "CRURate", 2, 0, 2.);
64+
getObjectsManager()->startPublishing(mCRURate.get());
65+
66+
mEPRate = std::make_unique<TH1F>("EPRate", "EPRate", 4, 0, 4.);
67+
getObjectsManager()->startPublishing(mEPRate.get());
68+
5569
std::array<string, 4> chId{ "11", "12", "21", "22" };
5670

5771
for (size_t ich = 0; ich < 5; ++ich) {
@@ -128,15 +142,51 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx)
128142
unsigned long int prevSize = 0;
129143
o2::InteractionRecord prevIr;
130144
bool isFirst = true;
145+
146+
o2::mid::CrateMapper cm;
147+
131148
for (auto& rof : rofs) {
132149
auto eventDigits = digits.subspan(rof.firstEntry, rof.nEntries);
133150
evtSizeB.fill(0);
134151
evtSizeNB.fill(0);
152+
135153
for (auto& col : eventDigits) {
154+
136155
auto ich = o2::mid::detparams::getChamber(col.deId);
137156
evtSizeB[ich] += mDigitsHelper.countDigits(col, 0);
138157
evtSizeNB[ich] += mDigitsHelper.countDigits(col, 1);
139158
mDigitsHelper.fillStripHisto(col, mHits.get());
159+
160+
for (int lineId = 0; lineId < 4; lineId++) {
161+
if (col.getBendPattern(lineId)) {
162+
auto locId = cm.deLocalBoardToRO(col.deId, col.columnId, lineId);
163+
164+
int crateId = o2::mid::raw::getCrateId(locId);
165+
int cruId = o2::mid::crateparams::isRightSide(crateId) ? 0 : 1;
166+
int epId = 0;
167+
switch (crateId % 8) {
168+
case 0:
169+
case 1:
170+
case 4:
171+
case 5:
172+
epId = 0;
173+
break;
174+
case 2:
175+
case 3:
176+
case 6:
177+
case 7:
178+
epId = 1;
179+
break;
180+
}
181+
auto locIdInCrate = o2::mid::raw::getLocId(locId);
182+
auto gbtId = o2::mid::crateparams::getGBTIdFromBoardInCrate(locIdInCrate);
183+
auto gbtUniqueId = o2::mid::crateparams::makeGBTUniqueId(crateId, gbtId);
184+
mGBTRate->Fill(gbtUniqueId);
185+
mCRURate->Fill(cruId);
186+
int epIndex = 2 * cruId + epId;
187+
mEPRate->Fill(epIndex);
188+
}
189+
}
140190
}
141191

142192
unsigned long int sizeTot = 0;
@@ -218,6 +268,10 @@ void DigitsQcTask::reset()
218268
resetDisplayHistos();
219269

220270
mDigitBCCounts->Reset();
271+
272+
mGBTRate->Reset();
273+
mCRURate->Reset();
274+
mEPRate->Reset();
221275
}
222276

223277
} // namespace o2::quality_control_modules::mid

Modules/MUON/MID/src/RawQcTask.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ void RawQcTask::monitorData(o2::framework::ProcessingContext& ctx)
232232
int isLoc = (statusWord >> 6) & 1;
233233
int busyLoc = (statusWord >> 5) & 1;
234234
int decisionLoc = (statusWord >> 4) & 1;
235-
236235
int isPhys = (triggerWord >> 2) & 1;
237236
int isCalib = (triggerWord >> 3) & 1;
238237
int sOrb = triggerWord & 1;

Modules/MUON/MID/src/TracksQcTask.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,12 +478,12 @@ void TracksQcTask::monitorData(o2::framework::ProcessingContext& ctx)
478478
mTrackLocalBoardsNBRatio44Map->Fill(-colId - 0.5, linePos, NBFired);
479479
}
480480
} // board in line loop
481-
} // board loop
482-
} // only fire board in the line
483-
} //(EffFlag>2)
484-
} //(EffFlag>1)
485-
} // Efficiency part (EffFlag>0)
486-
} // tracks in ROF
481+
} // board loop
482+
} // only fire board in the line
483+
} //(EffFlag>2)
484+
} //(EffFlag>1)
485+
} // Efficiency part (EffFlag>0)
486+
} // tracks in ROF
487487
mMultTracks->Fill(multTracks);
488488

489489
} // ROFRecords //

0 commit comments

Comments
 (0)