From c6f68ff5de1bba588600b1f8281b25a182c1be11 Mon Sep 17 00:00:00 2001 From: iravasen Date: Tue, 15 Mar 2022 00:38:01 +0100 Subject: [PATCH 1/4] added support for working with multiple decoder pipelines + fixed minor bugs --- .../ITSWorkflow/ThresholdCalibratorSpec.h | 13 +-- .../workflow/src/ThresholdCalibratorSpec.cxx | 95 +++++++++---------- 2 files changed, 50 insertions(+), 58 deletions(-) diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index d2f00ebc1b00c..f178e78818afa 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h @@ -46,6 +46,7 @@ #include "TTree.h" #include "TH1F.h" #include "TF1.h" +#include "TStopwatch.h" using namespace o2::framework; using namespace o2::itsmft; @@ -98,7 +99,8 @@ class ITSThresholdCalibrator : public Task ////////////////////////////////////////////////////////////////// private: // detector information - static constexpr short int N_COL = 1024; // column number in Alpide chip + static constexpr short int N_COL = 1024; // column number in Alpide chip + static constexpr short int N_ROW_MEM = 5; // number of rows we keep in memory for each chip const short int N_RU = o2::itsmft::ChipMappingITS::getNRUs(); @@ -115,8 +117,8 @@ class ITSThresholdCalibrator : public Task short int* mX = nullptr; // Hash tables to store the hit and threshold information per pixel - std::unordered_map mCurrentRow; - std::unordered_map>> mPixelHits; + std::unordered_map>>> mPixelHits; + std::unordered_map> mForbiddenRows; // Unordered map for saving sum of values (thr/ithr/vcasn) for avg calculation std::unordered_map> mThresholds; @@ -135,7 +137,7 @@ class ITSThresholdCalibrator : public Task // Some private helper functions // Helper functions related to the running over data - void extractAndUpdate(const short int&); + void extractAndUpdate(const short int&, const short int&); void extractThresholdRow(const short int&, const short int&); void finalizeOutput(); @@ -151,7 +153,7 @@ class ITSThresholdCalibrator : public Task bool findThresholdFit(const char*, const short int*, const short int&, float&, float&); bool findThresholdDerivative(const char*, const short int*, const short int&, float&, float&); bool findThresholdHitcounting(const char*, const short int*, const short int&, float&); - bool isScanFinished(const short int&); + bool isScanFinished(const short int&, const short int&); void findAverage(const std::array&, float&, float&, float&, float&); void saveThreshold(); @@ -197,7 +199,6 @@ class ITSThresholdCalibrator : public Task // Flag to check if endOfStream is available bool mCheckEos = false; - int mCounter = 0; }; // Create a processor spec diff --git a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx index 4c5763e5387f0..f5035553de7c1 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx @@ -297,7 +297,7 @@ bool ITSThresholdCalibrator::findThresholdFit( // Clean up histogram for next time it is used this->mFitHist->Reset(); - return (chi2 < 5 && noise < 15); + return (chi2 < 5); } ////////////////////////////////////////////////////////////////////////////// @@ -343,7 +343,7 @@ bool ITSThresholdCalibrator::findThresholdDerivative( stddev /= fx; noise = std::sqrt(stddev); - return (noise < 15); + return true; } ////////////////////////////////////////////////////////////////////////////// @@ -400,13 +400,13 @@ void ITSThresholdCalibrator::extractThresholdRow(const short int& chipID, const // Do the threshold fit float thresh = 0., noise = 0.; bool success = false; - success = this->findThreshold(&(this->mPixelHits[chipID][col_i][0]), + success = this->findThreshold(&(this->mPixelHits[chipID][row][col_i][0]), this->mX, *(this->N_RANGE), thresh, noise); vChipid[col_i] = chipID; vRow[col_i] = row; vThreshold[col_i] = this->mScanType == 'T' ? (short int)(thresh * 10.) : (short int)(thresh); - vNoise[col_i] = this->mScanType == 'T' ? (unsigned char)(noise * 10.) : (short int)(noise); + vNoise[col_i] = (unsigned char)(noise * 10.); // always factor 10 also for ITHR/VCASN to not have all zeros vSuccess[col_i] = success; } @@ -425,11 +425,6 @@ void ITSThresholdCalibrator::saveThreshold() // Save info in a map for later averaging int sumT = 0, sumSqT = 0, sumN = 0, sumSqN = 0; int countSuccess = 0; -#ifdef WITH_OPENMP - omp_set_num_threads(mNThreads); -#pragma omp parallel for default(shared) reduction(+ \ - : sumT, sumSqT, sumN, sumSqN, countSuccess) -#endif for (int i = 0; i < this->N_COL; i++) { if (vSuccess[i]) { sumT += vThreshold[i]; @@ -606,17 +601,17 @@ void ITSThresholdCalibrator::setRunType(const short int& runtype) ////////////////////////////////////////////////////////////////////////////// // Check if scan has finished for extracting thresholds -bool ITSThresholdCalibrator::isScanFinished(const short int& chipID) +bool ITSThresholdCalibrator::isScanFinished(const short int& chipID, const short int& row) { // Require that the last entry has at least half the number of expected hits short int col = 0; // Doesn't matter which column short int chg = mScanType == 'I' ? 0 : (*(this->N_RANGE) - 1); - return (this->mPixelHits[chipID][col][chg] >= (N_INJ - 2.)); // TODO: -2 is a safety factor for now + return (this->mPixelHits[chipID][row][col][chg] >= (N_INJ - 5.)); // TODO: -5 is a safety factor for now } ////////////////////////////////////////////////////////////////////////////// // Extract thresholds and update memory -void ITSThresholdCalibrator::extractAndUpdate(const short int& chipID) +void ITSThresholdCalibrator::extractAndUpdate(const short int& chipID, const short int& row) { // In threshold scan case, reset mThresholdTree before writing to a new file if ((this->mScanType == 'T') && ((this->mRowCounter)++ == N_ROWS_PER_FILE)) { @@ -628,7 +623,7 @@ void ITSThresholdCalibrator::extractAndUpdate(const short int& chipID) } // Extract threshold values and save to memory - this->extractThresholdRow(chipID, this->mCurrentRow[chipID]); + this->extractThresholdRow(chipID, row); return; } @@ -684,6 +679,7 @@ void ITSThresholdCalibrator::updateRunID(ProcessingContext& pc) // (ROFs) to count hits and extract thresholds void ITSThresholdCalibrator::run(ProcessingContext& pc) { + // Save environment ID and run number if needed if (this->mEnvironmentID.empty()) { this->updateEnvironmentID(pc); @@ -756,23 +752,17 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc) this->mIsChipDone[chipID] = true; } } - // Row should be the same for the whole ROF - // Check if chip hasn't appeared before - if (!(this->mCurrentRow.count(chipID))) { - // Update current row and initialize hit map - this->mCurrentRow[chipID] = row; - this->mPixelHits[chipID] = std::vector>( - this->N_COL, std::vector(*(this->N_RANGE), 0)); - - // Check if we have a new row on an already existing chip - } else if (this->mCurrentRow[chipID] != row) { - - this->extractAndUpdate(chipID); - // Reset row & hit map for the new row - this->mCurrentRow[chipID] = row; - for (std::vector& v : this->mPixelHits[chipID]) { - std::fill(v.begin(), v.end(), 0); - } + if (!this->mPixelHits.count(chipID)) { // allocate memory for chip = chipID , irow = row if not yet there + this->mPixelHits[chipID][row] = std::vector>(this->N_COL, std::vector(*(this->N_RANGE), 0)); + } else if (!this->mPixelHits[chipID].count(row)) { // chipID exists already but not the irow = row + this->mPixelHits[chipID][row] = std::vector>(this->N_COL, std::vector(*(this->N_RANGE), 0)); + } + // Check if the scan finished for the **current** chip and current row + if (this->isScanFinished(chipID, row)) { + this->extractAndUpdate(chipID, row); + // remove entry for this row whose scan is completed + mPixelHits[chipID].erase(row); + mForbiddenRows[chipID].push_back(row); // due to the loose cut in isScanFinished, extra hits may come for this deleted row. In this way the row is ignored afterwards } // Increment the number of counts for this pixel @@ -782,7 +772,16 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc) throw charge; } - this->mPixelHits[chipID][col][charge - this->mMin]++; + bool isForb = false; + for (int ir = 0; ir < this->mForbiddenRows[chipID].size(); ir++) { + if (mForbiddenRows[chipID][ir] == row) { + isForb = true; + break; + } + } + if (!isForb) { + this->mPixelHits[chipID][row][col][charge - this->mMin]++; + } } // for (digits) @@ -830,6 +829,15 @@ void ITSThresholdCalibrator::addDatabaseEntry( char stave[6]; sprintf(stave, "L%d_%02d", lay, sta); + // Build string to be used to get configDB chipid + std::string key = ""; + if (lay < 3) { + key = std::string(stave) + "_M" + std::to_string(mod) + "_C" + std::to_string(chipInMod); + } else { + std::string uorl = !ssta ? "L" : "U"; + key = std::string(stave) + uorl + "_M" + std::to_string(mod) + "_C" + std::to_string(chipInMod); + } + o2::dcs::addConfigItem(this->mTuning, "Stave", std::string(stave)); o2::dcs::addConfigItem(this->mTuning, "Hs_pos", std::to_string(ssta)); o2::dcs::addConfigItem(this->mTuning, "Hic_Pos", std::to_string(mod)); @@ -863,24 +871,7 @@ void ITSThresholdCalibrator::sendToAggregator(EndOfStreamContext* ec) void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) { - for (auto const& [chipID, hits_vec] : this->mPixelHits) { - // Check that we have received all the data for this row - // Require that the last charge value has at least half counts - if (this->isScanFinished(chipID)) { - this->mCounter++; - this->extractAndUpdate(chipID); - if (!this->mCheckEos) { - short int chg = mScanType == 'I' ? 0 : (*(this->N_RANGE) - 1); - this->mPixelHits[chipID][0][chg] = 0; // so that at next call, if does not pass isScanFinished again - } - } - } - - if (!this->mCheckEos && this->mCounter > 0) { - this->finalizeOutput(); - this->initThresholdTree(); - this->mCounter = 0; - } else if (this->mCheckEos) { + if (this->mCheckEos) { // in case of missing EoS, the finalizeOutput is done in stop() this->finalizeOutput(); } @@ -891,7 +882,7 @@ void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) name = "VCASN"; auto it = this->mThresholds.cbegin(); while (it != this->mThresholds.cend()) { - if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 2) { // TODO: -2 is a safety factor, to be modified once THR scan is stable enough + if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 5) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough ++it; continue; } @@ -912,7 +903,7 @@ void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) name = "ITHR"; auto it = this->mThresholds.cbegin(); while (it != this->mThresholds.cend()) { - if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 2) { // TODO: -2 is a safety factor, to be modified once THR scan is stable enough + if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 5) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough ++it; continue; } @@ -933,7 +924,7 @@ void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) name = "THR"; auto it = this->mThresholds.cbegin(); while (it != this->mThresholds.cend()) { - if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 2) { // TODO: -2 is a safety factor, to be modified once THR scan is stable enough + if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 5) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough ++it; continue; } From 33417be5e5ff14b8a9034425fa1517cf1aff9d12 Mon Sep 17 00:00:00 2001 From: iravasen Date: Tue, 15 Mar 2022 00:51:25 +0100 Subject: [PATCH 2/4] removed unused stuff --- .../include/ITSWorkflow/ThresholdCalibratorSpec.h | 2 -- .../ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx | 9 --------- 2 files changed, 11 deletions(-) diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index f178e78818afa..36d1764134ef6 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h @@ -46,7 +46,6 @@ #include "TTree.h" #include "TH1F.h" #include "TF1.h" -#include "TStopwatch.h" using namespace o2::framework; using namespace o2::itsmft; @@ -100,7 +99,6 @@ class ITSThresholdCalibrator : public Task private: // detector information static constexpr short int N_COL = 1024; // column number in Alpide chip - static constexpr short int N_ROW_MEM = 5; // number of rows we keep in memory for each chip const short int N_RU = o2::itsmft::ChipMappingITS::getNRUs(); diff --git a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx index f5035553de7c1..23dba22dfb475 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx @@ -829,15 +829,6 @@ void ITSThresholdCalibrator::addDatabaseEntry( char stave[6]; sprintf(stave, "L%d_%02d", lay, sta); - // Build string to be used to get configDB chipid - std::string key = ""; - if (lay < 3) { - key = std::string(stave) + "_M" + std::to_string(mod) + "_C" + std::to_string(chipInMod); - } else { - std::string uorl = !ssta ? "L" : "U"; - key = std::string(stave) + uorl + "_M" + std::to_string(mod) + "_C" + std::to_string(chipInMod); - } - o2::dcs::addConfigItem(this->mTuning, "Stave", std::string(stave)); o2::dcs::addConfigItem(this->mTuning, "Hs_pos", std::to_string(ssta)); o2::dcs::addConfigItem(this->mTuning, "Hic_Pos", std::to_string(mod)); From 3b110922a27ea0c55b73eff9fbd49d1273fafe79 Mon Sep 17 00:00:00 2001 From: iravasen Date: Tue, 15 Mar 2022 09:38:41 +0100 Subject: [PATCH 3/4] clang reapplied on header file --- .../ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index 36d1764134ef6..2b5e5a7c6394f 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h @@ -98,7 +98,7 @@ class ITSThresholdCalibrator : public Task ////////////////////////////////////////////////////////////////// private: // detector information - static constexpr short int N_COL = 1024; // column number in Alpide chip + static constexpr short int N_COL = 1024; // column number in Alpide chip const short int N_RU = o2::itsmft::ChipMappingITS::getNRUs(); From 8806b93a64d0c49b84350efc4a7bc045824169ab Mon Sep 17 00:00:00 2001 From: iravasen Date: Thu, 17 Mar 2022 00:38:06 +0100 Subject: [PATCH 4/4] improved timing performance --- .../ITSWorkflow/ThresholdCalibratorSpec.h | 8 +- .../workflow/src/ThresholdCalibratorSpec.cxx | 100 ++++++++++-------- 2 files changed, 61 insertions(+), 47 deletions(-) diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h index 2b5e5a7c6394f..753dd3c9ffb0e 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/ThresholdCalibratorSpec.h @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -115,10 +117,10 @@ class ITSThresholdCalibrator : public Task short int* mX = nullptr; // Hash tables to store the hit and threshold information per pixel - std::unordered_map>>> mPixelHits; - std::unordered_map> mForbiddenRows; + std::map>>> mPixelHits; + std::map> mForbiddenRows; // Unordered map for saving sum of values (thr/ithr/vcasn) for avg calculation - std::unordered_map> mThresholds; + std::map> mThresholds; // Tree to save threshold info in full threshold scan case TFile* mRootOutfile = nullptr; diff --git a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx index 23dba22dfb475..8bf7452ca9704 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/ThresholdCalibratorSpec.cxx @@ -606,7 +606,8 @@ bool ITSThresholdCalibrator::isScanFinished(const short int& chipID, const short // Require that the last entry has at least half the number of expected hits short int col = 0; // Doesn't matter which column short int chg = mScanType == 'I' ? 0 : (*(this->N_RANGE) - 1); - return (this->mPixelHits[chipID][row][col][chg] >= (N_INJ - 5.)); // TODO: -5 is a safety factor for now + // check 2 pixels in case one of them is dead + return (this->mPixelHits[chipID][row][col][chg] >= (N_INJ - 2.) || this->mPixelHits[chipID][row][col + 100][chg] >= (N_INJ - 2.)); // TODO: -5 is a safety factor for now } ////////////////////////////////////////////////////////////////////////////// @@ -679,7 +680,6 @@ void ITSThresholdCalibrator::updateRunID(ProcessingContext& pc) // (ROFs) to count hits and extract thresholds void ITSThresholdCalibrator::run(ProcessingContext& pc) { - // Save environment ID and run number if needed if (this->mEnvironmentID.empty()) { this->updateEnvironmentID(pc); @@ -734,63 +734,74 @@ void ITSThresholdCalibrator::run(ProcessingContext& pc) break; } } - - // If a charge was not found, skip this ROF - if (charge < 0) { + if (charge > this->mMax || charge < this->mMin) { if (this->mVerboseOutput) { - LOG(warning) << "Charge not updated"; + LOG(warning) << "charge value " << charge << " out of range for min " << this->mMin + << " and max " << this->mMax << " (range: " << *(this->N_RANGE) << ")"; } } else { - for (unsigned int idig = rofIndex; idig < rofIndex + rofNEntries; idig++) { + std::vector mChips; + std::map mChipsForbRows; + // loop to retrieve list of chips + for (unsigned int idig = rofIndex; idig < rofIndex + rofNEntries; idig++) { // gets chipid auto& d = digits[idig]; short int chipID = (short int)d.getChipIndex(); - short int col = (short int)d.getColumn(); - if (!this->mCheckEos && !this->mRunTypeUp) { - if (!this->mIsChipDone[chipID]) { - this->mRunTypeChip[chipID]++; - this->mIsChipDone[chipID] = true; + if (std::find(mChips.begin(), mChips.end(), chipID) != mChips.end()) + continue; + mChips.push_back(chipID); + } + // loop to allocate memory only for allowed rows + for (auto& chipID : mChips) { + if (mForbiddenRows.count(chipID)) { + for (int iforb = mForbiddenRows[chipID].size() - 1; iforb >= 0; iforb--) { + if (mForbiddenRows[chipID][iforb] == row) { + mChipsForbRows[chipID] = true; + break; + } } } - if (!this->mPixelHits.count(chipID)) { // allocate memory for chip = chipID , irow = row if not yet there + if (mChipsForbRows[chipID]) { + continue; + } + if (!this->mPixelHits.count(chipID)) { this->mPixelHits[chipID][row] = std::vector>(this->N_COL, std::vector(*(this->N_RANGE), 0)); - } else if (!this->mPixelHits[chipID].count(row)) { // chipID exists already but not the irow = row + } else if (!this->mPixelHits[chipID].count(row)) { // allocate memory for chip = chipID or for a row of this chipID this->mPixelHits[chipID][row] = std::vector>(this->N_COL, std::vector(*(this->N_RANGE), 0)); } - // Check if the scan finished for the **current** chip and current row + } + + // loop to count hits from digits + short int chgPoint = charge - this->mMin; + for (unsigned int idig = rofIndex; idig < rofIndex + rofNEntries; idig++) { + auto& d = digits[idig]; + short int chipID = (short int)d.getChipIndex(); + short int col = (short int)d.getColumn(); + + if (!mChipsForbRows[chipID]) { + // Increment the number of counts for this pixel + this->mPixelHits[chipID][row][col][chgPoint]++; + } + } + // check collected chips in previous loop on digits + for (auto& chipID : mChips) { + // count the zeros + if (!this->mCheckEos && !this->mRunTypeUp) { + this->mRunTypeChip[chipID]++; + } + // check forbidden rows + if (mChipsForbRows[chipID]) { + continue; + } if (this->isScanFinished(chipID, row)) { this->extractAndUpdate(chipID, row); // remove entry for this row whose scan is completed mPixelHits[chipID].erase(row); mForbiddenRows[chipID].push_back(row); // due to the loose cut in isScanFinished, extra hits may come for this deleted row. In this way the row is ignored afterwards } - - // Increment the number of counts for this pixel - if (charge > this->mMax || charge < this->mMin) { - LOG(error) << "charge value " << charge << " out of range for min " << this->mMin - << " and max " << this->mMax << " (range: " << *(this->N_RANGE) << ")"; - throw charge; - } - - bool isForb = false; - for (int ir = 0; ir < this->mForbiddenRows[chipID].size(); ir++) { - if (mForbiddenRows[chipID][ir] == row) { - isForb = true; - break; - } - } - if (!isForb) { - this->mPixelHits[chipID][row][col][charge - this->mMin]++; - } - - } // for (digits) - + } } // if (charge) - - // reset mIsChipDone before the next ROF - memset(this->mIsChipDone, 0, sizeof(this->mIsChipDone)); - - } // for (ROFs) + } // for (ROFs) if (!(this->mCheckEos) && !(this->mRunTypeUp)) { LOG(info) << "Shipping DCSconfigObject_t, run type, scan type and fit type to aggregator from run function (no endOfStream will be used!)"; @@ -873,7 +884,7 @@ void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) name = "VCASN"; auto it = this->mThresholds.cbegin(); while (it != this->mThresholds.cend()) { - if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 5) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough + if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 2) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough ++it; continue; } @@ -894,7 +905,7 @@ void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) name = "ITHR"; auto it = this->mThresholds.cbegin(); while (it != this->mThresholds.cend()) { - if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 5) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough + if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 2) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough ++it; continue; } @@ -915,7 +926,7 @@ void ITSThresholdCalibrator::finalize(EndOfStreamContext* ec) name = "THR"; auto it = this->mThresholds.cbegin(); while (it != this->mThresholds.cend()) { - if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 5) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough + if (!this->mCheckEos && this->mRunTypeChip[it->first] < N_INJ - 2) { // TODO: -5 is a safety factor, to be modified once THR scan is stable enough ++it; continue; } @@ -955,6 +966,7 @@ void ITSThresholdCalibrator::endOfStream(EndOfStreamContext& ec) void ITSThresholdCalibrator::stop() { if (!this->mCheckEos) { + LOGF(info, "stop() report:", mSelfName); this->finalizeOutput(); } return;