Skip to content

Commit

Permalink
GPU: Fix incorrect sign of b field in GetPropagatedXYZ, and treat neg…
Browse files Browse the repository at this point in the history
…ative cosPhi correctly
  • Loading branch information
davidrohr committed Feb 15, 2023
1 parent bd597e8 commit 976334a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,17 @@ GPUd() int GPUTPCGMPropagator::GetPropagatedYZ(float x, float& GPUrestrict() pro
float bz = GetBz(mT->X(), mT->Y(), mT->Z());
float k = mT0.QPt() * bz;
float dx = x - mT->X();
float kdx = k * dx;
float ex = mT0.CosPhi();
float ey = mT0.SinPhi();
float ey1 = kdx + ey;
float ey1 = ey - k * dx;
if (CAMath::Abs(ey1) > GPUCA_MAX_SIN_PHI) {
return 1;
}
float ss = ey + ey1;
float ex1 = CAMath::Sqrt(1.f - ey1 * ey1);
if (ex < 0) {
ex1 = -ex1;
}
float cc = ex + ex1;
float dxcci = dx / cc;
float dy = dxcci * ss;
Expand Down
9 changes: 7 additions & 2 deletions GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -806,15 +806,20 @@ GPUd() int MEM_LG(GPUTPCTrackParam)::GetPropagatedYZ(float bz, float x, float& p
{
float k = mParam.mP[4] * bz;
float dx = x - mParam.mX;
float kdx = k * dx;
float ey = mParam.mP[2];
float ex = CAMath::Sqrt(1 - ey * ey);
float ey1 = kdx + ey;
if (SignCosPhi() < 0) {
ex = -ex;
}
float ey1 = ey - k * dx;
if (CAMath::Abs(ey1) > GPUCA_MAX_SIN_PHI) {
return 0;
}
float ss = ey + ey1;
float ex1 = CAMath::Sqrt(1.f - ey1 * ey1);
if (SignCosPhi() < 0) {
ex1 = -ex1;
}
float cc = ex + ex1;
float dxcci = dx / cc;
float dy = dxcci * ss;
Expand Down

0 comments on commit 976334a

Please sign in to comment.