Skip to content
Snippets Groups Projects
Commit ffde0092 authored by Alexandru Bercuci's avatar Alexandru Bercuci
Browse files

align legacy unpacker (mCBM22) to the last version of online params

parent b70f423d
No related branches found
No related tags found
1 merge request!19952D online unpacker. Updated versions for the algo and the FASP message.
......@@ -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
......
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment