Skip to content

Commit 2e52880

Browse files
authored
ITS Calibration: always reset chipDone counter independently on hits (#13386)
* fix for chipDone counter: reset always independently on hits * removed unused counter
1 parent 6e8a014 commit 2e52880

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ class ITSThresholdCalibrator : public Task
131131
private:
132132
void updateTimeDependentParams(ProcessingContext& pc);
133133
// detector information
134-
static constexpr short int N_COL = 1024; // column number in Alpide chip
134+
static constexpr short int N_COL = 1024; // number of columns in Alpide chip
135+
static constexpr short int N_ROW = 512; // number of rows in Alpide chip
135136

136137
static const short int N_RU = o2::itsmft::ChipMappingITS::getNRUs();
137138

@@ -231,7 +232,8 @@ class ITSThresholdCalibrator : public Task
231232
short int mRunType = -1;
232233
short int mRunTypeUp = -1;
233234
short int mRunTypeRU[N_RU] = {0};
234-
short int mCdwCntRU[N_RU] = {0};
235+
short int mRunTypeRUCopy[N_RU] = {0};
236+
short int mCdwCntRU[N_RU][N_ROW] = {{0}};
235237
short int mRowRU[N_RU] = {0};
236238
bool mActiveLinks[N_RU][3] = {{false}};
237239
std::set<short int> mRuSet;

Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
13381338
// count the zeros
13391339
if (!mRunTypeUp) {
13401340
mRunTypeRU[iRU]++;
1341+
mRunTypeRUCopy[iRU]++;
13411342
}
13421343
// Divide calibration word (24-bit) by 2^16 to get the first 8 bits
13431344
if (this->mScanType == 'T') {
@@ -1361,7 +1362,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
13611362
// count the last N injections
13621363
short int checkVal = (mScanType == 'I') ? mMin : mMax;
13631364
if (loopval == checkVal && realcharge == mMin2) { // the second condition is relevant only for mScanType=p
1364-
mCdwCntRU[iRU]++;
1365+
mCdwCntRU[iRU][row]++;
13651366
mRowRU[iRU] = row; // keep the row
13661367
}
13671368
if (this->mVerboseOutput) {
@@ -1476,16 +1477,17 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
14761477
}
14771478
std::vector<short int> chipEnabled = getChipListFromRu(iRU, mActiveLinks[iRU]); // chip boundaries
14781479
// Fill the chipDone info string
1479-
if (mRunTypeRU[iRU] == nInjScaled * nL) {
1480+
if (mRunTypeRUCopy[iRU] == nInjScaled * nL) {
14801481
for (short int iChip = 0; iChip < chipEnabled.size(); iChip++) {
14811482
if ((chipEnabled[iChip] % mChipModBase) != mChipModSel) {
14821483
continue;
14831484
}
14841485
addDatabaseEntry(chipEnabled[iChip], "", std::vector<float>(), true);
14851486
}
1487+
mRunTypeRUCopy[iRU] = 0; // reset here is safer (the other counter is reset in finalize)
14861488
}
14871489
// Check if scan of a row is finished: only for specific scans!
1488-
bool passCondition = (mCdwCntRU[iRU] == nInjScaled * nL);
1490+
bool passCondition = (mCdwCntRU[iRU][mRowRU[iRU]] >= nInjScaled * nL);
14891491
if (mScanType != 'D' && mScanType != 'A' && mScanType != 'P' && mScanType != 'p' && mScanType != 'R' && mScanType != 'r' && passCondition) {
14901492
// extract data from the row
14911493
for (short int iChip = 0; iChip < chipEnabled.size(); iChip++) {
@@ -1503,7 +1505,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
15031505
}
15041506
}
15051507
}
1506-
mCdwCntRU[iRU] = 0; // reset
1508+
mCdwCntRU[iRU][mRowRU[iRU]] = 0; // reset
15071509
}
15081510
} // end loop on RuSet
15091511

0 commit comments

Comments
 (0)