1616// / \author Katarina Krizkova Gajdosova
1717// / \author Diana Maria Krupova
1818// / \author David Grund
19- // / \author Sara Haidlova
2019// /
2120
2221// C++
@@ -127,37 +126,23 @@ Quality QcMFTClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorOb
127126
128127 // checker for empty ladders
129128 QcMFTUtilTables MFTTable;
130- for (int j = 0 ; j < 20 ; j ++) {
131- if (mo->getName () == MFTTable.mClusterChipMapNames [j ]) {
129+ for (int i = 0 ; i < 20 ; i ++) {
130+ if (mo->getName () == MFTTable.mClusterChipMapNames [i ]) {
132131 adjacentCount = 0 ;
133132 auto * hClusterChipOccupancyMap = dynamic_cast <TH2F *>(mo->getObject ());
134133 if (hClusterChipOccupancyMap == nullptr ) {
135134 ILOG (Error, Support) << " Could not cast mClusterChipMap to TH2F." << ENDM ;
136135 return Quality::Null;
137136 }
138-
139137 // loop over bins in each chip map
140- bool isOutsideAcc = false ;
141138 for (int iBinX = 0 ; iBinX < hClusterChipOccupancyMap->GetNbinsX (); iBinX++) {
142139 isEmpty = true ;
143140 for (int iBinY = 0 ; iBinY < hClusterChipOccupancyMap->GetNbinsY (); iBinY++) {
144- isOutsideAcc = false ;
145141 if (hClusterChipOccupancyMap->GetBinContent (iBinX + 1 , iBinY + 1 ) != 0 ) {
146142 isEmpty = false ; // if there is an unempty bin, the ladder is not empty
147143 break ;
148144 } else {
149- // check if empty chips are outside acceptance
150- for (int k = 0 ; k < 21 ; k++) {
151- if (mo->getName ().find (MFTTable.mClusterChipMapNames [j]) != std::string::npos) {
152- if (iBinX + 1 == MFTTable.mBinX [j][k] && iBinY + 1 == MFTTable.mBinY [j][k]) {
153- isOutsideAcc = true ;
154- continue ;
155- }
156- }
157- }
158- }
159- // if the chip is still empty and not outside acceptance, check if it is masked
160- if (isEmpty && !isOutsideAcc) {
145+ // check if empty ladders are masked
161146 for (int i = 0 ; i < mMaskedChips .size (); i++) {
162147 if (mo->getName ().find (mChipMapName [i]) != std::string::npos) {
163148 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<std::string, std::shared_ptr<MonitorOb
176161 } else {
177162 adjacentCount = 0 ;
178163 }
164+ // set bool for adjacent ladders
179165 if (adjacentCount >= mLadderThresholdBad ) {
180166 mAdjacentLaddersEmpty = true ;
181167 }
182168 }
183169 }
184170 }
185-
186171 if (mo->getName () == " mClusterOccupancySummary" ) {
187172 auto * hClusterOccupancySummary = dynamic_cast <TH2F *>(mo->getObject ());
188173 if (hClusterOccupancySummary == nullptr ) {
0 commit comments