From d7a2c588cb30ab2dadfb8397fb8efc4f574335ea Mon Sep 17 00:00:00 2001 From: P-A Loizeau <p.-a.loizeau@gsi.de> Date: Tue, 21 Sep 2021 16:38:15 +0200 Subject: [PATCH] Fix the size of the TS MSB storage for the dupli filter Bug 1: Size was too small which led to some digis with TS_MSB above 65555 escaping the duplicates filter. No effect on the digi themselves (time is computed from the original 64b/32b value). In the legacy case we can stay with 32b (instead of the original 64b or the old 16b) as the field in the raw message is 29b, while in the current version we need 64b to account for potential TS_MSB cycles and large Timeslice start offset. --- reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx | 11 ++++------- reco/detectors/sts/unpack/CbmStsUnpackAlgo.h | 6 ++---- reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx | 10 +++++----- reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h | 4 ++-- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx index 8429661f37..0e583287d1 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx @@ -283,13 +283,11 @@ void CbmStsUnpackAlgo::initInternalStatus(CbmMcbm2018StsPar* parset) fvvusLastTsChan.resize(uNbStsXyters); fvvusLastAdcChan.resize(uNbStsXyters); - fvvusLastTsMsbChan.resize(uNbStsXyters); - fvvusLastTsMsbCycleChan.resize(uNbStsXyters); + fvvulLastTsMsbChan.resize(uNbStsXyters); for (uint32_t uAsicIdx = 0; uAsicIdx < uNbStsXyters; ++uAsicIdx) { fvvusLastTsChan[uAsicIdx].resize(fNrChsPerAsic, 0); fvvusLastAdcChan[uAsicIdx].resize(fNrChsPerAsic, 0); - fvvusLastTsMsbChan[uAsicIdx].resize(fNrChsPerAsic, 0); - fvvusLastTsMsbCycleChan[uAsicIdx].resize(fNrChsPerAsic, 0); + fvvulLastTsMsbChan[uAsicIdx].resize(fNrChsPerAsic, 0); } } @@ -465,7 +463,7 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess) if (fbRejectDuplicateDigis) { if (usRawTs == fvvusLastTsChan[uAsicIdx][usChan] && (fbDupliWithoutAdc || usRawAdc == fvvusLastAdcChan[uAsicIdx][usChan]) - && fulTsMsbIndexInTs[fuCurrDpbIdx] == fvvusLastTsMsbChan[uAsicIdx][usChan]) { + && fulTsMsbIndexInTs[fuCurrDpbIdx] == fvvulLastTsMsbChan[uAsicIdx][usChan]) { /// FIXME: add plots to check what is done in this rejection LOG(debug) << "CbmStsUnpackAlgo::processHitInfo => " << Form("Rejecting duplicate on Asic %3d channel %3d, TS %3d, ADC %2d", uAsicIdx, usChan, usRawTs, @@ -474,8 +472,7 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess) } // if same TS, (ADC,) TS MSB, TS MSB cycle, reject fvvusLastTsChan[uAsicIdx][usChan] = usRawTs; fvvusLastAdcChan[uAsicIdx][usChan] = usRawAdc; - fvvusLastTsMsbChan[uAsicIdx][usChan] = fulTsMsbIndexInTs[fuCurrDpbIdx]; - fvvusLastTsMsbCycleChan[uAsicIdx][usChan] = fvuCurrentTsMsbCycle[fuCurrDpbIdx]; + fvvulLastTsMsbChan[uAsicIdx][usChan] = fulTsMsbIndexInTs[fuCurrDpbIdx]; } // if (fbRejectDuplicateDigis) uint32_t uChanInMod = usChan + fNrChsPerAsic * (uAsicIdx % fNrAsicsPerFeb); diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h index 132c108148..800eb45466 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h @@ -248,10 +248,8 @@ protected: std::vector<std::vector<uint16_t>> fvvusLastTsChan = {}; //! /** @brief ADC of last hit message for each channel, [ AsicIdx ][ Chan ] */ std::vector<std::vector<uint16_t>> fvvusLastAdcChan = {}; //! - /** @brief TS MSB of last hit message for each channel, [ AsicIdx ][ Chan ] */ - std::vector<std::vector<uint16_t>> fvvusLastTsMsbChan = {}; //! - /** @brief TS MSB cycle of last hit message for each channel, [ AsicIdx ][ Chan ] */ - std::vector<std::vector<uint16_t>> fvvusLastTsMsbCycleChan = {}; //! + /** @brief TS MSB in TS of last hit message for each channel, [ AsicIdx ][ Chan ] */ + std::vector<std::vector<uint64_t>> fvvulLastTsMsbChan = {}; //! /** @brief Time of first valid hit (TS_MSB available), used as reference for evolution plots @todo move this to the monitor the algo does not need it!*/ double fdStartTime = 0; diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx index 1b0b195b11..4b903078da 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx @@ -52,7 +52,7 @@ CbmStsUnpackAlgoLegacy::CbmStsUnpackAlgoLegacy() , fvmHitsInMs() , fvvusLastTsChan() , fvvusLastAdcChan() - , fvvusLastTsMsbChan() + , fvvuLastTsMsbChan() , fvvusLastTsMsbCycleChan() { } @@ -323,12 +323,12 @@ void CbmStsUnpackAlgoLegacy::InitInternalStatus() fvvusLastTsChan.resize(uNbStsXyters); fvvusLastAdcChan.resize(uNbStsXyters); - fvvusLastTsMsbChan.resize(uNbStsXyters); + fvvuLastTsMsbChan.resize(uNbStsXyters); fvvusLastTsMsbCycleChan.resize(uNbStsXyters); for (uint32_t uAsicIdx = 0; uAsicIdx < uNbStsXyters; ++uAsicIdx) { fvvusLastTsChan[uAsicIdx].resize(fUnpackPar->GetNbChanPerAsic(), 0); fvvusLastAdcChan[uAsicIdx].resize(fUnpackPar->GetNbChanPerAsic(), 0); - fvvusLastTsMsbChan[uAsicIdx].resize(fUnpackPar->GetNbChanPerAsic(), 0); + fvvuLastTsMsbChan[uAsicIdx].resize(fUnpackPar->GetNbChanPerAsic(), 0); fvvusLastTsMsbCycleChan[uAsicIdx].resize(fUnpackPar->GetNbChanPerAsic(), 0); } } @@ -572,7 +572,7 @@ void CbmStsUnpackAlgoLegacy::ProcessHitInfo(const stsxyter::Message& mess) if (fbRejectDuplicateDigis) { if (usRawTs == fvvusLastTsChan[uAsicIdx][usChan] && (fbDupliWithoutAdc || usRawAdc == fvvusLastAdcChan[uAsicIdx][usChan]) - && fvulCurrentTsMsb[fuCurrDpbIdx] - fvvusLastTsMsbChan[uAsicIdx][usChan] < kuMaxTsMsbDiffDuplicates + && fvulCurrentTsMsb[fuCurrDpbIdx] - fvvuLastTsMsbChan[uAsicIdx][usChan] < kuMaxTsMsbDiffDuplicates && fvuCurrentTsMsbCycle[fuCurrDpbIdx] == fvvusLastTsMsbCycleChan[uAsicIdx][usChan]) { /// FIXME: add plots to check what is done in this rejection LOG(debug) << "CbmStsUnpackAlgoLegacy::ProcessHitInfo => " @@ -583,7 +583,7 @@ void CbmStsUnpackAlgoLegacy::ProcessHitInfo(const stsxyter::Message& mess) } // if (fbRejectDuplicateDigis) fvvusLastTsChan[uAsicIdx][usChan] = usRawTs; fvvusLastAdcChan[uAsicIdx][usChan] = usRawAdc; - fvvusLastTsMsbChan[uAsicIdx][usChan] = fvulCurrentTsMsb[fuCurrDpbIdx]; + fvvuLastTsMsbChan[uAsicIdx][usChan] = fvulCurrentTsMsb[fuCurrDpbIdx]; fvvusLastTsMsbCycleChan[uAsicIdx][usChan] = fvuCurrentTsMsbCycle[fuCurrDpbIdx]; // Compute the Full time stamp diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h index 09cf50f56a..b81fa7e761 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h @@ -139,8 +139,8 @@ private: std::vector<std::vector<uint16_t>> fvvusLastTsChan; //! TS of last hit message for each channel, [ AsicIdx ][ Chan ] std::vector<std::vector<uint16_t>> fvvusLastAdcChan; //! ADC of last hit message for each channel, [ AsicIdx ][ Chan ] - std::vector<std::vector<uint16_t>> - fvvusLastTsMsbChan; //! TS MSB of last hit message for each channel, [ AsicIdx ][ Chan ] + std::vector<std::vector<uint32_t>> + fvvuLastTsMsbChan; //! TS MSB of last hit message for each channel, [ AsicIdx ][ Chan ] std::vector<std::vector<uint16_t>> fvvusLastTsMsbCycleChan; //! TS MSB cycle of last hit message for each channel, [ AsicIdx ][ Chan ] -- GitLab