From ffde0092cfef672d89751e240603e94c253aed71 Mon Sep 17 00:00:00 2001 From: Alexandru Bercuci <abercuci@niham.nipne.ro> Date: Wed, 29 Jan 2025 14:10:19 +0200 Subject: [PATCH] align legacy unpacker (mCBM22) to the last version of online params --- algo/detectors/trd2d/UnpackMS.cxx | 15 +++++++++------ algo/detectors/trd2d/UnpackMS.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/algo/detectors/trd2d/UnpackMS.cxx b/algo/detectors/trd2d/UnpackMS.cxx index 1c0e77249..9c0be4cba 100644 --- a/algo/detectors/trd2d/UnpackMS.cxx +++ b/algo/detectors/trd2d/UnpackMS.cxx @@ -193,7 +193,8 @@ namespace cbm::algo::trd2d // Get the number of complete words in the input MS buffer. const uint32_t nwords = msDescr.size / 4; - + L_(debug) << "UnpackMS<kMessLegacy>::op() param.olink[" << (int) fParams.fEqId << "]=0x" << std::hex + << (int) fParams.fEqAdd << " data.rob=0x" << int(msDescr.eq_id) << " words=" << std::dec << nwords; // We have 32 bit FASP frames in this readout version const uint32_t* wd = reinterpret_cast<const uint32_t*>(msContent); @@ -251,11 +252,13 @@ namespace cbm::algo::trd2d const uint16_t mod_id = fParams.fModId; const uint8_t fasp_mod_id = fParams.mapFaspId2Mod<mLegacy>(messes[0].fasp); const UnpackAsicPar& asicPar = fParams.fAsicParams.at(fasp_mod_id); - const uint64_t tdaqOffset = asicPar.fChanParams[messes[0].ch].fDaqOffset; for (auto imess : messes) { - const int32_t pad = std::abs(asicPar.fChanParams[imess.ch].fPadAddress); - const bool hasPairingR = bool(asicPar.fChanParams[imess.ch].fPadAddress > 0); + const UnpackChannelPar& chPar = asicPar.fChanParams[imess.ch]; + //std::cout << imess.print(); + const int32_t pad = std::abs(chPar.fPadAddress) / 2; + const bool hasPairingR = bool(chPar.fPadAddress > 0); + const uint8_t tdaqOffset = chPar.fDaqOffset; const uint64_t lTime = time + tdaqOffset + imess.tlab; const uint16_t lchR = hasPairingR ? imess.data : 0; const uint16_t lchT = hasPairingR ? 0 : imess.data; @@ -320,7 +323,7 @@ namespace cbm::algo::trd2d { std::vector<CbmTrdDigi> outputDigis; - for (uint16_t ipad(0); ipad < NFASPMOD * NFASPCH; ipad++) { + for (uint16_t ipad(0); ipad < NFASPMOD * NFASPPAD; ipad++) { if (!ctx.fDigiBuffer[ipad].size()) continue; uint nIncomplete(0); for (auto id = ctx.fDigiBuffer[ipad].begin(); id != ctx.fDigiBuffer[ipad].end(); id++) { @@ -369,7 +372,7 @@ namespace cbm::algo::trd2d // Get the number of complete words in the input MS buffer. const uint32_t nwords = msDescr.size / 4; - L_(debug) << "UnpackMS<kMess24>::op() param.elink[" << (int) fParams.fEqId << "]=0x" << std::hex + L_(debug) << "UnpackMS<kMess24>::op() param.olink[" << (int) fParams.fEqId << "]=0x" << std::hex << (int) fParams.fEqAdd << " data.rob=0x" << int(msDescr.eq_id) << " words=" << std::dec << nwords; // We have 32 bit FASP frames in this readout version diff --git a/algo/detectors/trd2d/UnpackMS.h b/algo/detectors/trd2d/UnpackMS.h index 1babd7e85..631bb4db6 100644 --- a/algo/detectors/trd2d/UnpackMS.h +++ b/algo/detectors/trd2d/UnpackMS.h @@ -15,7 +15,7 @@ #define NROBMOD 5 #define NFASPROB NFASPMOD / NROBMOD #define NFASPCH 16 -#define NFASPPAD 8 +#define NFASPPAD NFASPCH / 2 #define FASP_EPOCH_LENGTH 128 // the length in clks of FASP epoch [1600ns @ 40MHz] -- GitLab