249 const EventContext& ctx = Gaudi::Hive::currentContext();
269 surfacePhi *= (
m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
270 double startX = startR*
cos(surfacePhi);
271 double startY = startR*
sin(surfacePhi);
276 alphaZ *= (
m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
311 auto estimationParameters =
m_propagator->propagateParameters(ctx,
317 if (!estimationParameters) {
318 ATH_MSG_VERBOSE(
"Estimation of intersection did not work - skip event !" );
319 return StatusCode::SUCCESS;
324 const Amg::Vector3D& estimatedPosition = estimationParameters->position();
326 double estimationX = estimatedPosition.x();
327 double estimationY = estimatedPosition.y();
328 double estimationZ = estimatedPosition.z();
330 double estimationPhi = estimatedPosition.phi();
331 double estimationTheta = estimatedPosition.theta();
336 rotateTrans *= (
m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
342 Amg::Vector3D radialVector(estimatedPosition.x(), estimatedPosition.y(), 0.);
346 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
349 surfaceRotation.col(0) = surfaceXdirection;
350 surfaceRotation.col(1) = surfaceYdirection;
351 surfaceRotation.col(2) = surfaceZdirection;
368 std::optional<Trk::TransportJacobian> optTransportJacobian{};
369 AmgMatrix(5,5) testMatrix; testMatrix.setZero();
370 Trk::TransportJacobian currentStepJacobian(testMatrix);
371 double pathLimit = -1.;
379 optTransportJacobian,
383 if (trackParameters && optTransportJacobian){
385 unsigned int recStep = 0;
386 const auto& transportJacobian = (*optTransportJacobian);
392 m_loc1loc1[recStep] = (transportJacobian)(0,0);
393 m_loc1loc2[recStep] = (transportJacobian)(0,1);
394 m_loc1phi[recStep] = (transportJacobian)(0,2);
396 m_loc1qop[recStep] = (transportJacobian)(0,4);
399 m_loc2loc1[recStep] = (transportJacobian)(1,0);
400 m_loc2loc2[recStep] = (transportJacobian)(1,1);
401 m_loc2phi[recStep] = (transportJacobian)(1,2);
403 m_loc2qop[recStep] = (transportJacobian)(1,4);
406 m_philoc1[recStep] = (transportJacobian)(2,0);
407 m_philoc2[recStep] = (transportJacobian)(2,1);
408 m_phiphi[recStep] = (transportJacobian)(2,2);
409 m_phitheta[recStep] = (transportJacobian)(2,3);
410 m_phiqop[recStep] = (transportJacobian)(2,4);
415 m_thetaphi[recStep] = (transportJacobian)(3,2);
417 m_thetaqop[recStep] = (transportJacobian)(3,4);
420 m_qoploc1[recStep] = (transportJacobian)(4,0);
421 m_qoploc2[recStep] = (transportJacobian)(4,1);
422 m_qopphi[recStep] = (transportJacobian)(4,2);
423 m_qoptheta[recStep] = (transportJacobian)(4,3);
424 m_qopqop[recStep] = (transportJacobian)(4,4);
452 auto endLoc1Minus =
m_propagator->propagateParameters(ctx,
460 auto endLoc1Plus =
m_propagator->propagateParameters(ctx,
467 auto endLoc2Minus =
m_propagator->propagateParameters(ctx,
474 auto endLoc2Plus =
m_propagator->propagateParameters(ctx,
481 auto endPhiMinus =
m_propagator->propagateParameters(ctx,
488 auto endPhiPlus =
m_propagator->propagateParameters(ctx,
495 auto endThetaMinus =
m_propagator->propagateParameters(ctx,
502 auto endThetaPlus =
m_propagator->propagateParameters(ctx,
509 auto endQopMinus =
m_propagator->propagateParameters(ctx,
516 auto endQopPlus =
m_propagator->propagateParameters(ctx,
534 const Amg::VectorX& endLoc1MinusPar = endLoc1Minus->parameters();
535 const Amg::VectorX& endLoc1PlusPar = endLoc1Plus->parameters();
537 const Amg::VectorX& endLoc2MinusPar = endLoc2Minus->parameters();
538 const Amg::VectorX& endLoc2PlusPar = endLoc2Plus->parameters();
540 const Amg::VectorX& endPhiMinusPar = endPhiMinus->parameters();
541 const Amg::VectorX& endPhiPlusPar = endPhiPlus->parameters();
543 const Amg::VectorX& endThetaMinusPar = endThetaMinus->parameters();
544 const Amg::VectorX& endThetaPlusPar = endThetaPlus->parameters();
546 const Amg::VectorX& endQopMinusPar = endQopMinus->parameters();
547 const Amg::VectorX& endQopPlusPar = endQopPlus->parameters();
550 Amg::VectorX endLoc1Diff(endLoc1PlusPar-endLoc1MinusPar);
551 Amg::VectorX endLoc2Diff(endLoc2PlusPar-endLoc2MinusPar);
553 Amg::VectorX endThetaDiff(endThetaPlusPar-endThetaMinusPar);
562 m_loc1loc1[recStep] = currentStepJacobian(0,0);
563 m_loc1loc2[recStep] = currentStepJacobian(0,1);
564 m_loc1phi[recStep] = currentStepJacobian(0,2);
566 m_loc1qop[recStep] = currentStepJacobian(0,4);
575 m_loc2loc1[recStep] = currentStepJacobian(1,0);
576 m_loc2loc2[recStep] = currentStepJacobian(1,1);
577 m_loc2phi[recStep] = currentStepJacobian(1,2);
579 m_loc2qop[recStep] = currentStepJacobian(1,4);
588 m_philoc1[recStep] = currentStepJacobian(2,0);
589 m_philoc2[recStep] = currentStepJacobian(2,1);
590 m_phiphi[recStep] = currentStepJacobian(2,2);
591 m_phitheta[recStep] = currentStepJacobian(2,3);
592 m_phiqop[recStep] = currentStepJacobian(2,4);
603 m_thetaphi[recStep] = currentStepJacobian(3,2);
605 m_thetaqop[recStep] = currentStepJacobian(3,4);
614 m_qoploc1[recStep] = currentStepJacobian(4,0);
615 m_qoploc2[recStep] = currentStepJacobian(4,1);
616 m_qopphi[recStep] = currentStepJacobian(4,2);
617 m_qoptheta[recStep] = currentStepJacobian(4,3);
618 m_qopqop[recStep] = currentStepJacobian(4,4);
621 ATH_MSG_DEBUG(
"Current TransportJacobian : " << currentStepJacobian );
691 currentStepJacobian(0,0)=
m_loc1loc1[recStep];
692 currentStepJacobian(0,1)=
m_loc1loc2[recStep];
693 currentStepJacobian(0,2)=
m_loc1phi[recStep];
695 currentStepJacobian(0,4)=
m_loc1qop[recStep];
697 currentStepJacobian(1,0)=
m_loc2loc1[recStep];
698 currentStepJacobian(1,1)=
m_loc2loc2[recStep];
699 currentStepJacobian(1,2)=
m_loc2phi[recStep];
701 currentStepJacobian(1,4)=
m_loc2qop[recStep];
703 currentStepJacobian(2,0)=
m_philoc1[recStep];
704 currentStepJacobian(2,1)=
m_philoc2[recStep];
705 currentStepJacobian(2,2)=
m_phiphi[recStep];
706 currentStepJacobian(2,3)=
m_phitheta[recStep];
707 currentStepJacobian(2,4)=
m_phiqop[recStep];
711 currentStepJacobian(3,2)=
m_thetaphi[recStep];
713 currentStepJacobian(3,4)=
m_thetaqop[recStep];
715 currentStepJacobian(4,0)=
m_qoploc1[recStep];
716 currentStepJacobian(4,1)=
m_qoploc2[recStep];
717 currentStepJacobian(4,2)=
m_qopphi[recStep];
718 currentStepJacobian(4,3)=
m_qoptheta[recStep];
719 currentStepJacobian(4,4)=
m_qopqop[recStep];
723 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian );
728 TransportJacobian diffMatrix(transportJacobian-currentStepJacobian);
730 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix );
751 m_phiphi[recStep] = diffMatrix(2,2);
753 m_phiqop[recStep] = diffMatrix(2,4);
765 m_qopphi[recStep] = diffMatrix(4,2);
767 m_qopqop[recStep] = diffMatrix(4,4);
815 m_loc1loc1[recStep] = std::abs((transportJacobian)(0,0)) > 1
e-50 ? diffMatrix(0,0)/((transportJacobian)(0,0)) : 0.;
816 m_loc1loc2[recStep] = std::abs((transportJacobian)(0,1)) > 1
e-50 ? diffMatrix(0,1)/((transportJacobian)(0,1)) : 0.;
817 m_loc1phi[recStep] = std::abs((transportJacobian)(0,2)) > 1
e-50 ? diffMatrix(0,2)/((transportJacobian)(0,2)) : 0.;
818 m_loc1theta[recStep] = std::abs((transportJacobian)(0,3)) > 1
e-50 ? diffMatrix(0,3)/((transportJacobian)(0,3)) : 0.;
819 m_loc1qop[recStep] = std::abs((transportJacobian)(0,4)) > 1
e-50 ? diffMatrix(0,4)/((transportJacobian)(0,4)) : 0.;
822 m_loc2loc1[recStep] = std::abs((transportJacobian)(1,0)) > 1
e-50 ? diffMatrix(1,0)/((transportJacobian)(1,0)) : 0.;
823 m_loc2loc2[recStep] = std::abs((transportJacobian)(1,1)) > 1
e-50 ? diffMatrix(1,1)/((transportJacobian)(1,1)) : 0.;
824 m_loc2phi[recStep] = std::abs((transportJacobian)(1,2)) > 1
e-50 ? diffMatrix(1,2)/((transportJacobian)(1,2)) : 0.;
825 m_loc2theta[recStep] = std::abs((transportJacobian)(1,3)) > 1
e-50 ? diffMatrix(1,3)/((transportJacobian)(1,3)) : 0.;
826 m_loc2qop[recStep] = std::abs((transportJacobian)(1,4)) > 1
e-50 ? diffMatrix(1,4)/((transportJacobian)(1,4)) : 0.;
829 m_philoc1[recStep] = std::abs((transportJacobian)(2,0)) > 1
e-50 ? diffMatrix(2,0)/((transportJacobian)(2,0)) : 0.;
830 m_philoc2[recStep] = std::abs((transportJacobian)(2,1)) > 1
e-50 ? diffMatrix(2,1)/((transportJacobian)(2,1)) : 0.;
831 m_phiphi[recStep] = std::abs((transportJacobian)(2,2)) > 1
e-50 ? diffMatrix(2,2)/((transportJacobian)(2,2)) : 0.;
832 m_phitheta[recStep] = std::abs((transportJacobian)(2,3)) > 1
e-50 ? diffMatrix(2,3)/((transportJacobian)(2,3)) : 0.;
833 m_phiqop[recStep] = std::abs((transportJacobian)(2,4)) > 1
e-50 ? diffMatrix(2,4)/((transportJacobian)(2,4)) : 0.;
836 m_thetaloc1[recStep] = std::abs((transportJacobian)(3,0)) > 1
e-50 ? diffMatrix(3,0)/((transportJacobian)(3,0)) : 0.;
837 m_thetaloc2[recStep] = std::abs((transportJacobian)(3,1)) > 1
e-50 ? diffMatrix(3,1)/((transportJacobian)(3,1)) : 0.;
838 m_thetaphi[recStep] = std::abs((transportJacobian)(3,2)) > 1
e-50 ? diffMatrix(3,2)/((transportJacobian)(3,2)) : 0.;
839 m_thetatheta[recStep] = std::abs((transportJacobian)(3,3)) > 1
e-50 ? diffMatrix(3,3)/((transportJacobian)(3,3)) : 0.;
840 m_thetaqop[recStep] = std::abs((transportJacobian)(3,4)) > 1
e-50 ? diffMatrix(3,4)/((transportJacobian)(3,4)) : 0.;
843 m_qoploc1[recStep] = std::abs((transportJacobian)(4,0)) > 1
e-50 ? diffMatrix(4,0)/((transportJacobian)(4,0)) : 0.;
844 m_qoploc2[recStep] = std::abs((transportJacobian)(4,1)) > 1
e-50 ? diffMatrix(4,1)/((transportJacobian)(4,1)) : 0.;
845 m_qopphi[recStep] = std::abs((transportJacobian)(4,2)) > 1
e-50 ? diffMatrix(4,2)/((transportJacobian)(4,2)) : 0.;
846 m_qoptheta[recStep] = std::abs((transportJacobian)(4,3)) > 1
e-50 ? diffMatrix(4,3)/((transportJacobian)(4,3)) : 0.;
847 m_qopqop[recStep] = std::abs((transportJacobian)(4,4)) > 1
e-50 ? diffMatrix(4,4)/((transportJacobian)(4,4)) : 0.;
894 return StatusCode::SUCCESS;