Skip to content

Commit 0a1d899

Browse files
authored
MFT: reverting back to previous ladder checker version (#2446)
1 parent 2d9f4cb commit 0a1d899

2 files changed

Lines changed: 7 additions & 38 deletions

File tree

Modules/MFT/src/QcMFTClusterCheck.cxx

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
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) {

Modules/MFT/src/QcMFTDigitCheck.cxx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
/// \author Katarina Krizkova Gajdosova
1717
/// \author Diana Maria Krupova
1818
/// \author David Grund
19-
/// \author Sara Haidlova
2019
///
2120

2221
// C++
@@ -170,37 +169,23 @@ Quality QcMFTDigitCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
170169

171170
// checker for empty ladders
172171
QcMFTUtilTables MFTTable;
173-
for (int j = 0; j < 20; j++) {
174-
if (mo->getName() == MFTTable.mDigitChipMapNames[j]) {
172+
for (int i = 0; i < 20; i++) {
173+
if (mo->getName() == MFTTable.mDigitChipMapNames[i]) {
175174
adjacentCount = 0;
176175
auto* hDigitChipOccupancyMap = dynamic_cast<TH2F*>(mo->getObject());
177176
if (hDigitChipOccupancyMap == nullptr) {
178177
ILOG(Error, Support) << "Could not cast mDigitChipMap to TH2F." << ENDM;
179178
return Quality::Null;
180179
}
181-
182180
// loop over bins in each chip map
183-
bool isOutsideAcc = false;
184181
for (int iBinX = 0; iBinX < hDigitChipOccupancyMap->GetNbinsX(); iBinX++) {
185182
isEmpty = true;
186183
for (int iBinY = 0; iBinY < hDigitChipOccupancyMap->GetNbinsY(); iBinY++) {
187-
isOutsideAcc = false;
188184
if (hDigitChipOccupancyMap->GetBinContent(iBinX + 1, iBinY + 1) != 0) {
189185
isEmpty = false; // if there is an unempty bin, the ladder is not empty
190186
break;
191187
} else {
192-
// check if empty chips are outside acceptance
193-
for (int k = 0; k < 21; k++) {
194-
if (mo->getName().find(MFTTable.mDigitChipMapNames[j]) != std::string::npos) {
195-
if (iBinX + 1 == MFTTable.mBinX[j][k] && iBinY + 1 == MFTTable.mBinY[j][k]) {
196-
isOutsideAcc = true;
197-
continue;
198-
}
199-
}
200-
}
201-
}
202-
// if the chip is still empty and not outside acceptance, check if it is masked
203-
if (isEmpty && !isOutsideAcc) {
188+
// check if empty ladders are masked
204189
for (int i = 0; i < mMaskedChips.size(); i++) {
205190
if (mo->getName().find(mChipMapName[i]) != std::string::npos) {
206191
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<std::string, std::shared_ptr<MonitorObje
212197
}
213198
}
214199
}
215-
216200
// count empty ladders
217201
if (isEmpty) {
218202
mEmptyCount++;

0 commit comments

Comments
 (0)