Skip to content

Commit 0d5c64b

Browse files
author
Lucia Anna Tarasovicova
committed
Input aligment check
1 parent b2b2a74 commit 0d5c64b

File tree

4 files changed

+95
-7
lines changed

4 files changed

+95
-7
lines changed

Modules/CTP/include/CTP/RawDataQcTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class CTPRawDataReaderTask final : public TaskInterface
5656
std::unique_ptr<TH1DRatio> mHistoClassRatios = nullptr; // histogram with ctp class ratios to MB
5757
std::unique_ptr<TH1D> mHistoBCMinBias1 = nullptr; // histogram of BC positions to check LHC filling scheme
5858
std::unique_ptr<TH1D> mHistoBCMinBias2 = nullptr; // histogram of BC positions to check LHC filling scheme
59+
std::unique_ptr<TH1D> mHistoDecodeError = nullptr; // histogram of erros from decoder
5960
int mRunNumber;
6061
int indexMB1 = -1;
6162
int indexMB2 = -1;

Modules/CTP/src/RawDataQcTask.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
5151
mHistoBCMinBias2 = std::make_unique<TH1D>("bcMinBias2", "BC position MB2", norbits, 0, norbits);
5252
mHistoInputRatios = std::make_unique<TH1DRatio>("inputRatio", "Input Ratio to MTVX; Input; Ratio;", ninps, 0, ninps, true);
5353
mHistoClassRatios = std::make_unique<TH1DRatio>("classRatio", "Class Ratio to MB; Class; Ratio", nclasses, 0, nclasses, true);
54+
mHistoDecodeError = std::make_unique<TH1D>("decodeError", "Errors from decoder", 10, 1, 11);
5455
getObjectsManager()->startPublishing(mHistoInputs.get());
5556
getObjectsManager()->startPublishing(mHistoClasses.get());
5657
getObjectsManager()->startPublishing(mHistoClassRatios.get());
5758
getObjectsManager()->startPublishing(mHistoInputRatios.get());
5859
getObjectsManager()->startPublishing(mHistoBCMinBias1.get());
5960
getObjectsManager()->startPublishing(mHistoBCMinBias2.get());
61+
getObjectsManager()->startPublishing(mHistoDecodeError.get());
6062

6163
mDecoder.setDoLumi(1);
64+
mDecoder.setDecodeInps(1);
65+
mDecoder.setCheckConsistency(1);
6266
mDecoder.setDoDigits(1);
6367
for (size_t i = 0; i < nclasses; i++) {
6468
classNames[i] = "";
@@ -76,6 +80,7 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
7680
mHistoInputRatios->Reset();
7781
mHistoBCMinBias1->Reset();
7882
mHistoBCMinBias2->Reset();
83+
mHistoDecodeError->Reset();
7984

8085
mRunNumber = activity.mId;
8186
mTimestamp = activity.mValidity.getMin();
@@ -115,6 +120,7 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
115120
break;
116121
}
117122
}
123+
mDecoder.setCTPConfig(*ctpconfigdb);
118124
} else {
119125
ILOG(Warning, Support) << "CTP config not found, run:" << run << ENDM;
120126
}
@@ -215,7 +221,10 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
215221
std::vector<o2::ctp::CTPDigit> outputDigits;
216222

217223
o2::framework::InputRecord& inputs = ctx.inputs();
218-
mDecoder.decodeRaw(inputs, filter, outputDigits, lumiPointsHBF1);
224+
int ret = mDecoder.decodeRaw(inputs, filter, outputDigits, lumiPointsHBF1);
225+
if (ret > 0) {
226+
mHistoDecodeError->Fill(log2(ret) + 1.5);
227+
}
219228

220229
// reading the ctp inputs and ctp classes
221230
for (auto const digit : outputDigits) {
@@ -282,6 +291,7 @@ void CTPRawDataReaderTask::reset()
282291
mHistoClassRatios->Reset();
283292
mHistoBCMinBias1->Reset();
284293
mHistoBCMinBias2->Reset();
294+
mHistoDecodeError->Reset();
285295
}
286296

287297
} // namespace o2::quality_control_modules::ctp

Modules/CTP/src/RawDataReaderCheck.cxx

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ Quality RawDataReaderCheck::check(std::map<std::string, std::shared_ptr<MonitorO
137137
result.set(setQualityResult(mVecIndexBad, mVecIndexMedium));
138138
}
139139
mHistClassRatioPrevious = (TH1D*)h->Clone();
140+
} else if (mo->getName() == "decodeError") {
141+
if (h->GetEntries() > 0) {
142+
result.set(Quality::Bad);
143+
} else {
144+
result.set(Quality::Good);
145+
}
140146
} else {
141147
ILOG(Info, Support) << "Unknown histo:" << moName << ENDM;
142148
}
@@ -255,6 +261,77 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
255261
}
256262
h->SetStats(kFALSE);
257263
h->GetYaxis()->SetRangeUser(0, h->GetMaximum() * 1.5);
264+
} else if (mo->getName() == "decodeError") {
265+
auto* h = dynamic_cast<TH1D*>(mo->getObject());
266+
if (checkResult != Quality::Null) {
267+
msg = std::make_shared<TLatex>(0.2, 0.85, Form("Quality: %s", (checkResult.getName()).c_str()));
268+
if (checkResult == Quality::Bad) {
269+
msg->SetTextColor(kRed);
270+
} else if (checkResult == Quality::Good) {
271+
msg->SetTextColor(kGreen + 1);
272+
}
273+
msg->SetTextSize(0.03);
274+
msg->SetNDC();
275+
h->GetListOfFunctions()->Add(msg->Clone());
276+
}
277+
if (checkResult == Quality::Bad) {
278+
float initialMessagePos = 0.8;
279+
if (h->GetBinContent(1) > 0) {
280+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Failed to extract RDD");
281+
msg->SetTextSize(0.03);
282+
msg->SetNDC();
283+
h->GetListOfFunctions()->Add(msg->Clone());
284+
initialMessagePos -= 0.04;
285+
}
286+
if (h->GetBinContent(3) > 0) {
287+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two CTP IRs with the same ts");
288+
msg->SetTextSize(0.03);
289+
msg->SetNDC();
290+
h->GetListOfFunctions()->Add(msg->Clone());
291+
initialMessagePos -= 0.04;
292+
}
293+
if (h->GetBinContent(4) > 0) {
294+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two digits with the same ts");
295+
msg->SetTextSize(0.03);
296+
msg->SetNDC();
297+
h->GetListOfFunctions()->Add(msg->Clone());
298+
initialMessagePos -= 0.04;
299+
}
300+
if (h->GetBinContent(5) > 0) {
301+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two CTP class masks with the same ts");
302+
msg->SetTextSize(0.03);
303+
msg->SetNDC();
304+
h->GetListOfFunctions()->Add(msg->Clone());
305+
initialMessagePos -= 0.04;
306+
}
307+
if (h->GetBinContent(6) > 0) {
308+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two digits (Class Mask) with the same ts");
309+
msg->SetTextSize(0.03);
310+
msg->SetNDC();
311+
h->GetListOfFunctions()->Add(msg->Clone());
312+
initialMessagePos -= 0.04;
313+
}
314+
if (h->GetBinContent(7) > 0) {
315+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Trigger class without input");
316+
msg->SetTextSize(0.03);
317+
msg->SetNDC();
318+
h->GetListOfFunctions()->Add(msg->Clone());
319+
initialMessagePos -= 0.04;
320+
}
321+
if (h->GetBinContent(8) > 0) {
322+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "CTP class mask not compatible with input class mask");
323+
msg->SetTextSize(0.03);
324+
msg->SetNDC();
325+
h->GetListOfFunctions()->Add(msg->Clone());
326+
initialMessagePos -= 0.04;
327+
}
328+
if (h->GetBinContent(9) > 0) {
329+
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "CTP class not found in the digit");
330+
msg->SetTextSize(0.03);
331+
msg->SetNDC();
332+
h->GetListOfFunctions()->Add(msg->Clone());
333+
}
334+
}
258335
} else {
259336
auto* h = dynamic_cast<TH1D*>(mo->getObject());
260337
h->SetStats(kFALSE);

Modules/CTP/src/qc-ctp.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": ""
1717
},
1818
"conditionDB": {
19-
"url": "ccdb-test.cern.ch:8080"
19+
"url": "alice-ccdb.cern.ch"
2020
},
2121
"infologger": { "": "Configuration of the Infologger (optional).",
2222
"filterDiscardDebug": "false", "": "Set to true to discard debug and trace messages (default: false)",
@@ -48,22 +48,22 @@
4848
"ccdbName": "https://alice-ccdb.cern.ch",
4949
"MBclassName" : "CMTVX-B-NOPF",
5050
"MB1inputName" : "MTVX",
51-
"MB2inputName" : "MTVA"
51+
"MB2inputName" : "MVBA"
5252
}
5353
},
5454
"PHYSICS": {
5555
"default": {
5656
"MBclassName" : "CMTVX-B-NOPF",
5757
"MB1inputName" : "MTVX",
58-
"MB2inputName" : "MTVA"
58+
"MB2inputName" : "MVBA"
5959
},
6060
"PROTON-PROTON": {
6161
"MBclassName" : "CMTVX-B-NOPF",
6262
"MB1inputName" : "MTVX",
6363
"MB2inputName" : "MTVA"
6464
},
6565
"Pb-Pb": {
66-
"MBclassName" : "CMTVX-B-NOPF",
66+
"MBclassName" : "CMTCE-B-NOPF",
6767
"MB1inputName" : "MTSC",
6868
"MB2inputName" : "MTCE"
6969
}
@@ -81,14 +81,14 @@
8181
"dataSource": [{
8282
"type": "Task",
8383
"name": "CTPRawData",
84-
"MOs": ["bcMinBias1","bcMinBias2","inputs","classes","inputRatio","classRatio"]
84+
"MOs": ["bcMinBias1","bcMinBias2","inputs","classes","inputRatio","classRatio","decodeError"]
8585
}],
8686
"checkParameters": {
8787
"thresholdRateBad": "3",
8888
"thresholdRateMedium": "2",
8989
"thresholdRateRatioBad": "3",
9090
"thresholdRateRatioMedium": "2",
91-
"mNSigBC": "2"
91+
"nSigmaBC": "1"
9292
}
9393
}
9494
}

0 commit comments

Comments
 (0)