From 298b52050a1a2ef4606d0b7b74a95376f5d2f457 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Sat, 12 Jun 2021 19:28:26 -0700 Subject: [PATCH 1/2] improve precision in jacobianCurvilinearToCartesian --- DataFormats/GeometryVector/src/TrackingJacobians.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/DataFormats/GeometryVector/src/TrackingJacobians.cc b/DataFormats/GeometryVector/src/TrackingJacobians.cc index 9f3c1ba311219..9e4a1ecce557e 100644 --- a/DataFormats/GeometryVector/src/TrackingJacobians.cc +++ b/DataFormats/GeometryVector/src/TrackingJacobians.cc @@ -36,11 +36,9 @@ AlgebraicMatrix65 jacobianCurvilinearToCartesian(const GlobalVector& momentum, i R(5, 5) = 1.; double p = pvec.mag(), p2 = p * p; - double lambda = 0.5 * M_PI - pvec.theta(); - double phi = pvec.phi(); - double sinlambda = sin(lambda), coslambda = cos(lambda); - double sinphi = sin(phi), cosphi = cos(phi); - + double sinlambda = pvec.z()/p, coslambda = pt/p; + double sinphi = pvec.y()/pt, cosphi = pvec.x()/pt; + theJacobian(1, 3) = 1.; theJacobian(2, 4) = 1.; theJacobian(3, 0) = -q * p2 * coslambda * cosphi; From 17b12feda445182c079f5f1e2f7919fb8453c677 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Sat, 12 Jun 2021 20:51:05 -0700 Subject: [PATCH 2/2] code format --- DataFormats/GeometryVector/src/TrackingJacobians.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DataFormats/GeometryVector/src/TrackingJacobians.cc b/DataFormats/GeometryVector/src/TrackingJacobians.cc index 9e4a1ecce557e..8d93991c95d65 100644 --- a/DataFormats/GeometryVector/src/TrackingJacobians.cc +++ b/DataFormats/GeometryVector/src/TrackingJacobians.cc @@ -36,9 +36,9 @@ AlgebraicMatrix65 jacobianCurvilinearToCartesian(const GlobalVector& momentum, i R(5, 5) = 1.; double p = pvec.mag(), p2 = p * p; - double sinlambda = pvec.z()/p, coslambda = pt/p; - double sinphi = pvec.y()/pt, cosphi = pvec.x()/pt; - + double sinlambda = pvec.z() / p, coslambda = pt / p; + double sinphi = pvec.y() / pt, cosphi = pvec.x() / pt; + theJacobian(1, 3) = 1.; theJacobian(2, 4) = 1.; theJacobian(3, 0) = -q * p2 * coslambda * cosphi;