From f3c89a550652fc8d620abc2ceb5979bcfec86496 Mon Sep 17 00:00:00 2001 From: shahoian Date: Thu, 17 Dec 2020 20:04:52 +0100 Subject: [PATCH] Tmp.fix in TrackParCov c-tor from Cartesian cov.matrix Avoid div. by 0 in case of neutral track. Math to check --- .../Reconstruction/src/TrackParametrizationWithError.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx b/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx index 6ca0d1c57f180..3afb44d38edf6 100644 --- a/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx +++ b/DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx @@ -377,9 +377,11 @@ GPUd() TrackParametrizationWithError::TrackParametrizationWithError(con double m24 = pt * (cs - this->getSnp() * sn / r), m44 = -pt * pt * (r * sn + this->getSnp() * cs); double m35 = pt, m45 = -pt * pt * this->getTgl(); // - m43 *= charge; - m44 *= charge; - m45 *= charge; + if (charge) { // RS: this is a hack, proper treatment to be implemented + m43 *= charge; + m44 *= charge; + m45 *= charge; + } // double a1 = cv[13] - cv[9] * (m23 * m44 + m43 * m24) / m23 / m43; double a2 = m23 * m24 - m23 * (m23 * m44 + m43 * m24) / m43;