From 60f83c35f5de8e1df2381ed38b51ad5f3f56b02b Mon Sep 17 00:00:00 2001 From: its Date: Tue, 13 Jul 2021 09:12:30 +0200 Subject: [PATCH] ITS:Fhr TH2Poly merge bug fix, ITSFhrCheck bug fix --- Modules/ITS/src/ITSFhrCheck.cxx | 13 +++++++++---- Modules/ITS/src/ITSFhrTask.cxx | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Modules/ITS/src/ITSFhrCheck.cxx b/Modules/ITS/src/ITSFhrCheck.cxx index 5b5c3eebec..dd2fc42532 100644 --- a/Modules/ITS/src/ITSFhrCheck.cxx +++ b/Modules/ITS/src/ITSFhrCheck.cxx @@ -59,10 +59,10 @@ std::string ITSFhrCheck::getAcceptedType() { return "TH1"; } void ITSFhrCheck::beautify(std::shared_ptr mo, Quality checkResult) { - auto* h = dynamic_cast(mo->getObject()); - auto* msg = new TPaveText(0.5, 0.5, 0.9, 0.75, "NDC"); - msg->SetName(Form("%s_msg", mo->GetName())); if (mo->getName() == "General/ErrorPlots") { + auto* h = dynamic_cast(mo->getObject()); + auto* msg = new TPaveText(0.5, 0.5, 0.9, 0.75, "NDC"); + msg->SetName(Form("%s_msg", mo->GetName())); if (checkResult == Quality::Good) { msg->Clear(); msg->AddText("Quality::Good"); @@ -75,7 +75,11 @@ void ITSFhrCheck::beautify(std::shared_ptr mo, Quality checkResul msg->AddText("Decoding ERROR detected"); msg->AddText("please inform SL"); } + h->GetListOfFunctions()->Add(msg); } else if (mo->getName() == "General/General_Occupancy") { + auto* h = dynamic_cast(mo->getObject()); + auto* msg = new TPaveText(0.5, 0.5, 0.9, 0.75, "NDC"); + msg->SetName(Form("%s_msg", mo->GetName())); if (checkResult == Quality::Good) { msg->Clear(); msg->AddText("Quality::Good"); @@ -85,6 +89,7 @@ void ITSFhrCheck::beautify(std::shared_ptr mo, Quality checkResul msg->AddText("Quality::Bad"); msg->SetTextColor(kRed); msg->AddText("Max Occupancy over 10^{-5}"); + msg->AddText("or ERROR detected"); msg->AddText("Please Inform SL"); } else if (checkResult == Quality::Medium) { msg->Clear(); @@ -92,8 +97,8 @@ void ITSFhrCheck::beautify(std::shared_ptr mo, Quality checkResul msg->SetTextColor(kOrange); msg->AddText("Max Occupancy over 10^{-6}"); } + h->GetListOfFunctions()->Add(msg); } - h->GetListOfFunctions()->Add(msg); } } // namespace o2::quality_control_modules::its diff --git a/Modules/ITS/src/ITSFhrTask.cxx b/Modules/ITS/src/ITSFhrTask.cxx index c06f7aeee6..757c3f4306 100644 --- a/Modules/ITS/src/ITSFhrTask.cxx +++ b/Modules/ITS/src/ITSFhrTask.cxx @@ -105,11 +105,13 @@ void ITSFhrTask::initialize(o2::framework::InitContext& /*ctx*/) mOccupancy = new double*[NStaves[mLayer]]; mErrorCount = new int**[NStaves[mLayer]]; - for (int istave = 0; istave < NStaves[mLayer]; istave++) { - double* px = new double[4]; - double* py = new double[4]; - getStavePoint(mLayer, istave, px, py); - mGeneralOccupancy->AddBin(4, px, py); + for (int ilayer = 0; ilayer < 7; ilayer++) { + for (int istave = 0; istave < NStaves[ilayer]; istave++) { + double* px = new double[4]; + double* py = new double[4]; + getStavePoint(ilayer, istave, px, py); + mGeneralOccupancy->AddBin(4, px, py); + } } if (mGeneralOccupancy) { getObjectsManager()->startPublishing(mGeneralOccupancy); @@ -618,7 +620,7 @@ void ITSFhrTask::monitorData(o2::framework::ProcessingContext& ctx) } } } - mGeneralOccupancy->SetBinContent(istave + 1, *(std::max_element(mOccupancy[istave], mOccupancy[istave] + nChipsPerHic[lay]))); + mGeneralOccupancy->SetBinContent(istave + 1 + StaveBoundary[mLayer], *(std::max_element(mOccupancy[istave], mOccupancy[istave] + nChipsPerHic[lay]))); } else { for (int ihic = 0; ihic < nHicPerStave[lay]; ihic++) { int ilink = ihic / (nHicPerStave[lay] / 2); @@ -626,13 +628,13 @@ void ITSFhrTask::monitorData(o2::framework::ProcessingContext& ctx) if (ihic == 0 || ihic == 7) { for (int ierror = 0; ierror < o2::itsmft::GBTLinkDecodingStat::NErrorsDefined; ierror++) { if (mErrorVsFeeid && (mErrorCount[istave][ilink][ierror] != 0)) { - mErrorVsFeeid->SetBinContent((3 * StaveBoundary[3]) + (istave * 2) + ilink + 1, ierror + 1, mErrorCount[istave][ilink][ierror]); + mErrorVsFeeid->SetBinContent((3 * StaveBoundary[3]) + ((StaveBoundary[lay] - StaveBoundary[NLayerIB] + istave) * 2) + ilink + 1, ierror + 1, mErrorCount[istave][ilink][ierror]); } } } } + mGeneralOccupancy->SetBinContent(istave + 1 + StaveBoundary[mLayer], *(std::max_element(mOccupancy[istave], mOccupancy[istave] + nChipsPerHic[lay]))); } - mGeneralOccupancy->SetBinContent(istave + 1, *(std::max_element(mOccupancy[istave], mOccupancy[istave] + nChipsPerHic[lay]))); } for (int ierror = 0; ierror < o2::itsmft::GBTLinkDecodingStat::NErrorsDefined; ierror++) { int feeError = mErrorVsFeeid->Integral(1, mErrorVsFeeid->GetXaxis()->GetNbins(), ierror + 1, ierror + 1);