Skip to content

Commit d27b83f

Browse files
wiechuladavidrohr
authored andcommitted
TPC: Adjust magic word in ILBZS meta header, update GPU decoder
* reflect the fixed ILBZS magic word in hardware * add missing cruid in GPU decoder, which is required by TPC calibration code
1 parent 41a9eab commit d27b83f

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

DataFormats/Detectors/TPC/include/DataFormatsTPC/ZeroSuppressionLinkBased.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ static constexpr uint32_t ChannelPerTBHeader = 80;
3636
/// common header definition of the zero suppressed link based data
3737
struct CommonHeader {
3838
static constexpr uint32_t MagicWordLinkZS = 0xFC;
39-
// static constexpr uint32_t MagicWordLinkZSMetaHeader = 0xFD;
40-
static constexpr uint32_t MagicWordLinkZSMetaHeader = 0xDF;
39+
static constexpr uint32_t MagicWordLinkZSMetaHeader = 0xFD;
4140
static constexpr uint32_t MagicWordTrigger = 0xAA;
4241
static constexpr uint32_t MagicWordTriggerV2 = 0xAB;
4342

Detectors/TPC/reconstruction/src/RawProcessingHelpers.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ bool raw_processing_helpers::processZSdata(const char* data, size_t size, rdh_ut
4141
static std::array<uint32_t, 360 * 24> syncOffsetLinks;
4242

4343
const uint32_t maxBunches = (uint32_t)o2::constants::lhc::LHCMaxBunches;
44-
int globalBCOffset = int(orbit - referenceOrbit) * o2::constants::lhc::LHCMaxBunches;
44+
const int globalBCOffset = int(orbit - referenceOrbit) * o2::constants::lhc::LHCMaxBunches;
4545
static int triggerBCOffset = 0;
4646

4747
bool hasData{false};

GPU/GPUTracking/Base/GPUReconstructionConvert.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
446446
for (int n = 0; n < nSeqRead; n++) {
447447
const int decSeqLen = rowData[(n + 1) * 2] - (n ? rowData[n * 2] : 0);
448448
for (int o = 0; o < decSeqLen; o++) {
449-
outputBuffer.emplace_back(o2::tpc::Digit{0, decBuffer[posXbits++] * decodeBitsFactor, (tpccf::Row)(rowOffset + m), (tpccf::Pad)(rowData[n * 2 + 1] + o), timeBin + l});
449+
outputBuffer.emplace_back(o2::tpc::Digit{cruid, decBuffer[posXbits++] * decodeBitsFactor, (tpccf::Row)(rowOffset + m), (tpccf::Pad)(rowData[n * 2 + 1] + o), timeBin + l});
450450
}
451451
}
452452
rowPos++;
@@ -664,7 +664,7 @@ void zsEncoderImprovedLinkBased::decodePage(std::vector<o2::tpc::Digit>& outputB
664664
o2::tpc::CRU cru = cruid % 10;
665665
const int feeLink = tbHdr->fecInPartition - (decEndpoint & 1) * ((mapper.getPartitionInfo(cru.partition()).getNumberOfFECs() + 1) / 2);
666666
auto fillADC = [&outputBuffer](int cru, int rowInSector, int padInRow, int timeBin, float adcValue) {
667-
outputBuffer.emplace_back(o2::tpc::Digit{0, adcValue, rowInSector, padInRow, timeBin});
667+
outputBuffer.emplace_back(o2::tpc::Digit{cruid, adcValue, rowInSector, padInRow, timeBin});
668668
return true;
669669
};
670670
size_t size = sizeof(*tbHdr) + tbHdr->numWordsPayload * 16;
@@ -701,7 +701,7 @@ void zsEncoderImprovedLinkBased::decodePage(std::vector<o2::tpc::Digit>& outputB
701701
mapper.getSampaAndChannelOnFEC(cruid, j, sampaOnFEC, channelOnSAMPA);
702702
const auto padSecPos = mapper.padSecPos(cruid, tbHdr->fecInPartition, sampaOnFEC, channelOnSAMPA);
703703
const auto& padPos = padSecPos.getPadPos();
704-
outputBuffer.emplace_back(o2::tpc::Digit{0, decBuffer[k++] * decodeBitsFactor, (tpccf::Row)padPos.getRow(), (tpccf::Pad)padPos.getPad(), timeBin});
704+
outputBuffer.emplace_back(o2::tpc::Digit{cruid, decBuffer[k++] * decodeBitsFactor, (tpccf::Row)padPos.getRow(), (tpccf::Pad)padPos.getPad(), timeBin});
705705
}
706706
}
707707
#endif
@@ -878,7 +878,7 @@ void zsEncoderDenseLinkBased::decodePage(std::vector<o2::tpc::Digit>& outputBuff
878878
mapper.getSampaAndChannelOnFEC(cruid, j, sampaOnFEC, channelOnSAMPA);
879879
const auto padSecPos = mapper.padSecPos(cruid, decLink, sampaOnFEC, channelOnSAMPA);
880880
const auto& padPos = padSecPos.getPadPos();
881-
outputBuffer.emplace_back(o2::tpc::Digit{0, decBuffer[k++] * decodeBitsFactor, (tpccf::Row)padPos.getRow(), (tpccf::Pad)padPos.getPad(), timeBin});
881+
outputBuffer.emplace_back(o2::tpc::Digit{cruid, decBuffer[k++] * decodeBitsFactor, (tpccf::Row)padPos.getRow(), (tpccf::Pad)padPos.getPad(), timeBin});
882882
}
883883
}
884884
}

0 commit comments

Comments
 (0)