@@ -457,9 +457,6 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
457457
458458#ifdef GPUCA_O2_LIB
459459struct zsEncoderImprovedLinkBased : public zsEncoder {
460- static constexpr bool TIGHTLY_PACKED = false ;
461- static constexpr unsigned int SAMPLESPER64BIT = 64 / TPCZSHDRV2 ::TPC_ZS_NBITS_V3 ; // 5 12-bit samples with 4 bit padding per 64 bit word for non-TIGHTLY_PACKED data
462-
463460 TPCZSHDRV2 * hdr = nullptr ;
464461 int inverseChannelMapping[5 ][32 ];
465462 int nSamples = 0 ;
@@ -545,10 +542,10 @@ bool zsEncoderImprovedLinkBased::checkInput(std::vector<o2::tpc::Digit>& tmpBuff
545542 if (!finishPage) {
546543 unsigned int sizeChk = (unsigned int )(pagePtr - reinterpret_cast <unsigned char *>(page));
547544 sizeChk += sizeof (o2::tpc::zerosupp_link_based::CommonHeader);
548- if (TIGHTLY_PACKED ) {
545+ if (TPCZSHDRV2 :: TIGHTLY_PACKED_V3 ) {
549546 sizeChk += (nSamples * TPCZSHDRV2 ::TPC_ZS_NBITS_V3 + 127 ) / 128 * 16 ;
550547 } else {
551- sizeChk += (nSamples + 2 * SAMPLESPER64BIT - 1 ) / (2 * SAMPLESPER64BIT ) * 16 ;
548+ sizeChk += (nSamples + 2 * TPCZSHDRV2 :: SAMPLESPER64BIT - 1 ) / (2 * TPCZSHDRV2 :: SAMPLESPER64BIT ) * 16 ;
552549 }
553550 if (sizeChk > TPCZSHDR ::TPC_ZS_PAGE_SIZE ) {
554551 finishPage = true ;
@@ -574,19 +571,19 @@ unsigned int zsEncoderImprovedLinkBased::encodeSequence(std::vector<o2::tpc::Dig
574571 tbHdr->fecInPartition = link;
575572 hdr->nTimeBins = tmpBuffer[k].getTimeStamp () - firstTimebinInPage + 1 ;
576573 hdr->nTimebinHeaders ++;
577- if (TIGHTLY_PACKED ) {
574+ if (TPCZSHDRV2 :: TIGHTLY_PACKED_V3 ) {
578575 tbHdr->numWordsPayload = (nSamples * TPCZSHDRV2 ::TPC_ZS_NBITS_V3 + 127 ) / 128 ; // tightly packed ADC samples
579576 unsigned int tmp = 0 ;
580577 unsigned int tmpIn = nSamples;
581578 ZSstreamOut (adcValues.data (), tmpIn, pagePtr, tmp, encodeBits);
582579 } else {
583- tbHdr->numWordsPayload = (nSamples + 2 * SAMPLESPER64BIT - 1 ) / (2 * SAMPLESPER64BIT );
580+ tbHdr->numWordsPayload = (nSamples + 2 * TPCZSHDRV2 :: SAMPLESPER64BIT - 1 ) / (2 * TPCZSHDRV2 :: SAMPLESPER64BIT );
584581 unsigned long * payloadPtr = (unsigned long *)pagePtr;
585582 for (unsigned int i = 0 ; i < 2 * tbHdr->numWordsPayload ; i++) {
586583 payloadPtr[i] = 0 ;
587584 }
588585 for (unsigned int i = 0 ; i < nSamples; i++) {
589- payloadPtr[i / SAMPLESPER64BIT ] |= ((unsigned long )adcValues[i]) << ((i % SAMPLESPER64BIT ) * TPCZSHDRV2 ::TPC_ZS_NBITS_V3 );
586+ payloadPtr[i / TPCZSHDRV2 :: SAMPLESPER64BIT ] |= ((unsigned long )adcValues[i]) << ((i % TPCZSHDRV2 :: SAMPLESPER64BIT ) * TPCZSHDRV2 ::TPC_ZS_NBITS_V3 );
590587 }
591588 }
592589 pagePtr += tbHdr->numWordsPayload * 16 ;
@@ -670,7 +667,7 @@ void zsEncoderImprovedLinkBased::decodePage(std::vector<o2::tpc::Digit>& outputB
670667 const auto & bitmask = tbHdr->getChannelBits ();
671668 int nADC = bitmask.count ();
672669 std::vector<unsigned short > decBuffer (nADC);
673- if (TIGHTLY_PACKED ) {
670+ if (TPCZSHDRV2 :: TIGHTLY_PACKED_V3 ) {
674671 unsigned int byte = 0 , bits = 0 , posXbits = 0 ;
675672 while (posXbits < nADC) {
676673 byte |= *(adcData++) << bits;
@@ -684,7 +681,7 @@ void zsEncoderImprovedLinkBased::decodePage(std::vector<o2::tpc::Digit>& outputB
684681 } else {
685682 const unsigned long * adcData64 = (const unsigned long *)adcData;
686683 for (int j = 0 ; j < nADC; j++) {
687- decBuffer[j] = (adcData64[j / SAMPLESPER64BIT ] >> ((j % SAMPLESPER64BIT ) * TPCZSHDRV2 ::TPC_ZS_NBITS_V3 )) & mask;
684+ decBuffer[j] = (adcData64[j / TPCZSHDRV2 :: SAMPLESPER64BIT ] >> ((j % TPCZSHDRV2 :: SAMPLESPER64BIT ) * TPCZSHDRV2 ::TPC_ZS_NBITS_V3 )) & mask;
688685 }
689686 }
690687 for (int j = 0 , k = 0 ; j < bitmask.size (); j++) {
0 commit comments