Skip to content

Commit 736eb5b

Browse files
committed
Override bad covariance instead of throwing exception
1 parent aa4898e commit 736eb5b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Common/DCAFitter/include/DCAFitter/DCAFitterN.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,20 @@ struct TrackCovI {
4141
// (otherwise for quazi-collinear tracks the X will not be constrained)
4242
float cyy = trc.getSigmaY2(), czz = trc.getSigmaZ2(), cyz = trc.getSigmaZY(), cxx = cyy * xerrFactor;
4343
float detYZ = cyy * czz - cyz * cyz;
44-
if (detYZ > 0.) {
45-
auto detYZI = 1. / detYZ;
46-
sxx = 1. / cxx;
47-
syy = czz * detYZI;
48-
syz = -cyz * detYZI;
49-
szz = cyy * detYZI;
50-
} else {
44+
if (detYZ <= 0.) {
5145
#ifndef GPUCA_GPUCODE
52-
throw std::runtime_error("invalid track covariance");
46+
printf("overriding invalid track covariance from %s\n", trc.asString().c_str());
5347
#else
54-
printf("invalid track covariance\n");
48+
printf("overriding invalid track covariance cyy:%e czz:%e cyz:%e\n", cyy, czz, cyz);
5549
#endif
50+
cyz = o2::gpu::GPUCommonMath::Sqrt(cyy * czz) * (cyz > 0 ? 0.98f : -0.98f);
51+
detYZ = cyy * czz - cyz * cyz;
5652
}
53+
auto detYZI = 1. / detYZ;
54+
sxx = 1. / cxx;
55+
syy = czz * detYZI;
56+
syz = -cyz * detYZI;
57+
szz = cyy * detYZI;
5758
}
5859
};
5960

0 commit comments

Comments
 (0)