Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Modules/CTP/include/CTP/RawDataQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class CTPRawDataReaderTask final : public TaskInterface
std::unique_ptr<TH1DRatio> mHistoClassRatios = nullptr; // histogram with ctp class ratios to MB
std::unique_ptr<TH1D> mHistoBCMinBias1 = nullptr; // histogram of BC positions to check LHC filling scheme
std::unique_ptr<TH1D> mHistoBCMinBias2 = nullptr; // histogram of BC positions to check LHC filling scheme
std::unique_ptr<TH1D> mHistoDecodeError = nullptr; // histogram of erros from decoder
int mRunNumber;
int indexMB1 = -1;
int indexMB2 = -1;
Expand Down
12 changes: 11 additions & 1 deletion Modules/CTP/src/RawDataQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,18 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
mHistoBCMinBias2 = std::make_unique<TH1D>("bcMinBias2", "BC position MB2", norbits, 0, norbits);
mHistoInputRatios = std::make_unique<TH1DRatio>("inputRatio", "Input Ratio to MTVX; Input; Ratio;", ninps, 0, ninps, true);
mHistoClassRatios = std::make_unique<TH1DRatio>("classRatio", "Class Ratio to MB; Class; Ratio", nclasses, 0, nclasses, true);
mHistoDecodeError = std::make_unique<TH1D>("decodeError", "Errors from decoder", 10, 1, 11);
getObjectsManager()->startPublishing(mHistoInputs.get());
getObjectsManager()->startPublishing(mHistoClasses.get());
getObjectsManager()->startPublishing(mHistoClassRatios.get());
getObjectsManager()->startPublishing(mHistoInputRatios.get());
getObjectsManager()->startPublishing(mHistoBCMinBias1.get());
getObjectsManager()->startPublishing(mHistoBCMinBias2.get());
getObjectsManager()->startPublishing(mHistoDecodeError.get());

mDecoder.setDoLumi(1);
mDecoder.setDecodeInps(1);
mDecoder.setCheckConsistency(1);
mDecoder.setDoDigits(1);
for (size_t i = 0; i < nclasses; i++) {
classNames[i] = "";
Expand All @@ -76,6 +80,7 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
mHistoInputRatios->Reset();
mHistoBCMinBias1->Reset();
mHistoBCMinBias2->Reset();
mHistoDecodeError->Reset();

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

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

// reading the ctp inputs and ctp classes
for (auto const digit : outputDigits) {
Expand Down Expand Up @@ -282,6 +291,7 @@ void CTPRawDataReaderTask::reset()
mHistoClassRatios->Reset();
mHistoBCMinBias1->Reset();
mHistoBCMinBias2->Reset();
mHistoDecodeError->Reset();
}

} // namespace o2::quality_control_modules::ctp
77 changes: 77 additions & 0 deletions Modules/CTP/src/RawDataReaderCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ Quality RawDataReaderCheck::check(std::map<std::string, std::shared_ptr<MonitorO
result.set(setQualityResult(mVecIndexBad, mVecIndexMedium));
}
mHistClassRatioPrevious = (TH1D*)h->Clone();
} else if (mo->getName() == "decodeError") {
if (h->GetEntries() > 0) {
result.set(Quality::Bad);
} else {
result.set(Quality::Good);
}
} else {
ILOG(Info, Support) << "Unknown histo:" << moName << ENDM;
}
Expand Down Expand Up @@ -255,6 +261,77 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
}
h->SetStats(kFALSE);
h->GetYaxis()->SetRangeUser(0, h->GetMaximum() * 1.5);
} else if (mo->getName() == "decodeError") {
auto* h = dynamic_cast<TH1D*>(mo->getObject());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h can be null. Please check for it and return if needed.

if (checkResult != Quality::Null) {
msg = std::make_shared<TLatex>(0.2, 0.85, Form("Quality: %s", (checkResult.getName()).c_str()));
if (checkResult == Quality::Bad) {
msg->SetTextColor(kRed);
} else if (checkResult == Quality::Good) {
msg->SetTextColor(kGreen + 1);
}
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
}
if (checkResult == Quality::Bad) {
float initialMessagePos = 0.8;
if (h->GetBinContent(1) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Failed to extract RDD");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same piece of code is repeated again and again. Please extract it in a method.

}
if (h->GetBinContent(3) > 0) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this series of if can probably be replaced by a loop but that's up to you.

msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two CTP IRs with the same ts");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
}
if (h->GetBinContent(4) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two digits with the same ts");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
}
if (h->GetBinContent(5) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two CTP class masks with the same ts");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
}
if (h->GetBinContent(6) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Two digits (Class Mask) with the same ts");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
}
if (h->GetBinContent(7) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "Trigger class without input");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
}
if (h->GetBinContent(8) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "CTP class mask not compatible with input class mask");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
initialMessagePos -= 0.04;
}
if (h->GetBinContent(9) > 0) {
msg = std::make_shared<TLatex>(0.2, initialMessagePos, "CTP class not found in the digit");
msg->SetTextSize(0.03);
msg->SetNDC();
h->GetListOfFunctions()->Add(msg->Clone());
}
}
} else {
auto* h = dynamic_cast<TH1D*>(mo->getObject());
h->SetStats(kFALSE);
Expand Down
12 changes: 6 additions & 6 deletions Modules/CTP/src/qc-ctp.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"url": ""
},
"conditionDB": {
"url": "ccdb-test.cern.ch:8080"
"url": "alice-ccdb.cern.ch"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as these files are used for test, I wouldn't advise pointing to production.

},
"infologger": { "": "Configuration of the Infologger (optional).",
"filterDiscardDebug": "false", "": "Set to true to discard debug and trace messages (default: false)",
Expand Down Expand Up @@ -48,22 +48,22 @@
"ccdbName": "https://alice-ccdb.cern.ch",
"MBclassName" : "CMTVX-B-NOPF",
"MB1inputName" : "MTVX",
"MB2inputName" : "MTVA"
"MB2inputName" : "MVBA"
}
},
"PHYSICS": {
"default": {
"MBclassName" : "CMTVX-B-NOPF",
"MB1inputName" : "MTVX",
"MB2inputName" : "MTVA"
"MB2inputName" : "MVBA"
},
"PROTON-PROTON": {
"MBclassName" : "CMTVX-B-NOPF",
"MB1inputName" : "MTVX",
"MB2inputName" : "MTVA"
},
"Pb-Pb": {
"MBclassName" : "CMTVX-B-NOPF",
"MBclassName" : "CMTCE-B-NOPF",
"MB1inputName" : "MTSC",
"MB2inputName" : "MTCE"
}
Expand All @@ -81,14 +81,14 @@
"dataSource": [{
"type": "Task",
"name": "CTPRawData",
"MOs": ["bcMinBias1","bcMinBias2","inputs","classes","inputRatio","classRatio"]
"MOs": ["bcMinBias1","bcMinBias2","inputs","classes","inputRatio","classRatio","decodeError"]
}],
"checkParameters": {
"thresholdRateBad": "3",
"thresholdRateMedium": "2",
"thresholdRateRatioBad": "3",
"thresholdRateRatioMedium": "2",
"mNSigBC": "2"
"nSigmaBC": "1"
}
}
}
Expand Down