Skip to content

Commit

Permalink
MFT: noise quality checker v2 (#2406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Edingrast authored Sep 3, 2024
1 parent c155de9 commit 81e87f4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
8 changes: 4 additions & 4 deletions Modules/MFT/include/MFT/QcMFTDigitCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class QcMFTDigitCheck : public o2::quality_control::checker::CheckInterface
int mNoiseScan;
int mNCycles;
int mNCyclesNoiseMap;
int mDissNoisy;
int mDisNoisy;
int mNewNoisy;
int mTotalNoisy;
std::vector<int> mNoisyPix;
Expand All @@ -80,9 +80,9 @@ class QcMFTDigitCheck : public o2::quality_control::checker::CheckInterface
int mNoiseNewMediumMin;
int mNoiseNewMediumMax;
int mNoiseNewBadMax;
int mNoiseDissMediumMin;
int mNoiseDissMediumMax;
int mNoiseDissBadMax;
int mNoiseDisMediumMin;
int mNoiseDisMediumMax;
int mNoiseDisBadMax;

// to form the name of the masked chips histograms
int mHalf[936] = { 0 };
Expand Down
6 changes: 3 additions & 3 deletions Modules/MFT/mft-digits.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
"NoiseNewMediumMin" : "100",
"NoiseNewMediumMax" : "500",
"NoiseNewBadMax" : "1000",
"NoiseDissMediumMin" : "100",
"NoiseDissMediumMax" : "500",
"NoiseDissBadMax" : "1000"
"NoiseDisMediumMin" : "100",
"NoiseDisMediumMax" : "500",
"NoiseDisBadMax" : "1000"

},
"dataSource" : [ {
Expand Down
50 changes: 32 additions & 18 deletions Modules/MFT/src/QcMFTDigitCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -104,28 +104,28 @@ void QcMFTDigitCheck::configure()
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);
mNoiseDisMediumMin = 100;
if (auto param = mCustomParameters.find("NoiseDisMediumMin"); param != mCustomParameters.end()) {
ILOG(Info, Support) << "Custom parameter - NoiseDisMediumMin: " << param->second << ENDM;
mNoiseDisMediumMin = 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);
mNoiseDisMediumMax = 500;
if (auto param = mCustomParameters.find("NoiseDisMediumMax"); param != mCustomParameters.end()) {
ILOG(Info, Support) << "Custom parameter - NoiseDisMediumMax: " << param->second << ENDM;
mNoiseDisMediumMax = 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);
mNoiseDisBadMax = 1000;
if (auto param = mCustomParameters.find("NoiseDisBadMax"); param != mCustomParameters.end()) {
ILOG(Info, Support) << "Custom parameter - NoiseDisBadMax: " << param->second << ENDM;
mNoiseDisBadMax = stoi(param->second);
}

// no call to beautifier yet
mFirstCall = true;

mNCycles = 0;
mNewNoisy = 0;
mDissNoisy = 0;
mDisNoisy = 0;
mTotalNoisy = 0;

mEmptyCount = 0;
Expand Down Expand Up @@ -361,7 +361,7 @@ void QcMFTDigitCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR

for (int i = 0; i < mNewNoisyPix.size(); i++) {
if (mNewNoisyPix[i] == -1 && mOldNoisyPix[i] != -1) {
mDissNoisy++;
mDisNoisy++;
}
if (mNewNoisyPix[i] != -1 && mOldNoisyPix[i] == -1) {
mNewNoisy++;
Expand All @@ -371,13 +371,27 @@ void QcMFTDigitCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
}
}
// quality of a noise scan
if (((mTotalNoisy < mNoiseTotalMediumMax) && (mTotalNoisy > mNoiseTotalMediumMin)) && ((mNewNoisy < mNoiseNewMediumMax) && (mNewNoisy > mNoiseNewMediumMin)) && ((mDissNoisy < mNoiseDissMediumMax) && (mDissNoisy > mNoiseDissMediumMin))) {
bool isTotalNoiseGood = (mTotalNoisy < mNoiseTotalMediumMax) && (mTotalNoisy > mNoiseTotalMediumMin);
bool isNewNoiseGood = (mNewNoisy < mNoiseNewMediumMax) && (mNewNoisy > mNoiseNewMediumMin);
bool isDisNoiseGood = (mDisNoisy < mNoiseDisMediumMax) && (mDisNoisy > mNoiseDisMediumMin);
bool isTotalNoiseMedium = (mTotalNoisy > mNoiseTotalMediumMax && mTotalNoisy < mNoiseTotalBadMax) ||
(mTotalNoisy > mNoiseTotalBadMin && mTotalNoisy < mNoiseTotalMediumMin);
bool isNewNoiseMedium = (mNewNoisy < mNoiseNewMediumMin) ||
(mNewNoisy > mNoiseNewMediumMax && mNewNoisy < mNoiseNewBadMax);
bool isDisNoiseMedium = (mDisNoisy < mNoiseDisMediumMin) ||
(mDisNoisy > mNoiseDisMediumMax && mDisNoisy < mNoiseDisBadMax);
bool isTotalNoiseBad = (mTotalNoisy > mNoiseTotalBadMax) || (mTotalNoisy < mNoiseTotalBadMin);
bool isNewNoiseBad = mNewNoisy > mNoiseNewBadMax;
bool isDisNoiseBad = mDisNoisy > mNoiseDisBadMax;

if (isTotalNoiseGood && isNewNoiseGood && isDisNoiseGood) {
mQualityGood = true;
}
if (((mTotalNoisy > mNoiseTotalMediumMax) && (mTotalNoisy < mNoiseTotalBadMax)) || ((mTotalNoisy > mNoiseTotalBadMin) && (mTotalNoisy < mNoiseTotalMediumMin)) || ((mNewNoisy < mNoiseNewMediumMin) || (mNewNoisy > mNoiseNewMediumMax && mNewNoisy < mNoiseNewBadMax)) || ((mDissNoisy < mNoiseDissMediumMin) || (mDissNoisy > mNoiseDissMediumMax && mDissNoisy < mNoiseDissBadMax))) {

if (isTotalNoiseMedium || isNewNoiseMedium || isDisNoiseMedium) {
mQualityMedium = true;
}
if ((mTotalNoisy > mNoiseTotalBadMax) || (mTotalNoisy < mNoiseTotalBadMin) || (mNewNoisy > mNoiseNewBadMax) || (mDissNoisy > mNoiseDissBadMax)) {
if (isTotalNoiseBad || isNewNoiseBad || isDisNoiseBad) {
mQualityBad = true;
mQualityMedium = false;
}
Expand All @@ -388,7 +402,7 @@ void QcMFTDigitCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
if (DigitOccupancy != nullptr) {
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));
TLatex* tl_dis = new TLatex(0.14, 0.79, Form("Disappeared noisy pixels: %i", mDisNoisy));
TPaveText* msg = new TPaveText(0.65, 0.9, 0.95, 1.0, "NDC NB");
Color_t QualityColor;
if (mQualityGood) {
Expand Down

0 comments on commit 81e87f4

Please sign in to comment.