@@ -536,43 +536,41 @@ void TrackParCovFwd::propagateToDCAhelix(double zField, const std::array<double,
536536 int iter = 0 ;
537537
538538 while (iter++ < max_iter) {
539- double theta = (z0 - z) * invqRtanl;
540- double phi_theta = phi0 + Hz * theta;
541- double sin_phi_theta = sin (phi_theta);
542- double cos_phi_theta = cos (phi_theta);
543-
544- double DX = x0 - Hz * qR * (sin_phi_theta - sinp) - xPV;
545- double DY = y0 + Hz * qR * (cos_phi_theta - cosp) - yPV;
546- double DZ = z - zPV;
547-
548- double dD2_dZ =
549- 2 * DX * cos_phi_theta * invtanl +
550- 2 * DY * sin_phi_theta * invtanl +
551- 2 * DZ;
552-
553- double d2D2_dZ2 =
554- 2 * invtanl * invtanl +
555- 2 * invtanl * (DX * Hz * sin_phi_theta - DY * Hz * cos_phi_theta) * invqRtanl +
556- 2 ;
557-
558- double z_new = z - dD2_dZ / d2D2_dZ2;
559-
560- if (std::abs (z_new - z) < tol) {
561- z = z_new;
562- this ->propagateToZhelix (z, zField);
563- dca[0 ] = this ->getX () - xPV;
564- dca[1 ] = this ->getY () - yPV;
565- dca[2 ] = this ->getZ () - zPV;
566- LOG (debug) << " Converged after " << iter << " iterations for vertex X=" << p[0 ] << " , Y=" << p[1 ] << " , Z = " << p[2 ];
567- return ;
568- }
569- z = z_new;
539+ double theta = (z0 - z) * invqRtanl;
540+ double phi_theta = phi0 + Hz * theta;
541+ double sin_phi_theta = sin (phi_theta);
542+ double cos_phi_theta = cos (phi_theta);
543+
544+ double DX = x0 - Hz * qR * (sin_phi_theta - sinp) - xPV;
545+ double DY = y0 + Hz * qR * (cos_phi_theta - cosp) - yPV;
546+ double DZ = z - zPV;
547+
548+ double dD2_dZ =
549+ 2 * DX * cos_phi_theta * invtanl +
550+ 2 * DY * sin_phi_theta * invtanl +
551+ 2 * DZ;
552+
553+ double d2D2_dZ2 =
554+ 2 * invtanl * invtanl +
555+ 2 * invtanl * (DX * Hz * sin_phi_theta - DY * Hz * cos_phi_theta) * invqRtanl +
556+ 2 ;
557+
558+ double z_new = z - dD2_dZ / d2D2_dZ2;
559+
560+ if (std::abs (z_new - z) < tol) {
561+ z = z_new;
562+ this ->propagateToZhelix (z, zField);
563+ dca[0 ] = this ->getX () - xPV;
564+ dca[1 ] = this ->getY () - yPV;
565+ dca[2 ] = this ->getZ () - zPV;
566+ LOG (debug) << " Converged after " << iter << " iterations for vertex X=" << p[0 ] << " , Y=" << p[1 ] << " , Z = " << p[2 ];
567+ return ;
568+ }
569+ z = z_new;
570570 }
571571 LOG (debug) << " Failed to converge after " << iter << " iterations for vertex X=" << p[0 ] << " , Y=" << p[1 ] << " , Z = " << p[2 ];
572572 return ;
573-
574573}
575574
576-
577575} // namespace track
578576} // namespace o2
0 commit comments