@@ -640,9 +640,10 @@ class navigator {
640
640
// / @param state the current navigation state
641
641
// / @param cfg the navigation configuration
642
642
template <typename track_t >
643
- DETRAY_HOST_DEVICE inline void init (const track_t &track, state &navigation,
644
- const navigation::config &cfg,
645
- const context_type &ctx) const {
643
+ DETRAY_HOST_DEVICE inline void init (
644
+ const track_t &track, state &navigation, const navigation::config &cfg,
645
+ const context_type &ctx,
646
+ const bool use_path_tolerance_as_overstep_tolerance = true ) const {
646
647
const auto &det = navigation.detector ();
647
648
const auto volume = tracking_volume{det, navigation.volume ()};
648
649
@@ -651,12 +652,16 @@ class navigator {
651
652
navigation.m_heartbeat = true ;
652
653
653
654
// Search for neighboring surfaces and fill candidates into cache
655
+ const scalar_type overstep_tol =
656
+ use_path_tolerance_as_overstep_tolerance ? -cfg.path_tolerance
657
+ : cfg.overstep_tolerance ;
658
+
654
659
volume.template visit_neighborhood <candidate_search>(
655
660
track, cfg, ctx, det, ctx, track, navigation,
656
661
darray<scalar_type, 2u >{cfg.min_mask_tolerance ,
657
662
cfg.max_mask_tolerance },
658
663
static_cast <scalar_type>(cfg.mask_tolerance_scalor ),
659
- static_cast <scalar_type>(cfg. overstep_tolerance ));
664
+ static_cast <scalar_type>(overstep_tol ));
660
665
661
666
// Determine overall state of the navigation after updating the cache
662
667
update_navigation_state (navigation, cfg);
@@ -729,7 +734,11 @@ class navigator {
729
734
// If no trust could be restored for the current state, (local)
730
735
// navigation might be exhausted: re-initialize volume
731
736
else {
732
- init (track, navigation, cfg, ctx);
737
+ // Use overstep tolerance instead of path tolerance
738
+ const bool use_path_tolerance_as_overstep_tolerance = false ;
739
+
740
+ init (track, navigation, cfg, ctx,
741
+ use_path_tolerance_as_overstep_tolerance);
733
742
is_init = true ;
734
743
735
744
// Sanity check: Should never be the case after complete update call
@@ -743,7 +752,8 @@ class navigator {
743
752
math::min (100 .f * cfg.overstep_tolerance ,
744
753
-10 .f * cfg.max_mask_tolerance );
745
754
746
- init (track, navigation, loose_cfg, ctx);
755
+ init (track, navigation, loose_cfg, ctx,
756
+ use_path_tolerance_as_overstep_tolerance);
747
757
748
758
// Unrecoverable
749
759
if (navigation.trust_level () !=
@@ -849,7 +859,11 @@ class navigator {
849
859
// Actor flagged cache as broken (other cases of 'no trust' are
850
860
// handeled after volume switch was checked in 'update()')
851
861
if (navigation.trust_level () == navigation::trust_level::e_no_trust) {
852
- init (track, navigation, cfg, ctx);
862
+ // Use overstep tolerance instead of path tolerance
863
+ const bool use_path_tolerance_as_overstep_tolerance = false ;
864
+
865
+ init (track, navigation, cfg, ctx,
866
+ use_path_tolerance_as_overstep_tolerance);
853
867
return true ;
854
868
}
855
869
0 commit comments