diff --git a/Detectors/ITSMFT/ITS/workflow/src/ClustererSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/ClustererSpec.cxx index 16e2c65a37e33..d58e4f5d915c1 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/ClustererSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/ClustererSpec.cxx @@ -121,8 +121,9 @@ void ClustererDPL::updateTimeDependentParams(ProcessingContext& pc) // settings for the fired pixel overflow masking const auto& alpParams = o2::itsmft::DPLAlpideParam::Instance(); const auto& clParams = o2::itsmft::ClustererParam::Instance(); + mClusterer->setDropHugeClusters(clParams.dropHugeClusters); if (clParams.maxBCDiffToMaskBias > 0 && clParams.maxBCDiffToSquashBias > 0) { - LOGP(fatal, "maxBCDiffToMaskBias = {} and maxBCDiffToMaskBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias); + LOGP(fatal, "maxBCDiffToMaskBias = {} and maxBCDiffToSquashBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias); } auto nbc = clParams.maxBCDiffToMaskBias; nbc += mClusterer->isContinuousReadOut() ? alpParams.roFrameLengthInBC : (alpParams.roFrameLengthTrig / o2::constants::lhc::LHCBunchSpacingNS); diff --git a/Detectors/ITSMFT/MFT/workflow/src/ClustererSpec.cxx b/Detectors/ITSMFT/MFT/workflow/src/ClustererSpec.cxx index bc8568112e447..766d7c1a0729e 100644 --- a/Detectors/ITSMFT/MFT/workflow/src/ClustererSpec.cxx +++ b/Detectors/ITSMFT/MFT/workflow/src/ClustererSpec.cxx @@ -122,8 +122,9 @@ void ClustererDPL::updateTimeDependentParams(ProcessingContext& pc) const auto& alpParams = o2::itsmft::DPLAlpideParam::Instance(); const auto& clParams = o2::itsmft::ClustererParam::Instance(); if (clParams.maxBCDiffToMaskBias > 0 && clParams.maxBCDiffToSquashBias > 0) { - LOGP(fatal, "maxBCDiffToMaskBias = {} and maxBCDiffToMaskBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias); + LOGP(fatal, "maxBCDiffToMaskBias = {} and maxBCDiffToSquashBias = {} cannot be set at the same time. Either set masking or squashing with a BCDiff > 0", clParams.maxBCDiffToMaskBias, clParams.maxBCDiffToSquashBias); } + mClusterer->setDropHugeClusters(clParams.dropHugeClusters); auto nbc = clParams.maxBCDiffToMaskBias; nbc += mClusterer->isContinuousReadOut() ? alpParams.roFrameLengthInBC : (alpParams.roFrameLengthTrig / o2::constants::lhc::LHCBunchSpacingNS); mClusterer->setMaxBCSeparationToMask(nbc); diff --git a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/Clusterer.h b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/Clusterer.h index d79eb4ac2b460..960ce2ca33d5b 100644 --- a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/Clusterer.h +++ b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/Clusterer.h @@ -204,6 +204,9 @@ class Clusterer bool isContinuousReadOut() const { return mContinuousReadout; } void setContinuousReadOut(bool v) { mContinuousReadout = v; } + bool isDropHugeClusters() const { return mDropHugeClusters; } + void setDropHugeClusters(bool v) { mDropHugeClusters = v; } + int getMaxBCSeparationToMask() const { return mMaxBCSeparationToMask; } void setMaxBCSeparationToMask(int n) { mMaxBCSeparationToMask = n; } @@ -238,6 +241,7 @@ class Clusterer // clusterization options bool mContinuousReadout = true; ///< flag continuous readout + bool mDropHugeClusters = false; ///< don't include clusters that would be split in more than one ///< mask continuosly fired pixels in frames separated by less than this amount of BCs (fired from hit in prev. ROF) int mMaxBCSeparationToMask = 6000. / o2::constants::lhc::LHCBunchSpacingNS + 10; diff --git a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ClustererParam.h b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ClustererParam.h index b922dbd421431..a71e5f3095b06 100644 --- a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ClustererParam.h +++ b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ClustererParam.h @@ -38,6 +38,7 @@ struct ClustererParam : public o2::conf::ConfigurableParamHelperstreamCluster(pixArrBuff, &labelsBuff, bbox, parent->mPattIdConverter, compClusPtr, patternsPtr, labelsClusPtr, nlab); } else { auto warnLeft = MaxHugeClusWarn - parent->mNHugeClus; - if (warnLeft > 0) { - LOGP(warn, "Splitting a huge cluster: chipID {}, rows {}:{} cols {}:{}{}", bbox.chipID, bbox.rowMin, bbox.rowMax, bbox.colMin, bbox.colMax, - warnLeft == 1 ? " (Further warnings will be muted)" : ""); + if (!parent->mDropHugeClusters) { + if (warnLeft > 0) { + LOGP(warn, "Splitting a huge cluster: chipID {}, rows {}:{} cols {}:{}{}", bbox.chipID, bbox.rowMin, bbox.rowMax, bbox.colMin, bbox.colMax, + warnLeft == 1 ? " (Further warnings will be muted)" : ""); #ifdef WITH_OPENMP #pragma omp critical #endif - { - parent->mNHugeClus++; + { + parent->mNHugeClus++; + } } - } - BBox bboxT(bbox); // truncated box - std::vector pixbuf; - do { - bboxT.rowMin = bbox.rowMin; - bboxT.colMax = std::min(bbox.colMax, uint16_t(bboxT.colMin + o2::itsmft::ClusterPattern::MaxColSpan - 1)); - do { // Select a subset of pixels fitting the reduced bounding box - bboxT.rowMax = std::min(bbox.rowMax, uint16_t(bboxT.rowMin + o2::itsmft::ClusterPattern::MaxRowSpan - 1)); - for (const auto& pix : pixArrBuff) { - if (bboxT.isInside(pix.getRowDirect(), pix.getCol())) { - pixbuf.push_back(pix); + BBox bboxT(bbox); // truncated box + std::vector pixbuf; + do { + bboxT.rowMin = bbox.rowMin; + bboxT.colMax = std::min(bbox.colMax, uint16_t(bboxT.colMin + o2::itsmft::ClusterPattern::MaxColSpan - 1)); + do { // Select a subset of pixels fitting the reduced bounding box + bboxT.rowMax = std::min(bbox.rowMax, uint16_t(bboxT.rowMin + o2::itsmft::ClusterPattern::MaxRowSpan - 1)); + for (const auto& pix : pixArrBuff) { + if (bboxT.isInside(pix.getRowDirect(), pix.getCol())) { + pixbuf.push_back(pix); + } } - } - if (!pixbuf.empty()) { // Stream a piece of cluster only if the reduced bounding box is not empty - parent->streamCluster(pixbuf, &labelsBuff, bboxT, parent->mPattIdConverter, compClusPtr, patternsPtr, labelsClusPtr, nlab, true); - pixbuf.clear(); - } - bboxT.rowMin = bboxT.rowMax + 1; - } while (bboxT.rowMin < bbox.rowMax); - bboxT.colMin = bboxT.colMax + 1; - } while (bboxT.colMin < bbox.colMax); + if (!pixbuf.empty()) { // Stream a piece of cluster only if the reduced bounding box is not empty + parent->streamCluster(pixbuf, &labelsBuff, bboxT, parent->mPattIdConverter, compClusPtr, patternsPtr, labelsClusPtr, nlab, true); + pixbuf.clear(); + } + bboxT.rowMin = bboxT.rowMax + 1; + } while (bboxT.rowMin < bbox.rowMax); + bboxT.colMin = bboxT.colMax + 1; + } while (bboxT.colMin < bbox.colMax); + } } } } @@ -451,8 +453,8 @@ void Clusterer::print() const { // print settings LOGP(info, "Clusterizer squashes overflow pixels separated by {} BC and <= {} in row/col seeking down to {} neighbour ROFs", mMaxBCSeparationToSquash, mMaxRowColDiffToMask, mSquashingDepth); - LOG(info) << "Clusterizer masks overflow pixels separated by < " << mMaxBCSeparationToMask << " BC and <= " - << mMaxRowColDiffToMask << " in row/col"; + LOGP(info, "Clusterizer masks overflow pixels separated by < {} BC and <= {} in row/col", mMaxBCSeparationToMask, mMaxRowColDiffToMask); + LOGP(info, "Clusterizer does {} drop huge clusters", mDropHugeClusters ? "" : "not"); #ifdef _PERFORM_TIMING_ auto& tmr = const_cast(mTimer); // ugly but this is what root does internally