From 332a853f744909c6f086b67035d60095da9702e7 Mon Sep 17 00:00:00 2001 From: iravasen Date: Wed, 14 Aug 2024 18:56:12 +0200 Subject: [PATCH 1/2] fix for chipDone counter: reset always independently on hits --- .../include/ITSWorkflow/ThresholdCalibratorSpec.h | 7 +++++-- .../ITS/workflow/src/ThresholdCalibratorSpec.cxx | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index a5064db424e5e..0a96c1154a10a 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,8 +232,10 @@ 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}; + short int mLastRowRU[N_RU] = {0}; bool mActiveLinks[N_RU][3] = {{false}}; std::set mRuSet; // Either "T" for threshold, "V" for VCASN, or "I" for ITHR 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 From 3f6c393759213bf931e230928e7ab83d323cd248 Mon Sep 17 00:00:00 2001 From: iravasen Date: Wed, 14 Aug 2024 18:59:18 +0200 Subject: [PATCH 2/2] removed unused counter --- .../ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index 0a96c1154a10a..6bbf6a910c1f4 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h @@ -235,7 +235,6 @@ class ITSThresholdCalibrator : public Task short int mRunTypeRUCopy[N_RU] = {0}; short int mCdwCntRU[N_RU][N_ROW] = {{0}}; short int mRowRU[N_RU] = {0}; - short int mLastRowRU[N_RU] = {0}; bool mActiveLinks[N_RU][3] = {{false}}; std::set mRuSet; // Either "T" for threshold, "V" for VCASN, or "I" for ITHR