From fedda11abe4590f58ab2ea90e5346d8672ea5fb7 Mon Sep 17 00:00:00 2001 From: its Date: Tue, 19 Oct 2021 14:19:31 +0200 Subject: [PATCH 1/2] ITS:reset the Decoder in ITSFhrTask::reset() --- Modules/ITS/include/ITS/ITSFhrTask.h | 7 ++- Modules/ITS/src/ITSFhrCheck.cxx | 67 +++++++++++++++++----------- Modules/ITS/src/ITSFhrTask.cxx | 16 ++++++- 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/Modules/ITS/include/ITS/ITSFhrTask.h b/Modules/ITS/include/ITS/ITSFhrTask.h index d163e895b3..3f402d1602 100644 --- a/Modules/ITS/include/ITS/ITSFhrTask.h +++ b/Modules/ITS/include/ITS/ITSFhrTask.h @@ -97,7 +97,7 @@ class ITSFhrTask final : public TaskInterface ChipPixelData* mChipDataBuffer = nullptr; std::vector mChipsBuffer; int mHitNumberOfChip[7][48][2][14][14] = { { { { { 0 } } } } }; //layer, stave, substave, hic, chip - int mTimeFrameId = 0; + unsigned int mTimeFrameId = 0; uint32_t mTriggerTypeCount[13] = { 0 }; int mNError = 19; @@ -117,6 +117,11 @@ class ITSFhrTask final : public TaskInterface int*** mErrorCount /* = new int**[NStaves[lay]]*/; //IB : errorcount[stave][FEE][errorid] int mNoisyPixelNumber[7][48] = { { 0 } }; + int mMaxGeneralAxisRange = -3; //the range of TH2Poly plots z axis range, pow(10, mMinGeneralAxisRange) ~ pow(10, mMaxGeneralAxisRange) + int mMinGeneralAxisRange = -12; // + int mMaxGeneralNoisyAxisRange = 4000; + int mMinGeneralNoisyAxisRange = 0; + TString mTriggerType[NTrigger] = { "ORBIT", "HB", "HBr", "HC", "PHYSICS", "PP", "CAL", "SOT", "EOT", "SOC", "EOC", "TF", "INT" }; //General plots diff --git a/Modules/ITS/src/ITSFhrCheck.cxx b/Modules/ITS/src/ITSFhrCheck.cxx index e0bbf7d58b..757ec1e90b 100644 --- a/Modules/ITS/src/ITSFhrCheck.cxx +++ b/Modules/ITS/src/ITSFhrCheck.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include namespace o2::quality_control_modules::its @@ -60,45 +61,59 @@ std::string ITSFhrCheck::getAcceptedType() { return "TH1"; } void ITSFhrCheck::beautify(std::shared_ptr mo, Quality checkResult) { + TLatex *text[5]; 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"); - msg->AddText("There is no Error found"); - msg->SetTextColor(kGreen); + text[0] = new TLatex(0, 0, "Quality::Good"); + text[1] = new TLatex(0, -100, "There is no Error found"); + for(int i = 0; i < 2; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kGreen); + h->GetListOfFunctions()->Add(text[i]); + } } else if (checkResult == Quality::Bad) { - msg->Clear(); - msg->AddText("Quality::Bad"); - msg->SetTextColor(kRed); - msg->AddText("Decoding ERROR detected"); - msg->AddText("please inform SL"); + text[0] = new TLatex(0, 100, "Quality::Bad"); + text[1] = new TLatex(0, 0, "Decoding ERROR detected"); + text[2] = new TLatex(0, -100, "please inform SL"); + for(int i = 0; i < 3; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kRed); + h->GetListOfFunctions()->Add(text[i]); + } } - 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"); - msg->SetTextColor(kGreen); + text[0] = new TLatex(0, 0, "Quality::Good"); + text[0]->SetTextAlign(23); + text[0]->SetTextSize(0.08); + text[0]->SetTextColor(kGreen); + h->GetListOfFunctions()->Add(text[0]); } else if (checkResult == Quality::Bad) { - msg->Clear(); - msg->AddText("Quality::Bad"); - msg->SetTextColor(kRed); - msg->AddText("Max Occupancy over 10^{-5}"); - msg->AddText("or ERROR detected"); - msg->AddText("Please Inform SL"); + text[0] = new TLatex(0, 100, "Quality::Bad"); + text[1] = new TLatex(0, 0, "Max Occupancy over 10^{-5}"); + text[2] = new TLatex(0, -100, "or ERROR detected, Please Inform SL"); + for(int i = 0; i < 3; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kRed); + h->GetListOfFunctions()->Add(text[i]); + } } else if (checkResult == Quality::Medium) { - msg->Clear(); - msg->AddText("Quality::Medium"); - msg->SetTextColor(kOrange); - msg->AddText("Max Occupancy over 10^{-6}"); + text[0] = new TLatex(0, 0, "Quality::Medium"); + text[1] = new TLatex(0, -100, "Max Occupancy over 10^{-6}"); + for(int i = 0; i < 2; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kOrange); + h->GetListOfFunctions()->Add(text[i]); + } } - h->GetListOfFunctions()->Add(msg); } } diff --git a/Modules/ITS/src/ITSFhrTask.cxx b/Modules/ITS/src/ITSFhrTask.cxx index 0453ec392e..2949a3ebfd 100644 --- a/Modules/ITS/src/ITSFhrTask.cxx +++ b/Modules/ITS/src/ITSFhrTask.cxx @@ -88,10 +88,14 @@ void ITSFhrTask::initialize(o2::framework::InitContext& /*ctx*/) mGeneralOccupancy = new TH2Poly(); mGeneralOccupancy->SetTitle("General Occupancy;mm;mm"); mGeneralOccupancy->SetName("General/General_Occupancy"); + mGeneralOccupancy->SetStats(0); + mGeneralOccupancy->GetZaxis()->SetRangeUser(pow(10, mMinGeneralAxisRange), pow(10, mMaxGeneralAxisRange)); mGeneralNoisyPixel = new TH2Poly(); mGeneralNoisyPixel->SetTitle("Noisy Pixel Number;mm;mm"); mGeneralNoisyPixel->SetName("General/Noisy_Pixel"); + mGeneralNoisyPixel->SetStats(0); + mGeneralNoisyPixel->GetZaxis()->SetRangeUser(mMinGeneralNoisyAxisRange, mMaxGeneralNoisyAxisRange); createGeneralPlots(); createOccupancyPlots(); @@ -630,8 +634,8 @@ void ITSFhrTask::monitorData(o2::framework::ProcessingContext& ctx) mChipStaveOccupancy[lay]->SetBinContent(ichip + 1, istave + 1, mOccupancy[istave][ichip]); int ilink = ichip / 3; for (int ierror = 0; ierror < o2::itsmft::GBTLinkDecodingStat::NErrorsDefined; ierror++) { - if (mErrorVsFeeid && (mErrorCount[istave][ilink][ierror] > 0)) { - mErrorVsFeeid->SetBinContent((istave * 3) + ilink + 1, ierror + 1, mErrorCount[istave][ilink][ierror]); + if (mErrorVsFeeid && (mErrorCount[istave][ilink][ierror] != 0)) { + mErrorVsFeeid->SetBinContent(((istave + StaveBoundary[lay]) * 3) + ilink + 1, ierror + 1, mErrorCount[istave][ilink][ierror]); } } } @@ -689,6 +693,10 @@ void ITSFhrTask::getParameters() mGeomPath = mCustomParameters["geomPath"]; mHitCutForNoisyPixel = std::stoi(mCustomParameters["HitNumberCutForNoisyPixel"]); mOccupancyCutForNoisyPixel = std::stof(mCustomParameters["OccupancyNumberCutForNoisyPixel"]); + mMaxGeneralAxisRange = std::stof(mCustomParameters["MaxGeneralAxisRange"]); + mMinGeneralAxisRange = std::stof(mCustomParameters["MinGeneralAxisRange"]); + mMaxGeneralNoisyAxisRange = std::stof(mCustomParameters["MaxGeneralNoisyAxisRange"]); + mMinGeneralNoisyAxisRange = std::stof(mCustomParameters["MinGeneralNoisyAxisRange"]); } void ITSFhrTask::endOfCycle() @@ -739,6 +747,10 @@ void ITSFhrTask::reset() resetGeneralPlots(); resetOccupancyPlots(); + mGeneralOccupancy->Reset("content"); + mGeneralNoisyPixel->Reset("content"); + mDecoder->clearStat(); + if (mLayer < NLayerIB) { for (int istave = 0; istave < NStaves[mLayer]; istave++) { for (int ilink = 0; ilink < 3; ilink++) { From 80207a1656943dfcaa3a7753597f17226a678d1f Mon Sep 17 00:00:00 2001 From: its Date: Tue, 19 Oct 2021 14:29:38 +0200 Subject: [PATCH 2/2] clange format --- Modules/ITS/include/ITS/ITSFhrTask.h | 8 +-- Modules/ITS/src/ITSFhrCheck.cxx | 80 ++++++++++++++-------------- Modules/ITS/src/ITSFhrTask.cxx | 22 ++++---- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/Modules/ITS/include/ITS/ITSFhrTask.h b/Modules/ITS/include/ITS/ITSFhrTask.h index 3f402d1602..08354843c3 100644 --- a/Modules/ITS/include/ITS/ITSFhrTask.h +++ b/Modules/ITS/include/ITS/ITSFhrTask.h @@ -117,10 +117,10 @@ class ITSFhrTask final : public TaskInterface int*** mErrorCount /* = new int**[NStaves[lay]]*/; //IB : errorcount[stave][FEE][errorid] int mNoisyPixelNumber[7][48] = { { 0 } }; - int mMaxGeneralAxisRange = -3; //the range of TH2Poly plots z axis range, pow(10, mMinGeneralAxisRange) ~ pow(10, mMaxGeneralAxisRange) - int mMinGeneralAxisRange = -12; // - int mMaxGeneralNoisyAxisRange = 4000; - int mMinGeneralNoisyAxisRange = 0; + int mMaxGeneralAxisRange = -3; //the range of TH2Poly plots z axis range, pow(10, mMinGeneralAxisRange) ~ pow(10, mMaxGeneralAxisRange) + int mMinGeneralAxisRange = -12; // + int mMaxGeneralNoisyAxisRange = 4000; + int mMinGeneralNoisyAxisRange = 0; TString mTriggerType[NTrigger] = { "ORBIT", "HB", "HBr", "HC", "PHYSICS", "PP", "CAL", "SOT", "EOT", "SOC", "EOC", "TF", "INT" }; diff --git a/Modules/ITS/src/ITSFhrCheck.cxx b/Modules/ITS/src/ITSFhrCheck.cxx index 757ec1e90b..8b495c6c0a 100644 --- a/Modules/ITS/src/ITSFhrCheck.cxx +++ b/Modules/ITS/src/ITSFhrCheck.cxx @@ -61,58 +61,58 @@ std::string ITSFhrCheck::getAcceptedType() { return "TH1"; } void ITSFhrCheck::beautify(std::shared_ptr mo, Quality checkResult) { - TLatex *text[5]; + TLatex* text[5]; if (mo->getName() == "General/ErrorPlots") { auto* h = dynamic_cast(mo->getObject()); if (checkResult == Quality::Good) { - text[0] = new TLatex(0, 0, "Quality::Good"); - text[1] = new TLatex(0, -100, "There is no Error found"); - for(int i = 0; i < 2; ++i) { - text[i]->SetTextAlign(23); - text[i]->SetTextSize(0.08); - text[i]->SetTextColor(kGreen); - h->GetListOfFunctions()->Add(text[i]); - } + text[0] = new TLatex(0, 0, "Quality::Good"); + text[1] = new TLatex(0, -100, "There is no Error found"); + for (int i = 0; i < 2; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kGreen); + h->GetListOfFunctions()->Add(text[i]); + } } else if (checkResult == Quality::Bad) { - text[0] = new TLatex(0, 100, "Quality::Bad"); - text[1] = new TLatex(0, 0, "Decoding ERROR detected"); - text[2] = new TLatex(0, -100, "please inform SL"); - for(int i = 0; i < 3; ++i) { - text[i]->SetTextAlign(23); - text[i]->SetTextSize(0.08); - text[i]->SetTextColor(kRed); - h->GetListOfFunctions()->Add(text[i]); - } + text[0] = new TLatex(0, 100, "Quality::Bad"); + text[1] = new TLatex(0, 0, "Decoding ERROR detected"); + text[2] = new TLatex(0, -100, "please inform SL"); + for (int i = 0; i < 3; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kRed); + h->GetListOfFunctions()->Add(text[i]); + } } } 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) { - text[0] = new TLatex(0, 0, "Quality::Good"); - text[0]->SetTextAlign(23); - text[0]->SetTextSize(0.08); - text[0]->SetTextColor(kGreen); - h->GetListOfFunctions()->Add(text[0]); + text[0] = new TLatex(0, 0, "Quality::Good"); + text[0]->SetTextAlign(23); + text[0]->SetTextSize(0.08); + text[0]->SetTextColor(kGreen); + h->GetListOfFunctions()->Add(text[0]); } else if (checkResult == Quality::Bad) { - text[0] = new TLatex(0, 100, "Quality::Bad"); - text[1] = new TLatex(0, 0, "Max Occupancy over 10^{-5}"); - text[2] = new TLatex(0, -100, "or ERROR detected, Please Inform SL"); - for(int i = 0; i < 3; ++i) { - text[i]->SetTextAlign(23); - text[i]->SetTextSize(0.08); - text[i]->SetTextColor(kRed); - h->GetListOfFunctions()->Add(text[i]); - } + text[0] = new TLatex(0, 100, "Quality::Bad"); + text[1] = new TLatex(0, 0, "Max Occupancy over 10^{-5}"); + text[2] = new TLatex(0, -100, "or ERROR detected, Please Inform SL"); + for (int i = 0; i < 3; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kRed); + h->GetListOfFunctions()->Add(text[i]); + } } else if (checkResult == Quality::Medium) { - text[0] = new TLatex(0, 0, "Quality::Medium"); - text[1] = new TLatex(0, -100, "Max Occupancy over 10^{-6}"); - for(int i = 0; i < 2; ++i) { - text[i]->SetTextAlign(23); - text[i]->SetTextSize(0.08); - text[i]->SetTextColor(kOrange); - h->GetListOfFunctions()->Add(text[i]); - } + text[0] = new TLatex(0, 0, "Quality::Medium"); + text[1] = new TLatex(0, -100, "Max Occupancy over 10^{-6}"); + for (int i = 0; i < 2; ++i) { + text[i]->SetTextAlign(23); + text[i]->SetTextSize(0.08); + text[i]->SetTextColor(kOrange); + h->GetListOfFunctions()->Add(text[i]); + } } } } diff --git a/Modules/ITS/src/ITSFhrTask.cxx b/Modules/ITS/src/ITSFhrTask.cxx index 2949a3ebfd..3d34f92043 100644 --- a/Modules/ITS/src/ITSFhrTask.cxx +++ b/Modules/ITS/src/ITSFhrTask.cxx @@ -88,14 +88,14 @@ void ITSFhrTask::initialize(o2::framework::InitContext& /*ctx*/) mGeneralOccupancy = new TH2Poly(); mGeneralOccupancy->SetTitle("General Occupancy;mm;mm"); mGeneralOccupancy->SetName("General/General_Occupancy"); - mGeneralOccupancy->SetStats(0); - mGeneralOccupancy->GetZaxis()->SetRangeUser(pow(10, mMinGeneralAxisRange), pow(10, mMaxGeneralAxisRange)); + mGeneralOccupancy->SetStats(0); + mGeneralOccupancy->GetZaxis()->SetRangeUser(pow(10, mMinGeneralAxisRange), pow(10, mMaxGeneralAxisRange)); mGeneralNoisyPixel = new TH2Poly(); mGeneralNoisyPixel->SetTitle("Noisy Pixel Number;mm;mm"); mGeneralNoisyPixel->SetName("General/Noisy_Pixel"); - mGeneralNoisyPixel->SetStats(0); - mGeneralNoisyPixel->GetZaxis()->SetRangeUser(mMinGeneralNoisyAxisRange, mMaxGeneralNoisyAxisRange); + mGeneralNoisyPixel->SetStats(0); + mGeneralNoisyPixel->GetZaxis()->SetRangeUser(mMinGeneralNoisyAxisRange, mMaxGeneralNoisyAxisRange); createGeneralPlots(); createOccupancyPlots(); @@ -693,10 +693,10 @@ void ITSFhrTask::getParameters() mGeomPath = mCustomParameters["geomPath"]; mHitCutForNoisyPixel = std::stoi(mCustomParameters["HitNumberCutForNoisyPixel"]); mOccupancyCutForNoisyPixel = std::stof(mCustomParameters["OccupancyNumberCutForNoisyPixel"]); - mMaxGeneralAxisRange = std::stof(mCustomParameters["MaxGeneralAxisRange"]); - mMinGeneralAxisRange = std::stof(mCustomParameters["MinGeneralAxisRange"]); - mMaxGeneralNoisyAxisRange = std::stof(mCustomParameters["MaxGeneralNoisyAxisRange"]); - mMinGeneralNoisyAxisRange = std::stof(mCustomParameters["MinGeneralNoisyAxisRange"]); + mMaxGeneralAxisRange = std::stof(mCustomParameters["MaxGeneralAxisRange"]); + mMinGeneralAxisRange = std::stof(mCustomParameters["MinGeneralAxisRange"]); + mMaxGeneralNoisyAxisRange = std::stof(mCustomParameters["MaxGeneralNoisyAxisRange"]); + mMinGeneralNoisyAxisRange = std::stof(mCustomParameters["MinGeneralNoisyAxisRange"]); } void ITSFhrTask::endOfCycle() @@ -747,9 +747,9 @@ void ITSFhrTask::reset() resetGeneralPlots(); resetOccupancyPlots(); - mGeneralOccupancy->Reset("content"); - mGeneralNoisyPixel->Reset("content"); - mDecoder->clearStat(); + mGeneralOccupancy->Reset("content"); + mGeneralNoisyPixel->Reset("content"); + mDecoder->clearStat(); if (mLayer < NLayerIB) { for (int istave = 0; istave < NStaves[mLayer]; istave++) {