Commit d7a2c588 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau Committed by Florian Uhlig
Browse files

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.
parent 697b59b8
......@@ -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);
......
......@@ -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;
......
......@@ -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
......
......@@ -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 ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment