|
8 | 8 | #include "RecoTracker/LSTCore/interface/ModulesSoA.h" |
9 | 9 | #include "RecoTracker/LSTCore/interface/ObjectRangesSoA.h" |
10 | 10 | #include "RecoTracker/LSTCore/interface/TripletsSoA.h" |
11 | | - |
12 | | -#include "Segment.h" |
13 | | -#include "MiniDoublet.h" |
14 | | -#include "Hit.h" |
| 11 | +#include "RecoTracker/LSTCore/interface/Circle.h" |
15 | 12 |
|
16 | 13 | namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { |
17 | 14 |
|
@@ -628,39 +625,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { |
628 | 625 | return false; // failsafe |
629 | 626 | } |
630 | 627 |
|
631 | | - template <typename TAcc> |
632 | | - ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeRadiusFromThreeAnchorHits( |
633 | | - TAcc const& acc, float x1, float y1, float x2, float y2, float x3, float y3, float& g, float& f) { |
634 | | - float radius = 0.f; |
635 | | - |
636 | | - //(g,f) -> center |
637 | | - //first anchor hit - (x1,y1), second anchor hit - (x2,y2), third anchor hit - (x3, y3) |
638 | | - |
639 | | - float denomInv = 1.0f / ((y1 - y3) * (x2 - x3) - (x1 - x3) * (y2 - y3)); |
640 | | - |
641 | | - float xy1sqr = x1 * x1 + y1 * y1; |
642 | | - |
643 | | - float xy2sqr = x2 * x2 + y2 * y2; |
644 | | - |
645 | | - float xy3sqr = x3 * x3 + y3 * y3; |
646 | | - |
647 | | - g = 0.5f * ((y3 - y2) * xy1sqr + (y1 - y3) * xy2sqr + (y2 - y1) * xy3sqr) * denomInv; |
648 | | - |
649 | | - f = 0.5f * ((x2 - x3) * xy1sqr + (x3 - x1) * xy2sqr + (x1 - x2) * xy3sqr) * denomInv; |
650 | | - |
651 | | - float c = ((x2 * y3 - x3 * y2) * xy1sqr + (x3 * y1 - x1 * y3) * xy2sqr + (x1 * y2 - x2 * y1) * xy3sqr) * denomInv; |
652 | | - |
653 | | - if (((y1 - y3) * (x2 - x3) - (x1 - x3) * (y2 - y3) == 0) || (g * g + f * f - c < 0)) { |
654 | | -#ifdef WARNINGS |
655 | | - printf("three collinear points or FATAL! r^2 < 0!\n"); |
656 | | -#endif |
657 | | - radius = -1.f; |
658 | | - } else |
659 | | - radius = alpaka::math::sqrt(acc, g * g + f * f - c); |
660 | | - |
661 | | - return radius; |
662 | | - } |
663 | | - |
664 | 628 | template <typename TAcc> |
665 | 629 | ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runTripletConstraintsAndAlgo(TAcc const& acc, |
666 | 630 | ModulesConst modules, |
@@ -694,7 +658,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { |
694 | 658 | float y2 = mds.anchorY()[secondMDIndex]; |
695 | 659 | float y3 = mds.anchorY()[thirdMDIndex]; |
696 | 660 |
|
697 | | - circleRadius = computeRadiusFromThreeAnchorHits(acc, x1, y1, x2, y2, x3, y3, circleCenterX, circleCenterY); |
| 661 | + std::tie(circleRadius, circleCenterX, circleCenterY) = |
| 662 | + computeRadiusFromThreeAnchorHits(acc, x1, y1, x2, y2, x3, y3); |
698 | 663 |
|
699 | 664 | if (not passRZConstraint(acc, |
700 | 665 | modules, |
|
0 commit comments