diff --git a/Modules/MFT/include/MFT/QcMFTDigitCheck.h b/Modules/MFT/include/MFT/QcMFTDigitCheck.h index 8cd7315ca6..ad1f94d228 100644 --- a/Modules/MFT/include/MFT/QcMFTDigitCheck.h +++ b/Modules/MFT/include/MFT/QcMFTDigitCheck.h @@ -70,6 +70,20 @@ class QcMFTDigitCheck : public o2::quality_control::checker::CheckInterface std::vector mOldNoisyPix; std::vector mNewNoisyPix; + bool mQualityGood; + bool mQualityMedium; + bool mQualityBad; + int mNoiseTotalMediumMin; + int mNoiseTotalMediumMax; + int mNoiseTotalBadMin; + int mNoiseTotalBadMax; + int mNoiseNewMediumMin; + int mNoiseNewMediumMax; + int mNoiseNewBadMax; + int mNoiseDissMediumMin; + int mNoiseDissMediumMax; + int mNoiseDissBadMax; + // to form the name of the masked chips histograms int mHalf[936] = { 0 }; int mDisk[936] = { 0 }; diff --git a/Modules/MFT/mft-digits.json b/Modules/MFT/mft-digits.json index 0f488cb18a..cd3f7b1ad3 100644 --- a/Modules/MFT/mft-digits.json +++ b/Modules/MFT/mft-digits.json @@ -66,7 +66,18 @@ "LadderThresholdMedium" : "1", "LadderThresholdBad" : "2", "NoiseScan" : "1", - "NCyclesNoiseMap" : "3" + "NCyclesNoiseMap" : "3", + "NoiseTotalMediumMin" : "7500", + "NoiseTotalMediumMax" : "8500", + "NoiseTotalBadMin" : "7000", + "NoiseTotalBadMax" : "9000", + "NoiseNewMediumMin" : "100", + "NoiseNewMediumMax" : "500", + "NoiseNewBadMax" : "1000", + "NoiseDissMediumMin" : "100", + "NoiseDissMediumMax" : "500", + "NoiseDissBadMax" : "1000" + }, "dataSource" : [ { "type" : "Task", diff --git a/Modules/MFT/src/QcMFTDigitCheck.cxx b/Modules/MFT/src/QcMFTDigitCheck.cxx index ec92355f27..ad655e9708 100644 --- a/Modules/MFT/src/QcMFTDigitCheck.cxx +++ b/Modules/MFT/src/QcMFTDigitCheck.cxx @@ -69,6 +69,56 @@ void QcMFTDigitCheck::configure() ILOG(Info, Support) << "Custom parameter - NCyclesNoiseMap: " << param->second << ENDM; mNCyclesNoiseMap = stoi(param->second); } + mNoiseTotalMediumMin = 7500; + if (auto param = mCustomParameters.find("NoiseTotalMediumMin"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseTotalMediumMin: " << param->second << ENDM; + mNoiseTotalMediumMin = stoi(param->second); + } + mNoiseTotalMediumMax = 8500; + if (auto param = mCustomParameters.find("NoiseTotalMediumMax"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseTotalMediumMax: " << param->second << ENDM; + mNoiseTotalMediumMax = stoi(param->second); + } + mNoiseTotalBadMin = 7000; + if (auto param = mCustomParameters.find("NoiseTotalBadMin"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseTotalBadMin: " << param->second << ENDM; + mNoiseTotalBadMin = stoi(param->second); + } + mNoiseTotalBadMax = 9000; + if (auto param = mCustomParameters.find("NoiseTotalBadMax"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseTotalBadMax: " << param->second << ENDM; + mNoiseTotalBadMax = stoi(param->second); + } + mNoiseNewMediumMin = 100; + if (auto param = mCustomParameters.find("NoiseNewMediumMin"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseNewMediumMin: " << param->second << ENDM; + mNoiseNewMediumMin = stoi(param->second); + } + mNoiseNewMediumMax = 500; + if (auto param = mCustomParameters.find("NoiseNewMediumMax"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseNewMediumMax: " << param->second << ENDM; + mNoiseNewMediumMax = stoi(param->second); + } + mNoiseNewBadMax = 1000; + if (auto param = mCustomParameters.find("NoiseNewBadMax"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseNewBadMax: " << param->second << ENDM; + mNoiseNewBadMax = stoi(param->second); + } + mNoiseDissMediumMin = 100; + if (auto param = mCustomParameters.find("NoiseDissMediumMin"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseNewMediumMin: " << param->second << ENDM; + mNoiseDissMediumMin = stoi(param->second); + } + mNoiseDissMediumMax = 500; + if (auto param = mCustomParameters.find("NoiseDissMediumMax"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseNewMediumMax: " << param->second << ENDM; + mNoiseDissMediumMax = stoi(param->second); + } + mNoiseDissBadMax = 1000; + if (auto param = mCustomParameters.find("NoiseDissBadMax"); param != mCustomParameters.end()) { + ILOG(Info, Support) << "Custom parameter - NoiseNewBadMax: " << param->second << ENDM; + mNoiseDissBadMax = stoi(param->second); + } // no call to beautifier yet mFirstCall = true; @@ -80,6 +130,9 @@ void QcMFTDigitCheck::configure() mEmptyCount = 0; mAdjacentLaddersEmpty = false; + mQualityGood = false; + mQualityMedium = false; + mQualityBad = false; } Quality QcMFTDigitCheck::check(std::map>* moMap) @@ -293,6 +346,7 @@ void QcMFTDigitCheck::beautify(std::shared_ptr mo, Quality checkR } } } + if (mNoiseScan == 1) { if (mNCycles == 1) { long timestamp = mo->getValidity().getMin(); @@ -316,6 +370,17 @@ void QcMFTDigitCheck::beautify(std::shared_ptr mo, Quality checkR mTotalNoisy++; } } + // quality of a noise scan + if (((mTotalNoisy < mNoiseTotalMediumMax) && (mTotalNoisy > mNoiseTotalMediumMin)) && ((mNewNoisy < mNoiseNewMediumMax) && (mNewNoisy > mNoiseNewMediumMin)) && ((mDissNoisy < mNoiseDissMediumMax) && (mDissNoisy > mNoiseDissMediumMin))) { + mQualityGood = true; + } + if (((mTotalNoisy > mNoiseTotalMediumMax) && (mTotalNoisy < mNoiseTotalBadMax)) || ((mTotalNoisy > mNoiseTotalBadMin) && (mTotalNoisy < mNoiseTotalMediumMin)) || ((mNewNoisy < mNoiseNewMediumMin) || (mNewNoisy > mNoiseNewMediumMax && mNewNoisy < mNoiseNewBadMax)) || ((mDissNoisy < mNoiseDissMediumMin) || (mDissNoisy > mNoiseDissMediumMax && mDissNoisy < mNoiseDissBadMax))) { + mQualityMedium = true; + } + if ((mTotalNoisy > mNoiseTotalBadMax) || (mTotalNoisy < mNoiseTotalBadMin) || (mNewNoisy > mNoiseNewBadMax) || (mDissNoisy > mNoiseDissBadMax)) { + mQualityBad = true; + mQualityMedium = false; + } } if (mo->getName().find("mDigitChipOccupancy") != std::string::npos) { @@ -324,25 +389,42 @@ void QcMFTDigitCheck::beautify(std::shared_ptr mo, Quality checkR TLatex* tl_total = new TLatex(0.14, 0.87, Form("Total noisy pixels: %i", mTotalNoisy)); TLatex* tl_new = new TLatex(0.14, 0.83, Form("New noisy pixels: %i", mNewNoisy)); TLatex* tl_dis = new TLatex(0.14, 0.79, Form("Disappeared noisy pixels: %i", mDissNoisy)); + TPaveText* msg = new TPaveText(0.65, 0.9, 0.95, 1.0, "NDC NB"); + Color_t QualityColor; + if (mQualityGood) { + QualityColor = kGreen; + msg->AddText("No action needed"); + } else if (mQualityMedium) { + QualityColor = kOrange; + msg->AddText("Write a logbook entry tagging MFT"); + } else if (mQualityBad) { + QualityColor = kRed; + msg->AddText("Call the on-call!"); + } else { + QualityColor = kBlue; + } tl_total->SetNDC(); tl_total->SetTextFont(42); tl_total->SetTextSize(0.03); - tl_total->SetTextColor(kBlue); + tl_total->SetTextColor(QualityColor); tl_new->SetNDC(); tl_new->SetTextFont(42); tl_new->SetTextSize(0.03); - tl_new->SetTextColor(kBlue); + tl_new->SetTextColor(QualityColor); tl_dis->SetNDC(); tl_dis->SetTextFont(42); tl_dis->SetTextSize(0.03); - tl_dis->SetTextColor(kBlue); + tl_dis->SetTextColor(QualityColor); + msg->SetFillColor(QualityColor); // add it to the histo DigitOccupancy->GetListOfFunctions()->Add(tl_total); DigitOccupancy->GetListOfFunctions()->Add(tl_new); DigitOccupancy->GetListOfFunctions()->Add(tl_dis); + DigitOccupancy->GetListOfFunctions()->Add(msg); tl_total->Draw(); tl_new->Draw(); tl_dis->Draw(); + msg->Draw(); } } }