Skip to content

Commit f85b892

Browse files
committed
GPU: Consistently use "< 0" to avoid the corner case "== 0"
1 parent bebfcea commit f85b892

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ GPUd() int GPUTPCGMPropagator::RotateToAlpha(float newAlpha)
121121
CAMath::SinCos(newAlpha, newSinAlpha, newCosAlpha);
122122

123123
float cc = newCosAlpha * mCosAlpha + newSinAlpha * mSinAlpha; // cos(newAlpha - mAlpha);
124-
float ss = newSinAlpha * mCosAlpha - newCosAlpha * mSinAlpha; //sin(newAlpha - mAlpha);
124+
float ss = newSinAlpha * mCosAlpha - newCosAlpha * mSinAlpha; // sin(newAlpha - mAlpha);
125125

126126
GPUTPCGMPhysicalTrackModel t0 = mT0;
127127

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ GPUdic(0, 1) int GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUrestr
661661
}
662662
bool up = (mP[2] < 0) ^ right;
663663
int targetRow = up ? (GPUCA_ROW_COUNT - 1) : 0;
664-
float lrFactor = mP[2] > 0 ? 1.f : -1.f; // right ^ down
664+
float lrFactor = mP[2] < 0 ? -1.f : 1.f; // !(right ^ down) // TODO: shouldn't it be "right ? 1.f : -1.f", but that gives worse results...
665665
// clang-format off
666666
CADEBUG(printf("CIRCLE Track %d: Slice %d Alpha %f X %f Y %f Z %f SinPhi %f DzDs %f - Next hit: Slice %d Alpha %f X %f Y %f - Right %d Up %d dAlpha %f lrFactor %f\n", iTrack, slice, prop.GetAlpha(), mX, mP[0], mP[1], mP[2], mP[3], toSlice, toAlpha, toX, toY, (int)right, (int)up, dAlpha, lrFactor));
667667
// clang-format on
@@ -680,8 +680,7 @@ GPUdic(0, 1) int GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUrestr
680680
return 1;
681681
}
682682
CADEBUG(printf("Propagated to y = %f: X %f Z %f SinPhi %f\n", mX, mP[0], mP[1], mP[2]));
683-
int found = 0;
684-
for (int j = 0; j < GPUCA_ROW_COUNT && found < 3; j++) {
683+
for (int j = 0; j < GPUCA_ROW_COUNT; j++) {
685684
float rowX = Merger->Param().tpcGeometry.Row2X(j);
686685
if (CAMath::Abs(rowX - (-mP[0] * lrFactor)) < 1.5f) {
687686
CADEBUG(printf("Attempt row %d (Y %f Z %f)\n", j, mX * lrFactor, mP[1]));

0 commit comments

Comments
 (0)