diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index a5064db424e5e..6bbf6a910c1f4 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h @@ -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(); @@ -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 mRuSet; diff --git a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx index 0b3d67e515360..64fa4247d8aad 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx @@ -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') { @@ -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) { @@ -1476,16 +1477,17 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc) } std::vector 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(), 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++) { @@ -1503,7 +1505,7 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc) } } } - mCdwCntRU[iRU] = 0; // reset + mCdwCntRU[iRU][mRowRU[iRU]] = 0; // reset } } // end loop on RuSet