Skip to content

Commit 298b520

Browse files
authored
improve precision in jacobianCurvilinearToCartesian
1 parent 9bf2572 commit 298b520

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

DataFormats/GeometryVector/src/TrackingJacobians.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ 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);
43-
39+
double sinlambda = pvec.z()/p, coslambda = pt/p;
40+
double sinphi = pvec.y()/pt, cosphi = pvec.x()/pt;
41+
4442
theJacobian(1, 3) = 1.;
4543
theJacobian(2, 4) = 1.;
4644
theJacobian(3, 0) = -q * p2 * coslambda * cosphi;

0 commit comments

Comments
 (0)