Skip to content

Commit f094c9f

Browse files
committed
GPU TPC: Do not interpolate with too few NDF
1 parent cf38ef2 commit f094c9f

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

GPU/Common/GPUCommonMath.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ class GPUCommonMath
7474
GPUhdni() constexpr static float Sqrt(float x);
7575
GPUd() static float InvSqrt(float x);
7676
template <class T>
77+
GPUdi() constexpr static T Square(T x)
78+
{
79+
return x * x;
80+
}
81+
template <class T>
7782
GPUhd() constexpr static T Abs(T x);
7883
GPUd() constexpr static float ASin(float x);
7984
GPUd() constexpr static float ACos(float x);

GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,18 @@ GPUd() int32_t GPUTPCGMPropagator::InterpolateReject(const GPUParam& GPUrestrict
653653
if (rejectChi2 == rejectInterFill) {
654654
inter->posY = mP[0];
655655
inter->posZ = mP[1];
656-
inter->errorY = mC[0];
657-
inter->errorZ = mC[2];
656+
if (mT->NDF() <= 0) {
657+
inter->errorY = inter->errorZ = 100.f;
658+
} else {
659+
inter->errorY = mC[0];
660+
inter->errorZ = mC[2];
661+
}
658662
} else if (rejectChi2 == rejectInterReject) {
659663
float chi2Y, chi2Z;
660-
if (mFitInProjections || mT->NDF() <= 0) {
664+
if (mT->NDF() <= 0) {
665+
chi2Y = CAMath::Square((float)inter->posY - posY) / ((float)inter->errorY + err2Y);
666+
chi2Z = CAMath::Square((float)inter->posZ - posZ) / ((float)inter->errorZ + err2Z);
667+
} else if (mFitInProjections) {
661668
const float Iz0 = inter->posY - mP[0];
662669
const float Iz1 = inter->posZ - mP[1];
663670
const float Iw0 = 1.f / (mC[0] + (float)inter->errorY);

0 commit comments

Comments
 (0)