154 double theta = 2. * atan(exp(-
eta));
160 surfacePhi *= (
m_flatDist->shoot() > 0.5) ? -1. : 1.;
161 double startX = startR * cos(surfacePhi);
162 double startY = startR * sin(surfacePhi);
167 alphaZ *= (
m_flatDist->shoot() > 0.5) ? -1. : 1.;
200 ATH_MSG_VERBOSE(
"Cylinder to be intersected : " << estimationCylinder);
202 auto estimationParameters =
m_propagator->propagateParameters(ctx,
208 if (!estimationParameters) {
209 ATH_MSG_VERBOSE(
"Estimation of intersection did not work - skip event !");
210 return StatusCode::SUCCESS;
215 const Amg::Vector3D& estimatedPosition = estimationParameters->position();
217 double estimationX = estimatedPosition.x();
218 double estimationY = estimatedPosition.y();
219 double estimationZ = estimatedPosition.z();
221 double estimationPhi = estimatedPosition.phi();
222 double estimationTheta = estimatedPosition.theta();
227 rotateTrans *= (
m_flatDist->shoot() > 0.5) ? -1. : 1.;
233 Amg::Vector3D radialVector(estimatedPosition.x(), estimatedPosition.y(), 0.);
237 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
240 surfaceRotation.col(0) = surfaceXdirection;
241 surfaceRotation.col(1) = surfaceYdirection;
242 surfaceRotation.col(2) = surfaceZdirection;
259 std::optional<Trk::TransportJacobian> optTransportJacobian {};
261 testMatrix.setZero();
263 double pathLimit = -1.;
271 optTransportJacobian,
275 if (trackParameters && optTransportJacobian) {
276 unsigned int recStep = 0;
277 const auto& transportJacobian = (*optTransportJacobian);
283 m_loc1loc1[recStep] = (transportJacobian) (0, 0);
284 m_loc1loc2[recStep] = (transportJacobian) (0, 1);
285 m_loc1phi[recStep] = (transportJacobian) (0, 2);
287 m_loc1qop[recStep] = (transportJacobian) (0, 4);
290 m_loc2loc1[recStep] = (transportJacobian) (1, 0);
291 m_loc2loc2[recStep] = (transportJacobian) (1, 1);
292 m_loc2phi[recStep] = (transportJacobian) (1, 2);
294 m_loc2qop[recStep] = (transportJacobian) (1, 4);
297 m_philoc1[recStep] = (transportJacobian) (2, 0);
298 m_philoc2[recStep] = (transportJacobian) (2, 1);
299 m_phiphi[recStep] = (transportJacobian) (2, 2);
300 m_phitheta[recStep] = (transportJacobian) (2, 3);
301 m_phiqop[recStep] = (transportJacobian) (2, 4);
306 m_thetaphi[recStep] = (transportJacobian) (3, 2);
308 m_thetaqop[recStep] = (transportJacobian) (3, 4);
311 m_qoploc1[recStep] = (transportJacobian) (4, 0);
312 m_qoploc2[recStep] = (transportJacobian) (4, 1);
313 m_qopphi[recStep] = (transportJacobian) (4, 2);
314 m_qoptheta[recStep] = (transportJacobian) (4, 3);
315 m_qopqop[recStep] = (transportJacobian) (4, 4);
343 auto endLoc1Minus =
m_propagator->propagateParameters(ctx,
351 auto endLoc1Plus =
m_propagator->propagateParameters(ctx,
358 auto endLoc2Minus =
m_propagator->propagateParameters(ctx,
365 auto endLoc2Plus =
m_propagator->propagateParameters(ctx,
372 auto endPhiMinus =
m_propagator->propagateParameters(ctx,
379 auto endPhiPlus =
m_propagator->propagateParameters(ctx,
386 auto endThetaMinus =
m_propagator->propagateParameters(ctx,
393 auto endThetaPlus =
m_propagator->propagateParameters(ctx,
400 auto endQopMinus =
m_propagator->propagateParameters(ctx,
407 auto endQopPlus =
m_propagator->propagateParameters(ctx,
424 const Amg::VectorX& endLoc1MinusPar = endLoc1Minus->parameters();
425 const Amg::VectorX& endLoc1PlusPar = endLoc1Plus->parameters();
427 const Amg::VectorX& endLoc2MinusPar = endLoc2Minus->parameters();
428 const Amg::VectorX& endLoc2PlusPar = endLoc2Plus->parameters();
430 const Amg::VectorX& endPhiMinusPar = endPhiMinus->parameters();
431 const Amg::VectorX& endPhiPlusPar = endPhiPlus->parameters();
433 const Amg::VectorX& endThetaMinusPar = endThetaMinus->parameters();
434 const Amg::VectorX& endThetaPlusPar = endThetaPlus->parameters();
436 const Amg::VectorX& endQopMinusPar = endQopMinus->parameters();
437 const Amg::VectorX& endQopPlusPar = endQopPlus->parameters();
440 Amg::VectorX endLoc1Diff(endLoc1PlusPar - endLoc1MinusPar);
441 Amg::VectorX endLoc2Diff(endLoc2PlusPar - endLoc2MinusPar);
442 Amg::VectorX endPhiDiff(endPhiPlusPar - endPhiMinusPar);
443 Amg::VectorX endThetaDiff(endThetaPlusPar - endThetaMinusPar);
444 Amg::VectorX endQopDiff(endQopPlusPar - endQopMinusPar);
450 currentStepJacobian(0, 4) = endQopDiff[0] / (2. *
m_qOpVariations[istep]);
452 m_loc1loc1[recStep] = currentStepJacobian(0, 0);
453 m_loc1loc2[recStep] = currentStepJacobian(0, 1);
454 m_loc1phi[recStep] = currentStepJacobian(0, 2);
456 m_loc1qop[recStep] = currentStepJacobian(0, 4);
463 currentStepJacobian(1, 4) = endQopDiff[1] / (2. *
m_qOpVariations[istep]);
465 m_loc2loc1[recStep] = currentStepJacobian(1, 0);
466 m_loc2loc2[recStep] = currentStepJacobian(1, 1);
467 m_loc2phi[recStep] = currentStepJacobian(1, 2);
469 m_loc2qop[recStep] = currentStepJacobian(1, 4);
476 currentStepJacobian(2, 4) = endQopDiff[2] / (2. *
m_qOpVariations[istep]);
478 m_philoc1[recStep] = currentStepJacobian(2, 0);
479 m_philoc2[recStep] = currentStepJacobian(2, 1);
480 m_phiphi[recStep] = currentStepJacobian(2, 2);
481 m_phitheta[recStep] = currentStepJacobian(2, 3);
482 m_phiqop[recStep] = currentStepJacobian(2, 4);
489 currentStepJacobian(3, 4) = endQopDiff[3] / (2. *
m_qOpVariations[istep]);
493 m_thetaphi[recStep] = currentStepJacobian(3, 2);
495 m_thetaqop[recStep] = currentStepJacobian(3, 4);
502 currentStepJacobian(4, 4) = endQopDiff[4] / (2. *
m_qOpVariations[istep]);
504 m_qoploc1[recStep] = currentStepJacobian(4, 0);
505 m_qoploc2[recStep] = currentStepJacobian(4, 1);
506 m_qopphi[recStep] = currentStepJacobian(4, 2);
507 m_qoptheta[recStep] = currentStepJacobian(4, 3);
508 m_qopqop[recStep] = currentStepJacobian(4, 4);
511 ATH_MSG_DEBUG(
"Current TransportJacobian : " << currentStepJacobian);
612 currentStepJacobian(0, 0) =
m_loc1loc1[recStep];
613 currentStepJacobian(0, 1) =
m_loc1loc2[recStep];
614 currentStepJacobian(0, 2) =
m_loc1phi[recStep];
616 currentStepJacobian(0, 4) =
m_loc1qop[recStep];
618 currentStepJacobian(1, 0) =
m_loc2loc1[recStep];
619 currentStepJacobian(1, 1) =
m_loc2loc2[recStep];
620 currentStepJacobian(1, 2) =
m_loc2phi[recStep];
622 currentStepJacobian(1, 4) =
m_loc2qop[recStep];
624 currentStepJacobian(2, 0) =
m_philoc1[recStep];
625 currentStepJacobian(2, 1) =
m_philoc2[recStep];
626 currentStepJacobian(2, 2) =
m_phiphi[recStep];
627 currentStepJacobian(2, 3) =
m_phitheta[recStep];
628 currentStepJacobian(2, 4) =
m_phiqop[recStep];
632 currentStepJacobian(3, 2) =
m_thetaphi[recStep];
634 currentStepJacobian(3, 4) =
m_thetaqop[recStep];
636 currentStepJacobian(4, 0) =
m_qoploc1[recStep];
637 currentStepJacobian(4, 1) =
m_qoploc2[recStep];
638 currentStepJacobian(4, 2) =
m_qopphi[recStep];
639 currentStepJacobian(4, 3) =
m_qoptheta[recStep];
640 currentStepJacobian(4, 4) =
m_qopqop[recStep];
643 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian);
650 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix);
671 m_phiphi[recStep] = diffMatrix(2, 2);
673 m_phiqop[recStep] = diffMatrix(2, 4);
685 m_qopphi[recStep] = diffMatrix(4, 2);
687 m_qopqop[recStep] = diffMatrix(4, 4);
695 1e-50 ? -std::log10(std::abs(
m_loc1loc1[recStep - 1])) : 0.;
697 1e-50 ? -std::log10(std::abs(
m_loc1loc2[recStep - 1])) : 0.;
699 1e-50 ? -std::log10(std::abs(
m_loc1phi[recStep - 1])) : 0.;
704 1e-50 ? -std::log10(std::abs(
m_loc1qop[recStep - 1])) : 0.;
708 1e-50 ? -std::log10(std::abs(
m_loc2loc1[recStep - 1])) : 0.;
710 1e-50 ? -std::log10(std::abs(
m_loc2loc2[recStep - 1])) : 0.;
712 1e-50 ? -std::log10(std::abs(
m_loc2phi[recStep - 1])) : 0.;
714 1e-50 ? -std::log10(std::abs(
m_loc2theta[recStep - 1])) : 0.;
716 1e-50 ? -std::log10(std::abs(
m_loc2qop[recStep - 1])) : 0.;
720 1e-50 ? -std::log10(std::abs(
m_philoc1[recStep - 1])) : 0.;
722 1e-50 ? -std::log10(std::abs(
m_philoc2[recStep - 1])) : 0.;
724 1e-50 ? -std::log10(std::abs(
m_phiphi[recStep - 1])) : 0.;
726 1e-50 ? -std::log10(std::abs(
m_phitheta[recStep - 1])) : 0.;
728 1e-50 ? -std::log10(std::abs(
m_phiqop[recStep - 1])) : 0.;
732 1e-50 ? -std::log10(std::abs(
m_thetaloc1[recStep - 1])) : 0.;
734 1e-50 ? -std::log10(std::abs(
m_thetaloc2[recStep - 1])) : 0.;
736 1e-50 ? -std::log10(std::abs(
m_thetaphi[recStep - 1])) : 0.;
738 1e-50 ? -std::log10(std::abs(
m_thetatheta[recStep - 1])) : 0.;
740 1e-50 ? -std::log10(std::abs(
m_thetaqop[recStep - 1])) : 0.;
744 1e-50 ? -std::log10(std::abs(
m_qoploc1[recStep - 1])) : 0.;
746 1e-50 ? -std::log10(std::abs(
m_qoploc2[recStep - 1])) : 0.;
748 1e-50 ? -std::log10(std::abs(
m_qopphi[recStep - 1])) : 0.;
753 1e-50 ? -std::log10(std::abs(
m_qopqop[recStep - 1])) : 0.;
763 std::abs((transportJacobian) (0, 0)) > 1e-50 ? diffMatrix(0, 0) / ((transportJacobian) (0, 0)) : 0.;
765 std::abs((transportJacobian) (0, 1)) > 1e-50 ? diffMatrix(0, 1) / ((transportJacobian) (0, 1)) : 0.;
767 std::abs((transportJacobian) (0, 2)) > 1e-50 ? diffMatrix(0, 2) / ((transportJacobian) (0, 2)) : 0.;
769 std::abs((transportJacobian) (0, 3)) > 1e-50 ? diffMatrix(0, 3) / ((transportJacobian) (0, 3)) : 0.;
771 std::abs((transportJacobian) (0, 4)) > 1e-50 ? diffMatrix(0, 4) / ((transportJacobian) (0, 4)) : 0.;
775 std::abs((transportJacobian) (1, 0)) > 1e-50 ? diffMatrix(1, 0) / ((transportJacobian) (1, 0)) : 0.;
777 std::abs((transportJacobian) (1, 1)) > 1e-50 ? diffMatrix(1, 1) / ((transportJacobian) (1, 1)) : 0.;
779 std::abs((transportJacobian) (1, 2)) > 1e-50 ? diffMatrix(1, 2) / ((transportJacobian) (1, 2)) : 0.;
781 std::abs((transportJacobian) (1, 3)) > 1e-50 ? diffMatrix(1, 3) / ((transportJacobian) (1, 3)) : 0.;
783 std::abs((transportJacobian) (1, 4)) > 1e-50 ? diffMatrix(1, 4) / ((transportJacobian) (1, 4)) : 0.;
787 std::abs((transportJacobian) (2, 0)) > 1e-50 ? diffMatrix(2, 0) / ((transportJacobian) (2, 0)) : 0.;
789 std::abs((transportJacobian) (2, 1)) > 1e-50 ? diffMatrix(2, 1) / ((transportJacobian) (2, 1)) : 0.;
791 std::abs((transportJacobian) (2, 2)) > 1e-50 ? diffMatrix(2, 2) / ((transportJacobian) (2, 2)) : 0.;
793 std::abs((transportJacobian) (2, 3)) > 1e-50 ? diffMatrix(2, 3) / ((transportJacobian) (2, 3)) : 0.;
795 std::abs((transportJacobian) (2, 4)) > 1e-50 ? diffMatrix(2, 4) / ((transportJacobian) (2, 4)) : 0.;
799 std::abs((transportJacobian) (3, 0)) > 1e-50 ? diffMatrix(3, 0) / ((transportJacobian) (3, 0)) : 0.;
801 std::abs((transportJacobian) (3, 1)) > 1e-50 ? diffMatrix(3, 1) / ((transportJacobian) (3, 1)) : 0.;
803 std::abs((transportJacobian) (3, 2)) > 1e-50 ? diffMatrix(3, 2) / ((transportJacobian) (3, 2)) : 0.;
805 std::abs((transportJacobian) (3, 3)) > 1e-50 ? diffMatrix(3, 3) / ((transportJacobian) (3, 3)) : 0.;
807 std::abs((transportJacobian) (3, 4)) > 1e-50 ? diffMatrix(3, 4) / ((transportJacobian) (3, 4)) : 0.;
811 std::abs((transportJacobian) (4, 0)) > 1e-50 ? diffMatrix(4, 0) / ((transportJacobian) (4, 0)) : 0.;
813 std::abs((transportJacobian) (4, 1)) > 1e-50 ? diffMatrix(4, 1) / ((transportJacobian) (4, 1)) : 0.;
815 std::abs((transportJacobian) (4, 2)) > 1e-50 ? diffMatrix(4, 2) / ((transportJacobian) (4, 2)) : 0.;
817 std::abs((transportJacobian) (4, 3)) > 1e-50 ? diffMatrix(4, 3) / ((transportJacobian) (4, 3)) : 0.;
819 std::abs((transportJacobian) (4, 4)) > 1e-50 ? diffMatrix(4, 4) / ((transportJacobian) (4, 4)) : 0.;
826 1e-50 ? -std::log10(std::abs(
m_loc1loc1[recStep - 1])) : 0.;
828 1e-50 ? -std::log10(std::abs(
m_loc1loc2[recStep - 1])) : 0.;
831 1e-50 ? -std::log10(std::abs(
m_loc1theta[recStep - 1])) : 0.;
836 1e-50 ? -std::log10(std::abs(
m_loc2loc1[recStep - 1])) : 0.;
838 1e-50 ? -std::log10(std::abs(
m_loc2loc2[recStep - 1])) : 0.;
840 1e-50 ? -std::log10(std::abs(
m_loc2phi[recStep - 1])) : 0.;
845 1e-50 ? -std::log10(std::abs(
m_loc2qop[recStep - 1])) : 0.;
849 1e-50 ? -std::log10(std::abs(
m_philoc1[recStep - 1])) : 0.;
851 1e-50 ? -std::log10(std::abs(
m_philoc2[recStep - 1])) : 0.;
853 1e-50 ? -std::log10(std::abs(
m_phiphi[recStep - 1])) : 0.;
855 1e-50 ? -std::log10(std::abs(
m_phitheta[recStep - 1])) : 0.;
857 1e-50 ? -std::log10(std::abs(
m_phiqop[recStep - 1])) : 0.;
867 1e-50 ? -std::log10(std::abs(
m_thetaphi[recStep - 1])) : 0.;
869 1e-50 ? -std::log10(std::abs(
m_thetatheta[recStep - 1])) : 0.;
871 1e-50 ? -std::log10(std::abs(
m_thetaqop[recStep - 1])) : 0.;
875 1e-50 ? -std::log10(std::abs(
m_qoploc1[recStep - 1])) : 0.;
877 1e-50 ? -std::log10(std::abs(
m_qoploc2[recStep - 1])) : 0.;
880 1e-50 ? -std::log10(std::abs(
m_qoptheta[recStep - 1])) : 0.;
890 return StatusCode::SUCCESS;