@@ -520,6 +520,40 @@ GPUd() typename TrackParametrization<value_T>::value_t TrackParametrization<valu
520520 return mP [kSnp ] + x2r;
521521}
522522
523+ // ______________________________________________________________
524+ template <typename value_T>
525+ GPUd () typename TrackParametrization<value_T>::value_t TrackParametrization<value_T>::getPhiAt(value_t xk, value_t b) const
526+ {
527+ // /< this method is just an alias for obtaining phi @ X in the tree->Draw()
528+ value_t dx = xk - getX ();
529+ if (gpu::CAMath::Abs (dx) < constants::math::Almost0) {
530+ return getPhi ();
531+ }
532+ value_t crv = (gpu::CAMath::Abs (b) < constants::math::Almost0) ? 0 .f : getCurvature (b);
533+ value_t x2r = crv * dx;
534+ value_t snp = mP [kSnp ] + x2r;
535+ value_t phi = 999 .;
536+ if (gpu::CAMath::Abs (snp) < constants::math::Almost1) {
537+ value_t phi = gpu::CAMath::ASin (snp) + getAlpha ();
538+ math_utils::detail::bringTo02Pi<value_t >(phi);
539+ }
540+ return phi;
541+ }
542+
543+ // ______________________________________________________________
544+ template <typename value_T>
545+ GPUd () typename TrackParametrization<value_T>::value_t TrackParametrization<value_T>::getPhiPosAt(value_t xk, value_t b) const
546+ {
547+ // /< this method is just an alias for obtaining phiPos @ X in the tree->Draw()
548+ value_t phi = 999 .;
549+ auto y = getYAt (xk, b);
550+ if (y > -9998 .) {
551+ phi = gpu::CAMath::ATan2 (y, xk) + getAlpha ();
552+ math_utils::detail::bringTo02Pi<value_t >(phi);
553+ }
554+ return phi;
555+ }
556+
523557// ______________________________________________________________
524558template <typename value_T>
525559GPUd () typename TrackParametrization<value_T>::value_t TrackParametrization<value_T>::getSnpAt(value_t alpha, value_t xk, value_t b) const
0 commit comments