Skip to content

Commit c2c619a

Browse files
committed
new stuff
1 parent fb0537f commit c2c619a

22 files changed

+585
-206
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ include( traccc-functions )
5252
set( TRACCC_CUSTOM_SCALARTYPE "float" CACHE STRING
5353
"Scalar type to use in the TRACCC code" )
5454

55+
# Temporary setting for the traccc device log level, until it can be removed.
56+
set( TRACCC_DEVICE_LOG_LVL "NONE" CACHE STRING
57+
"Log level for traccc and detray device code" )
58+
5559
# Flags controlling which parts of traccc to build.
5660
option( TRACCC_BUILD_CUDA "Build the CUDA sources included in traccc" FALSE )
5761
option( TRACCC_BUILD_HIP "Build the HIP sources included in traccc" FALSE)

core/include/traccc/finding/actors/ckf_aborter.hpp

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
// Project include(s)
1111
#include "traccc/definitions/primitives.hpp"
1212
#include "traccc/definitions/qualifiers.hpp"
13+
#include "traccc/utils/logging.hpp"
1314

1415
// detray include(s)
16+
#include <detray/definitions/indexing.hpp>
1517
#include <detray/propagator/base_actor.hpp>
1618

1719
// System include(s)
@@ -24,37 +26,55 @@ struct ckf_aborter : detray::actor {
2426
struct state {
2527
// minimal step length to prevent from staying on the same surface
2628
scalar min_step_length = 0.5f;
29+
2730
/// Maximum step counts that track can make to reach the next surface
28-
unsigned int max_count = 100;
31+
unsigned int max_count = 100u;
32+
unsigned int count = 0u;
2933

30-
bool success = false;
31-
unsigned int count = 0;
34+
/// Previous sensitive surface index
35+
detray::dindex prev_surface_index{detray::dindex_invalid};
36+
/// Current sensitive surface index
37+
detray::dindex surface_index{detray::dindex_invalid};
3238

33-
scalar path_from_surface{0.f};
39+
/// Whether a surface was found
40+
bool success = false;
3441
};
3542

3643
template <typename propagator_state_t>
3744
TRACCC_HOST_DEVICE void operator()(state &abrt_state,
3845
propagator_state_t &prop_state) const {
3946

4047
auto &navigation = prop_state._navigation;
41-
const auto &stepping = prop_state._stepping;
4248

4349
abrt_state.count++;
44-
abrt_state.path_from_surface += stepping.step_size();
4550

46-
// Stop at the next sensitive surface
47-
if (navigation.is_on_sensitive() &&
48-
abrt_state.path_from_surface > abrt_state.min_step_length) {
49-
prop_state._heartbeat &= navigation.pause();
50-
abrt_state.success = navigation.is_alive();
51-
}
51+
TRACCC_VERBOSE_HOST_DEVICE("Checking CKF aborter");
52+
TRACCC_DEBUG_HOST_DEVICE("=> second last sensitive: %d",
53+
abrt_state.prev_surface_index);
54+
TRACCC_DEBUG_HOST_DEVICE("=> last sensitive: %d",
55+
abrt_state.surface_index);
5256

53-
// Reset path from surface
54-
if (navigation.is_on_sensitive()) {
55-
abrt_state.path_from_surface = 0.f;
57+
// Is this a valid sensitive surface to run the CKF on?
58+
const detray::dindex sf_idx{navigation.barcode().index()};
59+
if (!navigation.is_on_sensitive() ||
60+
(abrt_state.surface_index == sf_idx) ||
61+
(abrt_state.prev_surface_index == sf_idx)) {
62+
return;
5663
}
5764

65+
// Update the visited sensitive surfaces and pause the propagation
66+
abrt_state.prev_surface_index = abrt_state.surface_index;
67+
abrt_state.surface_index = sf_idx;
68+
69+
TRACCC_VERBOSE_HOST_DEVICE("Found sensitive surface: %d",
70+
abrt_state.surface_index);
71+
72+
prop_state._heartbeat &= navigation.pause();
73+
abrt_state.success = true;
74+
75+
assert(abrt_state.surface_index <
76+
navigation.detector().surfaces().size());
77+
5878
if (abrt_state.count > abrt_state.max_count) {
5979
prop_state._heartbeat &= navigation.abort(
6080
"CKF: Maximum number of steps to reach next sensitive surface "

0 commit comments

Comments
 (0)