Skip to content

Commit f594b3f

Browse files
committed
ITS: fix zero field seeding
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 94799ff commit f594b3f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackingKernels.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ GPUdii() o2::track::TrackParCov buildTrackSeed(const Cluster& cluster1,
143143

144144
float snp, q2pt, q2pt2;
145145
if (o2::gpu::CAMath::Abs(bz) < 0.01f) {
146-
const float tgp = o2::gpu::CAMath::ATan2(y3 - y1, x3 - x1);
147-
snp = sign * tgp / o2::gpu::CAMath::Sqrt(1.f + tgp * tgp);
146+
const float dx = x3 - x1;
147+
const float dy = y3 - y1;
148+
snp = sign * dy / o2::gpu::CAMath::Hypot(dx, dy);
148149
q2pt = sign / track::kMostProbablePt;
149150
q2pt2 = 1.f;
150151
} else {

Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,8 +1278,9 @@ track::TrackParCov TrackerTraits<nLayers>::buildTrackSeed(const Cluster& cluster
12781278

12791279
float snp, q2pt, q2pt2;
12801280
if (mIsZeroField) {
1281-
const float tgp = o2::gpu::CAMath::ATan2(y3 - y1, x3 - x1);
1282-
snp = sign * tgp / o2::gpu::CAMath::Sqrt(1.f + tgp * tgp);
1281+
const float dx = x3 - x1;
1282+
const float dy = y3 - y1;
1283+
snp = sign * dy / o2::gpu::CAMath::Hypot(dx, dy);
12831284
q2pt = sign / track::kMostProbablePt;
12841285
q2pt2 = 1.f;
12851286
} else {

0 commit comments

Comments
 (0)