Skip to content

Commit 6f4f0ae

Browse files
committed
GPU TPC: Fix handling of ce-crossing looping tracks
1 parent fa6e238 commit 6f4f0ae

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,21 @@ GPUd() void GPUTPCGMMerger::MergeCE(int32_t nBlocks, int32_t nThreads, int32_t i
13611361
GPUCommonAlgorithm::swap(trk[0], trk[1]);
13621362
}
13631363

1364+
if (Param().par.continuousTracking) {
1365+
GPUTPCGMMergedTrackHit* clsmax;
1366+
const float tmax = CAMath::MaxWithRef(cls[mClusters[trk[0]->FirstClusterRef()].num].getTime(), cls[mClusters[trk[0]->FirstClusterRef() + trk[0]->NClusters() - 1].num].getTime(),
1367+
cls[mClusters[trk[1]->FirstClusterRef()].num].getTime(), cls[mClusters[trk[1]->FirstClusterRef() + trk[1]->NClusters() - 1].num].getTime(),
1368+
&mClusters[trk[0]->FirstClusterRef()], &mClusters[trk[0]->FirstClusterRef() + trk[0]->NClusters() - 1],
1369+
&mClusters[trk[1]->FirstClusterRef()], &mClusters[trk[1]->FirstClusterRef() + trk[1]->NClusters() - 1], clsmax);
1370+
const float offset = CAMath::Max(tmax - mConstantMem->calibObjects.fastTransformHelper->getCorrMap()->getMaxDriftTime(clsmax->sector, clsmax->row, cls[clsmax->num].getPad()), 0.f);
1371+
trk[1]->Param().Z() += mConstantMem->calibObjects.fastTransformHelper->getCorrMap()->convDeltaTimeToDeltaZinTimeFrame(trk[1]->CSide() * NSECTORS / 2, trk[1]->Param().TOffset() - offset);
1372+
trk[1]->Param().TOffset() = offset;
1373+
if (celooper) {
1374+
trk[0]->Param().Z() += mConstantMem->calibObjects.fastTransformHelper->getCorrMap()->convDeltaTimeToDeltaZinTimeFrame(trk[0]->CSide() * NSECTORS / 2, trk[0]->Param().TOffset() - offset);
1375+
trk[0]->Param().TOffset() = offset;
1376+
}
1377+
}
1378+
13641379
if (celooper) { // TODO: Need propper handling, avoid falsely flagging the primary leg as looper
13651380
trk[0]->SetMergedLooperConnected(true);
13661381
trk[0]->SetCCE(true);
@@ -1382,16 +1397,6 @@ GPUd() void GPUTPCGMMerger::MergeCE(int32_t nBlocks, int32_t nThreads, int32_t i
13821397
return;
13831398
}
13841399

1385-
if (Param().par.continuousTracking) {
1386-
GPUTPCGMMergedTrackHit* clsmax;
1387-
const float tmax = CAMath::MaxWithRef(cls[mClusters[trk[0]->FirstClusterRef()].num].getTime(), cls[mClusters[trk[0]->FirstClusterRef() + trk[0]->NClusters() - 1].num].getTime(),
1388-
cls[mClusters[trk[1]->FirstClusterRef()].num].getTime(), cls[mClusters[trk[1]->FirstClusterRef() + trk[1]->NClusters() - 1].num].getTime(),
1389-
&mClusters[trk[0]->FirstClusterRef()], &mClusters[trk[0]->FirstClusterRef() + trk[0]->NClusters() - 1],
1390-
&mClusters[trk[1]->FirstClusterRef()], &mClusters[trk[1]->FirstClusterRef() + trk[1]->NClusters() - 1], clsmax);
1391-
const float offset = CAMath::Max(tmax - mConstantMem->calibObjects.fastTransformHelper->getCorrMap()->getMaxDriftTime(clsmax->sector, clsmax->row, cls[clsmax->num].getPad()), 0.f);
1392-
trk[1]->Param().Z() += mConstantMem->calibObjects.fastTransformHelper->getCorrMap()->convDeltaTimeToDeltaZinTimeFrame(trk[1]->CSide() * NSECTORS / 2, trk[1]->Param().TOffset() - offset);
1393-
trk[1]->Param().TOffset() = offset;
1394-
}
13951400
int32_t pos = newRef;
13961401
#pragma unroll
13971402
for (int32_t k = 1; k >= 0; k--) {

0 commit comments

Comments
 (0)