Skip to content

Commit 7db03d8

Browse files
authored
Fix the CKF-related bugs that break the continuous benchmark (#909)
* Sort measurements during spacepoing reading * Check if min_step_length_for_next_surface is larger than overstep tolerance * Add some comments * Use {3,3} search windows for simulation * Fix typo in config variable name
1 parent f16e1a4 commit 7db03d8

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

benchmarks/common/benchmarks/toy_detector_benchmark.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
125125

126126
// Same propagation configuration for sim and reco
127127
apply_propagation_config(sim.get_config().propagation);
128+
sim.get_config().propagation.navigation.search_window = {3, 3};
128129
// Set constrained step size to 1 mm
129130
sim.get_config().propagation.stepping.step_constraint =
130131
1.f * traccc::unit<float>::mm;
@@ -155,8 +156,9 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
155156

156157
void apply_propagation_config(detray::propagation::config& cfg) const {
157158
// Configure the propagation for the toy detector
159+
// @NOTE: currently Non-{0,0} search windows cause an error during CKF
158160
// cfg.navigation.search_window = {3, 3};
159-
cfg.navigation.overstep_tolerance = -300.f * traccc::unit<float>::um;
161+
cfg.navigation.overstep_tolerance = -1000.f * traccc::unit<float>::um;
160162
cfg.navigation.min_mask_tolerance = 1e-5f * traccc::unit<float>::mm;
161163
cfg.navigation.max_mask_tolerance = 3.f * traccc::unit<float>::mm;
162164
cfg.navigation.mask_tolerance_scalor = 0.05f;

core/include/traccc/finding/details/find_tracks.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ track_candidate_container_types::host find_tracks(
5757
const bound_track_parameters_collection_types::const_view& seeds_view,
5858
const finding_config& config) {
5959

60+
assert(config.min_step_length_for_next_surface >
61+
math::fabs(config.propagation.navigation.overstep_tolerance) &&
62+
"Min step length for the next surface should be higher than the "
63+
"overstep tolerance");
64+
6065
/*****************************************************************
6166
* Types used by the track finding
6267
*****************************************************************/

core/include/traccc/finding/finding_config.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct finding_config {
3535
/// Minimum step length that track should make to reach the next surface. It
3636
/// should be set higher than the overstep tolerance not to make it stay on
3737
/// the same surface
38-
float min_step_length_for_next_surface = 0.5f * traccc::unit<float>::mm;
38+
float min_step_length_for_next_surface = 1.2f * traccc::unit<float>::mm;
3939
/// Maximum step counts that track can make to reach the next surface
4040
unsigned int max_step_counts_for_next_surface = 100;
4141

device/cuda/src/finding/finding_algorithm.cu

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ finding_algorithm<stepper_t, navigator_t>::operator()(
7373
const typename measurement_collection_types::view& measurements,
7474
const bound_track_parameters_collection_types::buffer& seeds_buffer) const {
7575

76+
assert(m_cfg.min_step_length_for_next_surface >
77+
math::fabs(m_cfg.propagation.navigation.overstep_tolerance) &&
78+
"Min step length for the next surface should be higher than the "
79+
"overstep tolerance");
80+
7681
// Get a convenience variable for the stream that we'll be using.
7782
cudaStream_t stream = details::get_stream(m_stream);
7883

device/sycl/src/finding/find_tracks.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ track_candidate_container_types::buffer find_tracks(
100100
const finding_config& config, const memory_resource& mr, vecmem::copy& copy,
101101
::sycl::queue& queue) {
102102

103+
assert(config.min_step_length_for_next_surface >
104+
math::fabs(config.propagation.navigation.overstep_tolerance) &&
105+
"Min step length for the next surface should be higher than the "
106+
"overstep tolerance");
107+
103108
assert(is_contiguous_on<measurement_collection_types::const_device>(
104109
measurement_module_projection(), mr.main, copy, queue, measurements));
105110

io/src/csv/read_spacepoints.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void read_spacepoints(edm::spacepoint_collection::host& spacepoints,
2626
const traccc::default_detector::host* detector) {
2727

2828
// Read all measurements.
29-
static constexpr bool sort_measurements = false;
29+
static constexpr bool sort_measurements = true;
3030
read_measurements(measurements, meas_filename, detector, sort_measurements);
3131

3232
// Measurement hit id reader

0 commit comments

Comments
 (0)