Skip to content

Commit 1887b72

Browse files
committed
GPU TPC: Mark clusters of rebuilt track as high incli when interpolated in NoUpdateHighIncl region
1 parent fa0a4a6 commit 1887b72

3 files changed

Lines changed: 35 additions & 13 deletions

File tree

GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,11 @@ GPUd() void GPUTPCGMMerger::ResolveHitWeights2(int32_t nBlocks, int32_t nThreads
22662266
}
22672267
const auto& best = candidates[candidates[0].best - 1];
22682268
const ClusterNative& GPUrestrict() cl = GetConstantMem()->ioPtrs.clustersNative->clustersLinear[best.id - 2];
2269-
outCl = {.num = best.id - 2, .sector = best.sector, .row = (uint8_t)j, .state = (uint8_t)(cl.getFlags() & GPUTPCGMMergedTrackHit::clustererAndSharedFlags)};
2269+
uint8_t flags = (uint8_t)(cl.getFlags() & GPUTPCGMMergedTrackHit::clustererAndSharedFlags);
2270+
if ((mTrackRebuildHelper[i].highInclRowLow != 255 && j <= mTrackRebuildHelper[i].highInclRowLow) || (mTrackRebuildHelper[i].highInclRowHigh != 255 && j >= mTrackRebuildHelper[i].highInclRowHigh)) {
2271+
flags |= GPUTPCGMMergedTrackHit::flagHighIncl;
2272+
}
2273+
outCl = {.num = best.id - 2, .sector = best.sector, .row = (uint8_t)j, .state = flags};
22702274
written++;
22712275
CADEBUG(printf("REBUILD: iTrk %d Assigned Cluster Row %d Hit %d\n", i, j, best.id - 2));
22722276
}

GPU/GPUTracking/Merger/GPUTPCGMMerger.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ class GPUTPCGMMerger : public GPUProcessor
8888
};
8989

9090
struct trackRebuildHelper {
91-
bool reverse;
91+
uint8_t reverse;
92+
uint8_t highInclRowLow;
93+
uint8_t highInclRowHigh;
9294
};
9395

9496
struct tmpSort {
@@ -133,6 +135,7 @@ class GPUTPCGMMerger : public GPUProcessor
133135
GPUhdi() const GPUTPCGMMergedTrackHit* Clusters() const { return mClusters; }
134136
GPUhdi() GPUTPCGMMergedTrackHit* Clusters() { return mClusters; }
135137
GPUhdi() trackCluster* ClusterCandidates() { return mClusterCandidates; }
138+
GPUhdi() trackRebuildHelper* TrackRebuildHelper() { return mTrackRebuildHelper; }
136139
GPUhdi() int32_t* HitWeights() { return mHitWeights; }
137140
GPUhdi() GPUAtomic(uint32_t) * ClusterAttachment() const { return mClusterAttachment; }
138141
GPUhdi() uint32_t* TrackOrderAttach() const { return mTrackOrderAttach; }

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
6464
for (uint32_t i = 0; i < interpolation.size; i++) { // TODO: Tune the zeroing size
6565
interpolation.hit[i].errorY = -1;
6666
}
67+
if (param.rec.tpc.rebuildTrackInFit) {
68+
merger.TrackRebuildHelper()[iTrk].highInclRowLow = 255;
69+
merger.TrackRebuildHelper()[iTrk].highInclRowHigh = 255;
70+
}
6771
}
6872

6973
const int32_t nWays = param.rec.tpc.nWays;
@@ -206,6 +210,28 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
206210
continue;
207211
}
208212

213+
const float maxSinForUpdate = CAMath::Sin(70.f * CAMath::Deg2Rad());
214+
if (mNDF > 0 && CAMath::Abs(prop.GetSinPhi0()) >= maxSinForUpdate) {
215+
MarkClusters(clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
216+
nMissed2++;
217+
CADEBUG(printf(" --- break-sinphi\n"));
218+
NTolerated++;
219+
const bool inward = clusters[0].row > clusters[maxN - 1].row;
220+
const bool markHighIncl = (mP[2] > 0) ^ (mP[4] < 0) ^ inward ^ (iWay & 1);
221+
if (param.rec.tpc.rebuildTrackInFit && markHighIncl) {
222+
if (inward ^ (iWay & 1)) {
223+
if (merger.TrackRebuildHelper()[iTrk].highInclRowLow == 255) {
224+
merger.TrackRebuildHelper()[iTrk].highInclRowLow = cluster.row;
225+
}
226+
} else {
227+
if (merger.TrackRebuildHelper()[iTrk].highInclRowHigh == 255) {
228+
merger.TrackRebuildHelper()[iTrk].highInclRowHigh = cluster.row;
229+
}
230+
}
231+
}
232+
continue;
233+
}
234+
209235
int32_t retValHit = FitHit(merger, iTrk, track, xx, yy, zz, clusterState, clAlpha, iWay, inFlyDirection, deltaZ, lastUpdateX, clusters, prop, inter, dEdx, dEdxAlt, sumInvSqrtCharge, nAvgCharge, ihit, ihitMergeFirst, allowChangeClusters, refit, finalFit, nMissed, nMissed2, resetT0, uncorrectedY);
210236
if (retValHit == 0) {
211237
DodEdx(dEdx, dEdxAlt, merger, finalFit, ihit, ihitMergeFirst, wayDirection, clusters, clusterState, zz, dEdxSubThresholdRow);
@@ -215,9 +241,6 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
215241
covYYUpd = mC[0];
216242
} else if (retValHit == 1) {
217243
break;
218-
} else if (retValHit == 2) {
219-
NTolerated++;
220-
continue;
221244
}
222245

223246
lastUpdateRow = cluster.row;
@@ -311,14 +334,6 @@ GPUdii() int32_t GPUTPCGMTrackParam::FitHit(GPUTPCGMMerger& GPUrestrict() merger
311334
const int32_t wayDirection = (iWay & 1) ? -1 : 1;
312335
const auto& cluster = clusters[ihit];
313336

314-
const float maxSinForUpdate = CAMath::Sin(70.f * CAMath::Deg2Rad());
315-
if (mNDF > 0 && CAMath::Abs(prop.GetSinPhi0()) >= maxSinForUpdate) {
316-
MarkClusters(clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
317-
nMissed2++;
318-
CADEBUG(printf(" --- break-sinphi\n"));
319-
return 2; // Propagate failed or high incl angle
320-
}
321-
322337
int32_t retValUpd = 0, retValInt = 0;
323338
float threshold = 3.f + (lastUpdateX >= 0 ? (CAMath::Abs(mX - lastUpdateX) / 2) : 0.f);
324339
if (mNDF > (int32_t)param.rec.tpc.mergerNonInterpolateRejectMinNDF && (CAMath::Abs(yy - mP[0]) > threshold || CAMath::Abs(zz - mP[1]) > threshold)) {

0 commit comments

Comments
 (0)