@@ -651,7 +651,7 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
651651 // DirOutward (==1) - go along the track (increasing mX)
652652 // DirInward (==-1) - go backward (decreasing mX)
653653 //
654- const auto fy = mP [0 ], sn = mP [2 ];
654+ const double fy = mP [0 ], sn = mP [2 ];
655655 const value_t kEps = 1 .e -6 ;
656656 //
657657 if (gpu::CAMath::Abs (getSnp ()) > constants::math::Almost1) {
@@ -670,18 +670,18 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
670670 if (r0 <= constants::math::Almost0) {
671671 return false ; // the track is concentric to circle
672672 }
673- value_t tR2r0 = 1 .f , g = 0 .f , tmp = 0 .f ;
673+ double tR2r0 = 1 ., g = 0 ., tmp = 0 .;
674674 if (gpu::CAMath::Abs (circle.rC - r0) > kEps ) {
675675 tR2r0 = circle.rC / r0;
676676 g = 0 .5f * (r * r / (r0 * circle.rC ) - tR2r0 - 1 .f / tR2r0);
677677 tmp = 1 .f + g * tR2r0;
678678 } else {
679679 tR2r0 = 1.0 ;
680- g = 0 .5f * r * r / (r0 * circle.rC ) - 1 .f ;
681- tmp = 0 .5f * r * r / (r0 * r0);
680+ g = 0.5 * r * r / (r0 * circle.rC ) - 1 .;
681+ tmp = 0.5 * r * r / (r0 * r0);
682682 }
683- value_t det = (1 .f - g) * (1 .f + g);
684- if (det < 0 .f ) {
683+ auto det = (1 . - g) * (1 . + g);
684+ if (det < 0 .) {
685685 return false ; // does not reach raduis r
686686 }
687687 det = gpu::CAMath::Sqrt (det);
@@ -691,42 +691,44 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
691691 // where s0 and c0 make direction for the circle center (=circle.xC/r0 and circle.yC/r0)
692692 //
693693 x = circle.xC * tmp;
694- value_t y = circle.yC * tmp;
694+ auto y = circle.yC * tmp;
695695 if (gpu::CAMath::Abs (circle.yC ) > constants::math::Almost0) { // when circle.yC==0 the x,y is unique
696- value_t dfx = tR2r0 * gpu::CAMath::Abs (circle.yC ) * det;
697- value_t dfy = tR2r0 * circle.xC * (circle.yC > 0 .f ? det : -det);
696+ auto dfx = tR2r0 * gpu::CAMath::Abs (circle.yC ) * det;
697+ auto dfy = tR2r0 * circle.xC * (circle.yC > 0 . ? det : -det);
698698 if (dir == DirAuto) { // chose the one which corresponds to smallest step
699- value_t delta = (x - mX ) * dfx - (y - fy) * dfy; // the choice of + in C will lead to smaller step if delta<0
700- x += delta < 0 .f ? dfx : -dfx;
699+ auto delta = (x - mX ) * dfx - (y - fy) * dfy; // the choice of + in C will lead to smaller step if delta<0
700+ x += delta < 0 . ? dfx : -dfx;
701701 } else if (dir == DirOutward) { // along track direction: x must be > mX
702702 x -= dfx; // try the smallest step (dfx is positive)
703- value_t dfeps = mX - x; // handle special case of very small step
703+ auto dfeps = mX - x; // handle special case of very small step
704704 if (dfeps < -kEps ) {
705705 return true ;
706706 }
707707 if (gpu::CAMath::Abs (dfeps) < kEps && gpu::CAMath::Abs (mX * mX + fy * fy - r * r) < kEps ) { // are we already in right r?
708- return mX ;
708+ x = mX ;
709+ return true ;
709710 }
710711 x += dfx + dfx;
711- value_t dxm = x - mX ;
712- if (dxm > 0 .f ) {
712+ auto dxm = x - mX ;
713+ if (dxm > 0 .) {
713714 return true ;
714715 } else if (dxm < -kEps ) {
715716 return false ;
716717 }
717718 x = mX ; // don't move
718719 } else { // backward: x must be < mX
719720 x += dfx; // try the smallest step (dfx is positive)
720- value_t dfeps = x - mX ; // handle special case of very small step
721+ auto dfeps = x - mX ; // handle special case of very small step
721722 if (dfeps < -kEps ) {
722723 return true ;
723724 }
724725 if (gpu::CAMath::Abs (dfeps) < kEps && gpu::CAMath::Abs (mX * mX + fy * fy - r * r) < kEps ) { // are we already in right r?
725- return mX ;
726+ x = mX ;
727+ return true ;
726728 }
727729 x -= dfx + dfx;
728- value_t dxm = x - mX ;
729- if (dxm < 0 .f ) {
730+ auto dxm = x - mX ;
731+ if (dxm < 0 .) {
730732 return true ;
731733 }
732734 if (dxm > kEps ) {
@@ -739,11 +741,11 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
739741 return false ;
740742 }
741743 }
742- return x ;
744+ return true ;
743745 }
744746 // this is a straight track
745747 if (gpu::CAMath::Abs (sn) >= constants::math::Almost1) { // || to Y axis
746- value_t det = (r - mX ) * (r + mX );
748+ double det = (r - mX ) * (r + mX );
747749 if (det < 0 .f ) {
748750 return false ; // does not reach raduis r
749751 }
@@ -753,7 +755,7 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
753755 }
754756 det = gpu::CAMath::Sqrt (det);
755757 if (dir == DirOutward) { // along the track direction
756- if (sn > 0 .f ) {
758+ if (sn > 0 .) {
757759 if (fy > det) {
758760 return false ; // track is along Y axis and above the circle
759761 }
@@ -763,7 +765,7 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
763765 }
764766 }
765767 } else if (dir == DirInward) { // against track direction
766- if (sn > 0 .f ) {
768+ if (sn > 0 .) {
767769 if (fy < -det) {
768770 return false ; // track is along Y axis
769771 }
@@ -772,13 +774,13 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
772774 }
773775 }
774776 } else if (gpu::CAMath::Abs (sn) <= constants::math::Almost0) { // || to X axis
775- value_t det = (r - fy) * (r + fy);
776- if (det < 0 .f ) {
777+ double det = (r - fy) * (r + fy);
778+ if (det < 0 .) {
777779 return false ; // does not reach raduis r
778780 }
779781 det = gpu::CAMath::Sqrt (det);
780782 if (dir == DirAuto) {
781- x = mX > 0 .f ? det : -det; // choose the solution requiring the smalest step
783+ x = mX > 0 . ? det : -det; // choose the solution requiring the smalest step
782784 return true ;
783785 } else if (dir == DirOutward) { // along the track direction
784786 if (mX > det) {
@@ -794,17 +796,17 @@ GPUd() bool TrackParametrization<value_T>::getXatLabR(value_t r, value_t& x, val
794796 }
795797 }
796798 } else { // general case of straight line
797- value_t cs = gpu::CAMath::Sqrt ((1 .f - sn) * (1 .f + sn));
798- value_t xsyc = mX * sn - fy * cs;
799- value_t det = (r - xsyc) * (r + xsyc);
800- if (det < 0 .f ) {
799+ auto cs = gpu::CAMath::Sqrt ((1 . - sn) * (1 . + sn));
800+ auto xsyc = mX * sn - fy * cs;
801+ auto det = (r - xsyc) * (r + xsyc);
802+ if (det < 0 .) {
801803 return false ; // does not reach raduis r
802804 }
803805 det = gpu::CAMath::Sqrt (det);
804- value_t xcys = mX * cs + fy * sn;
805- value_t t = -xcys;
806+ auto xcys = mX * cs + fy * sn;
807+ auto t = -xcys;
806808 if (dir == DirAuto) {
807- t += t > 0 .f ? -det : det; // chose the solution requiring the smalest step
809+ t += t > 0 . ? -det : det; // chose the solution requiring the smalest step
808810 } else if (dir > 0 ) { // go in increasing mX direction. ( t+-det > 0)
809811 if (t >= -det) {
810812 t += det; // take minimal step giving t>0
0 commit comments