diff --git a/core/data/sts/CbmStsDigi.h b/core/data/sts/CbmStsDigi.h index 7867329e5a2f128e3dc874d087238eec9119863c..e2e6a1de5862c1a054b82a2cc5c6643f935fcd55 100644 --- a/core/data/sts/CbmStsDigi.h +++ b/core/data/sts/CbmStsDigi.h @@ -49,7 +49,10 @@ public: **/ CbmStsDigi(int32_t address, int32_t channel, double time, uint16_t charge) { - assert(time >= 0 && time <= kMaxTimestamp); + // StsDigi is not able to store negative timestamps. + assert(time >= 0); + // StsDigi has a maximal time range of ~2.1s (2 147 483 647 ns). + assert(time <= kMaxTimestamp); PackAddressAndTime(address, time); PackChannelAndCharge(channel, charge); } @@ -115,7 +118,9 @@ public: void SetTime(double dNewTime) { // StsDigi is not able to store negative timestamps. - assert(dNewTime >= 0 && dNewTime <= kMaxTimestamp); + assert(dNewTime >= 0); + // StsDigi has a maximal time range of ~2.1s (2 147 483 647 ns). + assert(dNewTime <= kMaxTimestamp); PackTime(dNewTime); } diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx index 623ad0163f1a6ee61ddbfb138edaeb9fb2e647e9..0756228412e3c37f11232801080539e278788457 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx @@ -592,7 +592,7 @@ void CbmStsUnpackAlgo::processTsMsbInfo(const stsxyter::Message& mess, uint32_t // Update Status counters if (uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) { - LOG(debug) << " TS " << std::setw(12) << fTsIndex << uMsIdx << " MS Idx " << std::setw(4) << uMsIdx << " Msg Idx " + LOG(debug) << " TS " << std::setw(12) << fTsIndex << " MS Idx " << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " << std::setw(2) << fuCurrDpbIdx << " Old TsMsb " << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " << std::setw(5) << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " new TsMsb " << std::setw(5) << uVal; @@ -610,7 +610,7 @@ void CbmStsUnpackAlgo::processTsMsbInfo(const stsxyter::Message& mess, uint32_t && !(uVal == fvulCurrentTsMsb[fuCurrDpbIdx] && 2 == uMessIdx) /// New FW introduced TS_MSB suppression + large TS_MSB => warning only if value not increasing && uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) { - LOG(debug) << "TS MSb Jump in " + LOG(debug) << "TS MSB Jump in " << " TS " << std::setw(12) << fTsIndex << " MS Idx " << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " << std::setw(2) << fuCurrDpbIdx << " => Old TsMsb " << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " new TsMsb " << std::setw(5) << uVal; @@ -622,6 +622,10 @@ void CbmStsUnpackAlgo::processTsMsbInfo(const stsxyter::Message& mess, uint32_t else fvulCurrentTsMsb[fuCurrDpbIdx] = uVal; + LOG(debug1) << " TS " << std::setw(12) << fTsIndex << " MS Idx " << std::setw(4) << uMsIdx << " Msg Idx " + << std::setw(5) << uMessIdx << " DPB " << std::setw(2) << fuCurrDpbIdx << " TsMsb " << std::setw(5) + << fvulCurrentTsMsb[fuCurrDpbIdx] << " MsbCy " << std::setw(5) << fvuCurrentTsMsbCycle[fuCurrDpbIdx]; + fulTsMsbIndexInTs[fuCurrDpbIdx] = fvulCurrentTsMsb[fuCurrDpbIdx] + (fvuCurrentTsMsbCycle[fuCurrDpbIdx] * static_cast<uint64_t>(1 << stsxyter::kusLenTsMsbValBinning)); @@ -653,12 +657,19 @@ void CbmStsUnpackAlgo::refreshTsMsbFields(const uint32_t imslice, const size_t m std::floor((mstime - uTsMsbCycleHeader * (stsxyter::kulTsCycleNbBinsBinning * stsxyter::kdClockCycleNs)) / (stsxyter::kuHitNbTsBinsBinning * stsxyter::kdClockCycleNs)); + LOG(debug1) << " TS " << std::setw(12) << fTsIndex << " MS " << std::setw(12) << mstime << " MS Idx " << std::setw(4) + << imslice << " Msg Idx " << std::setw(5) << 0 << " DPB " << std::setw(2) << fuCurrDpbIdx << " Old TsMsb " + << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " << std::setw(5) + << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " header TsMsb " << uTsMsbHeader << " New MsbCy " + << uTsMsbCycleHeader; + if (0 == imslice) { if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx]) LOG(debug) << " TS " << std::setw(12) << fTsIndex << " MS " << std::setw(12) << mstime << " MS Idx " << std::setw(4) << imslice << " Msg Idx " << std::setw(5) << 0 << " DPB " << std::setw(2) << fuCurrDpbIdx << " Old TsMsb " << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " - << std::setw(5) << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " New MsbCy " << uTsMsbCycleHeader; + << std::setw(5) << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " New TsMsb " << uTsMsbHeader << " New MsbCy " + << uTsMsbCycleHeader; fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader; fvulCurrentTsMsb[fuCurrDpbIdx] = uTsMsbHeader; } @@ -712,7 +723,7 @@ bool CbmStsUnpackAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp, UI fMsStartTime = msDescriptor.idx; LOG(debug) << "Microslice: " << fMsStartTime << " from EqId " << std::hex << uCurrentEquipmentId << std::dec - << " has size: " << uSize; + << " has size: " << uSize << " (index " << imslice << ")"; if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts->num_components(), false);