Skip to content

Commit 10cd816

Browse files
committed
GPU TPC: When running cluster rejection based on interpolation, also reject during update with current cluster position
1 parent 455f7df commit 10cd816

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ GPUd() int32_t GPUTPCGMPropagator::Update(float posY, float posZ, int32_t iRow,
691691
return 0;
692692
}
693693

694-
return Update(posY, posZ, clusterState, rejectChi2 == rejectDirect, err2Y, err2Z, &param);
694+
return Update(posY, posZ, clusterState, rejectChi2 == rejectDirect || rejectChi2 == rejectInterReject, err2Y, err2Z, &param);
695695
}
696696

697697
GPUd() int32_t GPUTPCGMPropagator::InterpolateReject(const GPUParam& GPUrestrict() param, float posY, float posZ, int16_t clusterState, int8_t rejectChi2, gputpcgmmergertypes::InterpolationErrorHit* inter, float err2Y, float err2Z)
@@ -704,7 +704,7 @@ GPUd() int32_t GPUTPCGMPropagator::InterpolateReject(const GPUParam& GPUrestrict
704704
inter->errorY = mC[0];
705705
inter->errorZ = mC[2];
706706
} else if (rejectChi2 == rejectInterReject) {
707-
float chiY, chiZ;
707+
float chi2Y, chi2Z;
708708
if (mFitInProjections || mT->NDF() <= 0) {
709709
const float Iz0 = inter->posY - mP[0];
710710
const float Iz1 = inter->posZ - mP[1];
@@ -721,8 +721,8 @@ GPUd() int32_t GPUTPCGMPropagator::InterpolateReject(const GPUParam& GPUrestrict
721721
const float Jz1 = posZ - ImP1;
722722
const float Jw0 = 1.f / (ImC0 + err2Y);
723723
const float Jw2 = 1.f / (ImC2 + err2Z);
724-
chiY = Jw0 * Jz0 * Jz0;
725-
chiZ = Jw2 * Jz1 * Jz1;
724+
chi2Y = Jw0 * Jz0 * Jz0;
725+
chi2Z = Jw2 * Jz1 * Jz1;
726726
} else {
727727
const float Iz0 = inter->posY - mP[0];
728728
const float Iz1 = inter->posZ - mP[1];
@@ -751,11 +751,11 @@ GPUd() int32_t GPUTPCGMPropagator::InterpolateReject(const GPUParam& GPUrestrict
751751
Jw0 *= Jdet;
752752
const float Jw1 = ImC1 * Jdet;
753753
Jw2 *= Jdet;
754-
chiY = CAMath::Abs((Jw0 * Jz0 + Jw1 * Jz1) * Jz0);
755-
chiZ = CAMath::Abs((Jw1 * Jz0 + Jw2 * Jz1) * Jz1);
754+
chi2Y = CAMath::Abs((Jw0 * Jz0 + Jw1 * Jz1) * Jz0);
755+
chi2Z = CAMath::Abs((Jw1 * Jz0 + Jw2 * Jz1) * Jz1);
756756
}
757-
if (RejectCluster(chiY * param.rec.tpc.clusterRejectChi2TolleranceY, chiZ * param.rec.tpc.clusterRejectChi2TolleranceZ, clusterState)) { // TODO: Relative Pt resolution decreases slightly, why?
758-
return updateErrorClusterRejected;
757+
if (RejectCluster(chi2Y * param.rec.tpc.clusterRejectChi2TolleranceY, chi2Z * param.rec.tpc.clusterRejectChi2TolleranceZ, clusterState)) { // TODO: Relative Pt resolution decreases slightly, why?
758+
return updateErrorClusterRejectedInInterpolation;
759759
}
760760
}
761761
return 0;
@@ -771,13 +771,13 @@ GPUd() int32_t GPUTPCGMPropagator::Update(float posY, float posZ, int16_t cluste
771771

772772
const float z0 = posY - mP[0];
773773
const float z1 = posZ - mP[1];
774-
float w0, w1, w2, chiY, chiZ;
774+
float w0, w1, w2, chi2Y, chi2Z;
775775
if (mFitInProjections || mT->NDF() <= 0) {
776776
w0 = 1.f / (err2Y + d00);
777777
w1 = 0;
778778
w2 = 1.f / (err2Z + d11);
779-
chiY = w0 * z0 * z0;
780-
chiZ = w2 * z1 * z1;
779+
chi2Y = w0 * z0 * z0;
780+
chi2Z = w2 * z1 * z1;
781781
} else {
782782
w0 = d11 + err2Z, w1 = d10, w2 = d00 + err2Y;
783783
{ // Invert symmetric matrix
@@ -790,13 +790,13 @@ GPUd() int32_t GPUTPCGMPropagator::Update(float posY, float posZ, int16_t cluste
790790
w1 = -w1 * det;
791791
w2 = w2 * det;
792792
}
793-
chiY = CAMath::Abs((w0 * z0 + w1 * z1) * z0);
794-
chiZ = CAMath::Abs((w1 * z0 + w2 * z1) * z1);
793+
chi2Y = CAMath::Abs((w0 * z0 + w1 * z1) * z0);
794+
chi2Z = CAMath::Abs((w1 * z0 + w2 * z1) * z1);
795795
}
796-
float dChi2 = chiY + chiZ;
797-
// GPUInfo("hits %d chi2 %f, new %f %f (dy %f dz %f)", N, mChi2, chiY, chiZ, z0, z1);
798-
if (rejectChi2 == 1 && RejectCluster(chiY * param->rec.tpc.clusterRejectChi2TolleranceY, chiZ * param->rec.tpc.clusterRejectChi2TolleranceZ, clusterState)) {
799-
return updateErrorClusterRejected;
796+
float dChi2 = chi2Y + chi2Z;
797+
// GPUInfo("hits %d chi2 %f, new %f %f (dy %f dz %f)", N, mChi2, chi2Y, chi2Z, z0, z1);
798+
if (rejectChi2 && RejectCluster(chi2Y * param->rec.tpc.clusterRejectChi2TolleranceY, chi2Z * param->rec.tpc.clusterRejectChi2TolleranceZ, clusterState)) {
799+
return updateErrorClusterRejectedInUpdate;
800800
}
801801
mT->Chi2() += dChi2;
802802
mT->NDF() += 2;

GPU/GPUTracking/Merger/GPUTPCGMPropagator.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class GPUTPCGMPropagator
5252
enum UpdateRetVal {
5353
updateErrorFitFailed = -1,
5454
updateErrorClusterRejected = 2,
55-
updateErrorEdgeCluster = 3
55+
updateErrorClusterRejectedDistance = 2,
56+
updateErrorEdgeCluster = 3,
57+
updateErrorClusterRejectedInInterpolation = 4,
58+
updateErrorClusterRejectedInUpdate = 5
5659
};
5760
enum RejectChi2Mode {
5861
rejectDirect = 1,

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
305305
int32_t retVal;
306306
float threshold = 3.f + (lastUpdateX >= 0 ? (CAMath::Abs(mX - lastUpdateX) / 2) : 0.f);
307307
if (mNDF > 5 && (CAMath::Abs(yy - mP[0]) > threshold || CAMath::Abs(zz - mP[1]) > threshold)) {
308-
retVal = GPUTPCGMPropagator::updateErrorClusterRejected;
308+
retVal = GPUTPCGMPropagator::updateErrorClusterRejectedDistance;
309309
} else {
310310
int8_t rejectChi2 = attempt ? 0 : ((param.rec.tpc.mergerInterpolateErrors && CAMath::Abs(ihit - ihitMergeFirst) <= 1) ? (refit ? (GPUTPCGMPropagator::rejectInterFill + ((nWays - iWay) & 1)) : 0) : (allowModification && goodRows > 5));
311311
#if EXTRACT_RESIDUALS == 1

0 commit comments

Comments
 (0)