Skip to content

Commit 3cfe754

Browse files
authored
Merge pull request cms-sw#34103 from slava77/patch-94
improve precision in jacobianCurvilinearToCartesian
2 parents c362a61 + 17b12fe commit 3cfe754

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

DataFormats/GeometryVector/src/TrackingJacobians.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ AlgebraicMatrix65 jacobianCurvilinearToCartesian(const GlobalVector& momentum, i
3636
R(5, 5) = 1.;
3737

3838
double p = pvec.mag(), p2 = p * p;
39-
double lambda = 0.5 * M_PI - pvec.theta();
40-
double phi = pvec.phi();
41-
double sinlambda = sin(lambda), coslambda = cos(lambda);
42-
double sinphi = sin(phi), cosphi = cos(phi);
39+
double sinlambda = pvec.z() / p, coslambda = pt / p;
40+
double sinphi = pvec.y() / pt, cosphi = pvec.x() / pt;
4341

4442
theJacobian(1, 3) = 1.;
4543
theJacobian(2, 4) = 1.;

0 commit comments

Comments
 (0)