@@ -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