From 0a1d899bb7645fe9034144da155220681cc943ed Mon Sep 17 00:00:00 2001 From: shaidlov <109801990+Edingrast@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:28:21 +0200 Subject: [PATCH] MFT: reverting back to previous ladder checker version (#2446) --- Modules/MFT/src/QcMFTClusterCheck.cxx | 23 ++++------------------- Modules/MFT/src/QcMFTDigitCheck.cxx | 22 +++------------------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/Modules/MFT/src/QcMFTClusterCheck.cxx b/Modules/MFT/src/QcMFTClusterCheck.cxx index 4775ebc0e9..2f30c1f208 100644 --- a/Modules/MFT/src/QcMFTClusterCheck.cxx +++ b/Modules/MFT/src/QcMFTClusterCheck.cxx @@ -16,7 +16,6 @@ /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova /// \author David Grund -/// \author Sara Haidlova /// // C++ @@ -127,37 +126,23 @@ Quality QcMFTClusterCheck::check(std::mapgetName() == MFTTable.mClusterChipMapNames[j]) { + for (int i = 0; i < 20; i++) { + if (mo->getName() == MFTTable.mClusterChipMapNames[i]) { adjacentCount = 0; auto* hClusterChipOccupancyMap = dynamic_cast(mo->getObject()); if (hClusterChipOccupancyMap == nullptr) { ILOG(Error, Support) << "Could not cast mClusterChipMap to TH2F." << ENDM; return Quality::Null; } - // loop over bins in each chip map - bool isOutsideAcc = false; for (int iBinX = 0; iBinX < hClusterChipOccupancyMap->GetNbinsX(); iBinX++) { isEmpty = true; for (int iBinY = 0; iBinY < hClusterChipOccupancyMap->GetNbinsY(); iBinY++) { - isOutsideAcc = false; if (hClusterChipOccupancyMap->GetBinContent(iBinX + 1, iBinY + 1) != 0) { isEmpty = false; // if there is an unempty bin, the ladder is not empty break; } else { - // check if empty chips are outside acceptance - for (int k = 0; k < 21; k++) { - if (mo->getName().find(MFTTable.mClusterChipMapNames[j]) != std::string::npos) { - if (iBinX + 1 == MFTTable.mBinX[j][k] && iBinY + 1 == MFTTable.mBinY[j][k]) { - isOutsideAcc = true; - continue; - } - } - } - } - // if the chip is still empty and not outside acceptance, check if it is masked - if (isEmpty && !isOutsideAcc) { + // check if empty ladders are masked for (int i = 0; i < mMaskedChips.size(); i++) { if (mo->getName().find(mChipMapName[i]) != std::string::npos) { if (iBinX + 1 == hClusterChipOccupancyMap->GetXaxis()->FindBin(mX[mMaskedChips[i]]) && iBinY + 1 == hClusterChipOccupancyMap->GetYaxis()->FindBin(mY[mMaskedChips[i]])) { @@ -176,13 +161,13 @@ Quality QcMFTClusterCheck::check(std::map= mLadderThresholdBad) { mAdjacentLaddersEmpty = true; } } } } - if (mo->getName() == "mClusterOccupancySummary") { auto* hClusterOccupancySummary = dynamic_cast(mo->getObject()); if (hClusterOccupancySummary == nullptr) { diff --git a/Modules/MFT/src/QcMFTDigitCheck.cxx b/Modules/MFT/src/QcMFTDigitCheck.cxx index f37b91ca49..782af665c9 100644 --- a/Modules/MFT/src/QcMFTDigitCheck.cxx +++ b/Modules/MFT/src/QcMFTDigitCheck.cxx @@ -16,7 +16,6 @@ /// \author Katarina Krizkova Gajdosova /// \author Diana Maria Krupova /// \author David Grund -/// \author Sara Haidlova /// // C++ @@ -170,37 +169,23 @@ Quality QcMFTDigitCheck::check(std::mapgetName() == MFTTable.mDigitChipMapNames[j]) { + for (int i = 0; i < 20; i++) { + if (mo->getName() == MFTTable.mDigitChipMapNames[i]) { adjacentCount = 0; auto* hDigitChipOccupancyMap = dynamic_cast(mo->getObject()); if (hDigitChipOccupancyMap == nullptr) { ILOG(Error, Support) << "Could not cast mDigitChipMap to TH2F." << ENDM; return Quality::Null; } - // loop over bins in each chip map - bool isOutsideAcc = false; for (int iBinX = 0; iBinX < hDigitChipOccupancyMap->GetNbinsX(); iBinX++) { isEmpty = true; for (int iBinY = 0; iBinY < hDigitChipOccupancyMap->GetNbinsY(); iBinY++) { - isOutsideAcc = false; if (hDigitChipOccupancyMap->GetBinContent(iBinX + 1, iBinY + 1) != 0) { isEmpty = false; // if there is an unempty bin, the ladder is not empty break; } else { - // check if empty chips are outside acceptance - for (int k = 0; k < 21; k++) { - if (mo->getName().find(MFTTable.mDigitChipMapNames[j]) != std::string::npos) { - if (iBinX + 1 == MFTTable.mBinX[j][k] && iBinY + 1 == MFTTable.mBinY[j][k]) { - isOutsideAcc = true; - continue; - } - } - } - } - // if the chip is still empty and not outside acceptance, check if it is masked - if (isEmpty && !isOutsideAcc) { + // check if empty ladders are masked for (int i = 0; i < mMaskedChips.size(); i++) { if (mo->getName().find(mChipMapName[i]) != std::string::npos) { if (iBinX + 1 == hDigitChipOccupancyMap->GetXaxis()->FindBin(mX[mMaskedChips[i]]) && iBinY + 1 == hDigitChipOccupancyMap->GetYaxis()->FindBin(mY[mMaskedChips[i]])) { @@ -212,7 +197,6 @@ Quality QcMFTDigitCheck::check(std::map