Skip to content

Commit

Permalink
ITS Calibration: always reset chipDone counter independently on hits (A…
Browse files Browse the repository at this point in the history
…liceO2Group#13386)

* fix for chipDone counter: reset always independently on hits

* removed unused counter
  • Loading branch information
iravasen authored Aug 15, 2024
1 parent 6e8a014 commit 2e52880
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class ITSThresholdCalibrator : public Task
private:
void updateTimeDependentParams(ProcessingContext& pc);
// detector information
static constexpr short int N_COL = 1024; // column number in Alpide chip
static constexpr short int N_COL = 1024; // number of columns in Alpide chip
static constexpr short int N_ROW = 512; // number of rows in Alpide chip

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

Expand Down Expand Up @@ -231,7 +232,8 @@ class ITSThresholdCalibrator : public Task
short int mRunType = -1;
short int mRunTypeUp = -1;
short int mRunTypeRU[N_RU] = {0};
short int mCdwCntRU[N_RU] = {0};
short int mRunTypeRUCopy[N_RU] = {0};
short int mCdwCntRU[N_RU][N_ROW] = {{0}};
short int mRowRU[N_RU] = {0};
bool mActiveLinks[N_RU][3] = {{false}};
std::set<short int> mRuSet;
Expand Down
10 changes: 6 additions & 4 deletions Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
// count the zeros
if (!mRunTypeUp) {
mRunTypeRU[iRU]++;
mRunTypeRUCopy[iRU]++;
}
// Divide calibration word (24-bit) by 2^16 to get the first 8 bits
if (this->mScanType == 'T') {
Expand All @@ -1361,7 +1362,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
// count the last N injections
short int checkVal = (mScanType == 'I') ? mMin : mMax;
if (loopval == checkVal && realcharge == mMin2) { // the second condition is relevant only for mScanType=p
mCdwCntRU[iRU]++;
mCdwCntRU[iRU][row]++;
mRowRU[iRU] = row; // keep the row
}
if (this->mVerboseOutput) {
Expand Down Expand Up @@ -1476,16 +1477,17 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
}
std::vector<short int> chipEnabled = getChipListFromRu(iRU, mActiveLinks[iRU]); // chip boundaries
// Fill the chipDone info string
if (mRunTypeRU[iRU] == nInjScaled * nL) {
if (mRunTypeRUCopy[iRU] == nInjScaled * nL) {
for (short int iChip = 0; iChip < chipEnabled.size(); iChip++) {
if ((chipEnabled[iChip] % mChipModBase) != mChipModSel) {
continue;
}
addDatabaseEntry(chipEnabled[iChip], "", std::vector<float>(), true);
}
mRunTypeRUCopy[iRU] = 0; // reset here is safer (the other counter is reset in finalize)
}
// Check if scan of a row is finished: only for specific scans!
bool passCondition = (mCdwCntRU[iRU] == nInjScaled * nL);
bool passCondition = (mCdwCntRU[iRU][mRowRU[iRU]] >= nInjScaled * nL);
if (mScanType != 'D' && mScanType != 'A' && mScanType != 'P' && mScanType != 'p' && mScanType != 'R' && mScanType != 'r' && passCondition) {
// extract data from the row
for (short int iChip = 0; iChip < chipEnabled.size(); iChip++) {
Expand All @@ -1503,7 +1505,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc)
}
}
}
mCdwCntRU[iRU] = 0; // reset
mCdwCntRU[iRU][mRowRU[iRU]] = 0; // reset
}
} // end loop on RuSet

Expand Down

0 comments on commit 2e52880

Please sign in to comment.