Skip to content

Commit ac793b5

Browse files
committed
GPU TPC: Mark clusters of rebuilt track as high incli when interpolated in NoUpdateHighIncl region
1 parent 91352ba commit ac793b5

File tree

3 files changed

+35
-13
lines changed

3 files changed

+35
-13
lines changed

GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2277,7 +2277,11 @@ GPUd() void GPUTPCGMMerger::ResolveHitWeights2(int32_t nBlocks, int32_t nThreads
22772277
}
22782278
const auto& best = candidates[candidates[0].best - 1];
22792279
const ClusterNative& GPUrestrict() cl = GetConstantMem()->ioPtrs.clustersNative->clustersLinear[best.id - 2];
2280-
outCl = {.num = best.id - 2, .sector = best.sector, .row = (uint8_t)j, .state = (uint8_t)(cl.getFlags() & GPUTPCGMMergedTrackHit::clustererAndSharedFlags)};
2280+
uint8_t flags = (uint8_t)(cl.getFlags() & GPUTPCGMMergedTrackHit::clustererAndSharedFlags);
2281+
if ((mTrackRebuildHelper[i].highInclRowLow != 255 && j <= mTrackRebuildHelper[i].highInclRowLow) || (mTrackRebuildHelper[i].highInclRowHigh != 255 && j >= mTrackRebuildHelper[i].highInclRowHigh)) {
2282+
flags |= GPUTPCGMMergedTrackHit::flagHighIncl;
2283+
}
2284+
outCl = {.num = best.id - 2, .sector = best.sector, .row = (uint8_t)j, .state = flags};
22812285
written++;
22822286
CADEBUG(printf("REBUILD: iTrk %d Assigned Cluster Row %d Hit %d\n", i, j, best.id - 2));
22832287
}

GPU/GPUTracking/Merger/GPUTPCGMMerger.h

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

8989
struct trackRebuildHelper {
90-
bool reverse;
90+
uint8_t reverse;
91+
uint8_t highInclRowLow;
92+
uint8_t highInclRowHigh;
9193
};
9294

9395
struct tmpSort {
@@ -123,6 +125,7 @@ class GPUTPCGMMerger : public GPUProcessor
123125
GPUhdi() const GPUTPCGMMergedTrackHit* Clusters() const { return mClusters; }
124126
GPUhdi() GPUTPCGMMergedTrackHit* Clusters() { return mClusters; }
125127
GPUhdi() trackCluster* ClusterCandidates() { return mClusterCandidates; }
128+
GPUhdi() trackRebuildHelper* TrackRebuildHelper() { return mTrackRebuildHelper; }
126129
GPUhdi() int32_t* HitWeights() { return mHitWeights; }
127130
GPUhdi() GPUAtomic(uint32_t) * ClusterAttachment() const { return mClusterAttachment; }
128131
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
@@ -65,6 +65,10 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
6565
for (uint32_t i = 0; i < interpolation.size; i++) { // TODO: Tune the zeroing size
6666
interpolation.hit[i].errorY = -1;
6767
}
68+
if (param.rec.tpc.rebuildTrackInFit) {
69+
merger.TrackRebuildHelper()[iTrk].highInclRowLow = 255;
70+
merger.TrackRebuildHelper()[iTrk].highInclRowHigh = 255;
71+
}
6872
}
6973

7074
const int32_t nWays = param.rec.tpc.nWays;
@@ -207,6 +211,28 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
207211
continue;
208212
}
209213

214+
const float maxSinForUpdate = CAMath::Sin(70.f * CAMath::Deg2Rad());
215+
if (mNDF > 0 && CAMath::Abs(prop.GetSinPhi0()) >= maxSinForUpdate) {
216+
MarkClusters(clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
217+
nMissed2++;
218+
CADEBUG(printf(" --- break-sinphi\n"));
219+
NTolerated++;
220+
const bool inward = clusters[0].row > clusters[maxN - 1].row;
221+
const bool markHighIncl = (mP[2] > 0) ^ (mP[4] < 0) ^ inward ^ (iWay & 1);
222+
if (param.rec.tpc.rebuildTrackInFit && markHighIncl) {
223+
if (inward ^ (iWay & 1)) {
224+
if (merger.TrackRebuildHelper()[iTrk].highInclRowLow == 255) {
225+
merger.TrackRebuildHelper()[iTrk].highInclRowLow = cluster.row;
226+
}
227+
} else {
228+
if (merger.TrackRebuildHelper()[iTrk].highInclRowHigh == 255) {
229+
merger.TrackRebuildHelper()[iTrk].highInclRowHigh = cluster.row;
230+
}
231+
}
232+
}
233+
continue;
234+
}
235+
210236
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);
211237
if (retValHit == 0) {
212238
DodEdx(dEdx, dEdxAlt, merger, finalFit, ihit, ihitMergeFirst, wayDirection, clusters, clusterState, zz, dEdxSubThresholdRow);
@@ -216,9 +242,6 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, int32_
216242
covYYUpd = mC[0];
217243
} else if (retValHit == 1) {
218244
break;
219-
} else if (retValHit == 2) {
220-
NTolerated++;
221-
continue;
222245
}
223246

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

315-
const float maxSinForUpdate = CAMath::Sin(70.f * CAMath::Deg2Rad());
316-
if (mNDF > 0 && CAMath::Abs(prop.GetSinPhi0()) >= maxSinForUpdate) {
317-
MarkClusters(clusters, ihitMergeFirst, ihit, wayDirection, GPUTPCGMMergedTrackHit::flagHighIncl);
318-
nMissed2++;
319-
CADEBUG(printf(" --- break-sinphi\n"));
320-
return 2; // Propagate failed or high incl angle
321-
}
322-
323338
int32_t retValUpd = 0, retValInt = 0;
324339
float threshold = 3.f + (lastUpdateX >= 0 ? (CAMath::Abs(mX - lastUpdateX) / 2) : 0.f);
325340
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)