Skip to content

Commit c4d120c

Browse files
committed
TPC Clusterization: Check ZS data format version
1 parent adcccdd commit c4d120c

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ struct TPCZSHDR {
3333
static constexpr unsigned int TPC_ZS_NBITS_V1 = 10;
3434
static constexpr unsigned int TPC_ZS_NBITS_V2 = 12;
3535

36-
unsigned char version;
36+
unsigned char version; // ZS format version:
37+
// 1: original row-based format with 10-bit ADC values
38+
// 2: original row-based format with 12-bit ADC values
39+
// 3: improved link-based format with extra META header
3740
unsigned char nTimeBins;
3841
unsigned short cruID;
3942
unsigned short timeOffset;

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ std::pair<unsigned int, unsigned int> GPUChainTracking::TPCClusterizerDecodeZSCo
130130
continue;
131131
}
132132
const TPCZSHDR* const hdr = (const TPCZSHDR*)(page + sizeof(o2::header::RAWDataHeader));
133+
mCFContext->zsVersion = hdr->version;
133134
nDigits += hdr->nADCsamples;
134135
unsigned int timeBin = (hdr->timeOffset + (o2::raw::RDHUtils::getHeartBeatOrbit(*rdh) - firstHBF) * o2::constants::lhc::LHCMaxBunches) / LHCBCPERTIMEBIN;
135136
if (timeBin + hdr->nTimeBins > mCFContext->tpcMaxTimeBin) {
@@ -524,7 +525,11 @@ int GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
524525

525526
if (mIOPtrs.tpcZS) {
526527
int firstHBF = (mIOPtrs.settingsTF && mIOPtrs.settingsTF->hasTfStartOrbit) ? mIOPtrs.settingsTF->tfStartOrbit : (mIOPtrs.tpcZS->slice[iSlice].count[0] && mIOPtrs.tpcZS->slice[iSlice].nZSPtr[0][0]) ? o2::raw::RDHUtils::getHeartBeatOrbit(*(const o2::header::RAWDataHeader*)mIOPtrs.tpcZS->slice[iSlice].zsPtr[0][0]) : 0;
527-
runKernel<GPUTPCCFDecodeZS, GPUTPCCFDecodeZS::decodeZS>(GetGridBlk(doGPU ? clusterer.mPmemory->counters.nPagesSubslice : GPUTrackingInOutZS::NENDPOINTS, lane), {iSlice}, {}, firstHBF);
528+
if (mCFContext->zsVersion >= 1 || mCFContext->zsVersion <= 2) {
529+
runKernel<GPUTPCCFDecodeZS, GPUTPCCFDecodeZS::decodeZS>(GetGridBlk(doGPU ? clusterer.mPmemory->counters.nPagesSubslice : GPUTrackingInOutZS::NENDPOINTS, lane), {iSlice}, {}, firstHBF);
530+
} else {
531+
GPUFatal("Data with invalid TPC ZS mode received");
532+
}
528533
TransferMemoryResourceLinkToHost(RecoStep::TPCClusterFinding, clusterer.mMemoryId, lane);
529534
}
530535
}

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChainContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct GPUTPCCFChainContext {
4141
unsigned char* zsDevice;
4242
};
4343

44+
unsigned int zsVersion;
4445
std::vector<FragmentData> fragmentData;
4546
unsigned int nPagesTotal;
4647
unsigned int nPagesSectorMax;

0 commit comments

Comments
 (0)