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){
386 unsigned int recStep = 0;
387 const auto& transportJacobian = (*optTransportJacobian);
393 m_loc1loc1[recStep] = (transportJacobian)(0,0);
394 m_loc1loc2[recStep] = (transportJacobian)(0,1);
395 m_loc1phi[recStep] = (transportJacobian)(0,2);
397 m_loc1qop[recStep] = (transportJacobian)(0,4);
400 m_loc2loc1[recStep] = (transportJacobian)(1,0);
401 m_loc2loc2[recStep] = (transportJacobian)(1,1);
402 m_loc2phi[recStep] = (transportJacobian)(1,2);
404 m_loc2qop[recStep] = (transportJacobian)(1,4);
407 m_philoc1[recStep] = (transportJacobian)(2,0);
408 m_philoc2[recStep] = (transportJacobian)(2,1);
409 m_phiphi[recStep] = (transportJacobian)(2,2);
410 m_phitheta[recStep] = (transportJacobian)(2,3);
411 m_phiqop[recStep] = (transportJacobian)(2,4);
416 m_thetaphi[recStep] = (transportJacobian)(3,2);
418 m_thetaqop[recStep] = (transportJacobian)(3,4);
421 m_qoploc1[recStep] = (transportJacobian)(4,0);
422 m_qoploc2[recStep] = (transportJacobian)(4,1);
423 m_qopphi[recStep] = (transportJacobian)(4,2);
424 m_qoptheta[recStep] = (transportJacobian)(4,3);
425 m_qopqop[recStep] = (transportJacobian)(4,4);
453 auto endLoc1Minus =
m_propagator->propagateParameters(ctx,
461 auto endLoc1Plus =
m_propagator->propagateParameters(ctx,
468 auto endLoc2Minus =
m_propagator->propagateParameters(ctx,
475 auto endLoc2Plus =
m_propagator->propagateParameters(ctx,
482 auto endPhiMinus =
m_propagator->propagateParameters(ctx,
489 auto endPhiPlus =
m_propagator->propagateParameters(ctx,
496 auto endThetaMinus =
m_propagator->propagateParameters(ctx,
503 auto endThetaPlus =
m_propagator->propagateParameters(ctx,
510 auto endQopMinus =
m_propagator->propagateParameters(ctx,
517 auto endQopPlus =
m_propagator->propagateParameters(ctx,
535 const Amg::VectorX& endLoc1MinusPar = endLoc1Minus->parameters();
536 const Amg::VectorX& endLoc1PlusPar = endLoc1Plus->parameters();
538 const Amg::VectorX& endLoc2MinusPar = endLoc2Minus->parameters();
539 const Amg::VectorX& endLoc2PlusPar = endLoc2Plus->parameters();
541 const Amg::VectorX& endPhiMinusPar = endPhiMinus->parameters();
542 const Amg::VectorX& endPhiPlusPar = endPhiPlus->parameters();
544 const Amg::VectorX& endThetaMinusPar = endThetaMinus->parameters();
545 const Amg::VectorX& endThetaPlusPar = endThetaPlus->parameters();
547 const Amg::VectorX& endQopMinusPar = endQopMinus->parameters();
548 const Amg::VectorX& endQopPlusPar = endQopPlus->parameters();
551 Amg::VectorX endLoc1Diff(endLoc1PlusPar-endLoc1MinusPar);
552 Amg::VectorX endLoc2Diff(endLoc2PlusPar-endLoc2MinusPar);
554 Amg::VectorX endThetaDiff(endThetaPlusPar-endThetaMinusPar);
563 m_loc1loc1[recStep] = currentStepJacobian(0,0);
564 m_loc1loc2[recStep] = currentStepJacobian(0,1);
565 m_loc1phi[recStep] = currentStepJacobian(0,2);
567 m_loc1qop[recStep] = currentStepJacobian(0,4);
576 m_loc2loc1[recStep] = currentStepJacobian(1,0);
577 m_loc2loc2[recStep] = currentStepJacobian(1,1);
578 m_loc2phi[recStep] = currentStepJacobian(1,2);
580 m_loc2qop[recStep] = currentStepJacobian(1,4);
589 m_philoc1[recStep] = currentStepJacobian(2,0);
590 m_philoc2[recStep] = currentStepJacobian(2,1);
591 m_phiphi[recStep] = currentStepJacobian(2,2);
592 m_phitheta[recStep] = currentStepJacobian(2,3);
593 m_phiqop[recStep] = currentStepJacobian(2,4);
604 m_thetaphi[recStep] = currentStepJacobian(3,2);
606 m_thetaqop[recStep] = currentStepJacobian(3,4);
615 m_qoploc1[recStep] = currentStepJacobian(4,0);
616 m_qoploc2[recStep] = currentStepJacobian(4,1);
617 m_qopphi[recStep] = currentStepJacobian(4,2);
618 m_qoptheta[recStep] = currentStepJacobian(4,3);
619 m_qopqop[recStep] = currentStepJacobian(4,4);
622 ATH_MSG_DEBUG(
"Current TransportJacobian : " << currentStepJacobian );
692 currentStepJacobian(0,0)=
m_loc1loc1[recStep];
693 currentStepJacobian(0,1)=
m_loc1loc2[recStep];
694 currentStepJacobian(0,2)=
m_loc1phi[recStep];
696 currentStepJacobian(0,4)=
m_loc1qop[recStep];
698 currentStepJacobian(1,0)=
m_loc2loc1[recStep];
699 currentStepJacobian(1,1)=
m_loc2loc2[recStep];
700 currentStepJacobian(1,2)=
m_loc2phi[recStep];
702 currentStepJacobian(1,4)=
m_loc2qop[recStep];
704 currentStepJacobian(2,0)=
m_philoc1[recStep];
705 currentStepJacobian(2,1)=
m_philoc2[recStep];
706 currentStepJacobian(2,2)=
m_phiphi[recStep];
707 currentStepJacobian(2,3)=
m_phitheta[recStep];
708 currentStepJacobian(2,4)=
m_phiqop[recStep];
712 currentStepJacobian(3,2)=
m_thetaphi[recStep];
714 currentStepJacobian(3,4)=
m_thetaqop[recStep];
716 currentStepJacobian(4,0)=
m_qoploc1[recStep];
717 currentStepJacobian(4,1)=
m_qoploc2[recStep];
718 currentStepJacobian(4,2)=
m_qopphi[recStep];
719 currentStepJacobian(4,3)=
m_qoptheta[recStep];
720 currentStepJacobian(4,4)=
m_qopqop[recStep];
724 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian );
729 TransportJacobian diffMatrix(transportJacobian-currentStepJacobian);
731 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix );
752 m_phiphi[recStep] = diffMatrix(2,2);
754 m_phiqop[recStep] = diffMatrix(2,4);
766 m_qopphi[recStep] = diffMatrix(4,2);
768 m_qopqop[recStep] = diffMatrix(4,4);
816 m_loc1loc1[recStep] = std::abs((transportJacobian)(0,0)) > 1
e-50 ? diffMatrix(0,0)/((transportJacobian)(0,0)) : 0.;
817 m_loc1loc2[recStep] = std::abs((transportJacobian)(0,1)) > 1
e-50 ? diffMatrix(0,1)/((transportJacobian)(0,1)) : 0.;
818 m_loc1phi[recStep] = std::abs((transportJacobian)(0,2)) > 1
e-50 ? diffMatrix(0,2)/((transportJacobian)(0,2)) : 0.;
819 m_loc1theta[recStep] = std::abs((transportJacobian)(0,3)) > 1
e-50 ? diffMatrix(0,3)/((transportJacobian)(0,3)) : 0.;
820 m_loc1qop[recStep] = std::abs((transportJacobian)(0,4)) > 1
e-50 ? diffMatrix(0,4)/((transportJacobian)(0,4)) : 0.;
823 m_loc2loc1[recStep] = std::abs((transportJacobian)(1,0)) > 1
e-50 ? diffMatrix(1,0)/((transportJacobian)(1,0)) : 0.;
824 m_loc2loc2[recStep] = std::abs((transportJacobian)(1,1)) > 1
e-50 ? diffMatrix(1,1)/((transportJacobian)(1,1)) : 0.;
825 m_loc2phi[recStep] = std::abs((transportJacobian)(1,2)) > 1
e-50 ? diffMatrix(1,2)/((transportJacobian)(1,2)) : 0.;
826 m_loc2theta[recStep] = std::abs((transportJacobian)(1,3)) > 1
e-50 ? diffMatrix(1,3)/((transportJacobian)(1,3)) : 0.;
827 m_loc2qop[recStep] = std::abs((transportJacobian)(1,4)) > 1
e-50 ? diffMatrix(1,4)/((transportJacobian)(1,4)) : 0.;
830 m_philoc1[recStep] = std::abs((transportJacobian)(2,0)) > 1
e-50 ? diffMatrix(2,0)/((transportJacobian)(2,0)) : 0.;
831 m_philoc2[recStep] = std::abs((transportJacobian)(2,1)) > 1
e-50 ? diffMatrix(2,1)/((transportJacobian)(2,1)) : 0.;
832 m_phiphi[recStep] = std::abs((transportJacobian)(2,2)) > 1
e-50 ? diffMatrix(2,2)/((transportJacobian)(2,2)) : 0.;
833 m_phitheta[recStep] = std::abs((transportJacobian)(2,3)) > 1
e-50 ? diffMatrix(2,3)/((transportJacobian)(2,3)) : 0.;
834 m_phiqop[recStep] = std::abs((transportJacobian)(2,4)) > 1
e-50 ? diffMatrix(2,4)/((transportJacobian)(2,4)) : 0.;
837 m_thetaloc1[recStep] = std::abs((transportJacobian)(3,0)) > 1
e-50 ? diffMatrix(3,0)/((transportJacobian)(3,0)) : 0.;
838 m_thetaloc2[recStep] = std::abs((transportJacobian)(3,1)) > 1
e-50 ? diffMatrix(3,1)/((transportJacobian)(3,1)) : 0.;
839 m_thetaphi[recStep] = std::abs((transportJacobian)(3,2)) > 1
e-50 ? diffMatrix(3,2)/((transportJacobian)(3,2)) : 0.;
840 m_thetatheta[recStep] = std::abs((transportJacobian)(3,3)) > 1
e-50 ? diffMatrix(3,3)/((transportJacobian)(3,3)) : 0.;
841 m_thetaqop[recStep] = std::abs((transportJacobian)(3,4)) > 1
e-50 ? diffMatrix(3,4)/((transportJacobian)(3,4)) : 0.;
844 m_qoploc1[recStep] = std::abs((transportJacobian)(4,0)) > 1
e-50 ? diffMatrix(4,0)/((transportJacobian)(4,0)) : 0.;
845 m_qoploc2[recStep] = std::abs((transportJacobian)(4,1)) > 1
e-50 ? diffMatrix(4,1)/((transportJacobian)(4,1)) : 0.;
846 m_qopphi[recStep] = std::abs((transportJacobian)(4,2)) > 1
e-50 ? diffMatrix(4,2)/((transportJacobian)(4,2)) : 0.;
847 m_qoptheta[recStep] = std::abs((transportJacobian)(4,3)) > 1
e-50 ? diffMatrix(4,3)/((transportJacobian)(4,3)) : 0.;
848 m_qopqop[recStep] = std::abs((transportJacobian)(4,4)) > 1
e-50 ? diffMatrix(4,4)/((transportJacobian)(4,4)) : 0.;
898 return StatusCode::SUCCESS;