@@ -63,7 +63,7 @@ combinatorial_kalman_filter(
6363 const measurement_collection_types::const_view& measurements_view,
6464 const bound_track_parameters_collection_types::const_view& seeds_view,
6565 const finding_config& config, vecmem::memory_resource& mr,
66- const Logger& log) {
66+ const Logger& /* log*/ ) {
6767
6868 assert (config.min_step_length_for_next_surface >
6969 math::fabs (config.propagation .navigation .overstep_tolerance ) &&
@@ -77,7 +77,8 @@ combinatorial_kalman_filter(
7777 using scalar_type = detray::dscalar<algebra_type>;
7878
7979 // Create a logger.
80- auto logger = [&log]() -> const Logger& { return log; };
80+ // @TODO: Turn back on, once detray can use the ACTS logger
81+ // auto logger = [&log]() -> const Logger& { return log; };
8182
8283 /* ****************************************************************
8384 * Measurement Operations
@@ -144,12 +145,13 @@ combinatorial_kalman_filter(
144145 for (unsigned int step = 0u ; step < config.max_track_candidates_per_track ;
145146 step++) {
146147
147- TRACCC_VERBOSE (" Starting step "
148- << step + 1 << " / "
149- << config.max_track_candidates_per_track );
148+ TRACCC_VERBOSE_HOST (" Starting step "
149+ << step + 1 << " / "
150+ << config.max_track_candidates_per_track );
150151
151152 // Iterate over input parameters
152153 const std::size_t n_in_params = in_params.size ();
154+ TRACCC_VERBOSE_HOST (" No. Params: " << n_in_params);
153155
154156 // Terminate if there is no parameter to proceed
155157 if (n_in_params == 0 ) {
@@ -199,10 +201,13 @@ combinatorial_kalman_filter(
199201 : links[step - 1 ][param_to_link[step - 1 ][in_param_id]]
200202 .ndf_sum );
201203
202- TRACCC_VERBOSE (" Processing input parameter "
203- << in_param_id + 1 << " / " << n_in_params << " : "
204- << in_param << " (orig_param_id=" << orig_param_id
205- << " , skip_counter=" << skip_counter << " )" );
204+ TRACCC_VERBOSE_HOST (" Processing input parameter "
205+ << in_param_id + 1 << " / " << n_in_params);
206+ TRACCC_VERBOSE_HOST (" -> orig_param_id="
207+ << orig_param_id << " , skip_counter="
208+ << skip_counter << " \n Vec:\n "
209+ << in_param.vector ());
210+ TRACCC_DEBUG_HOST (" Cov:\n " << in_param.covariance ());
206211
207212 /* ************************
208213 * Material interaction
@@ -211,8 +216,8 @@ combinatorial_kalman_filter(
211216 // Get surface corresponding to bound params
212217 const detray::tracking_surface sf{det, in_param.surface_link ()};
213218
214- TRACCC_VERBOSE (
215- " free params: " << sf.bound_to_free_vector ({}, in_param));
219+ TRACCC_VERBOSE_HOST ( " Free params: \n "
220+ << sf.bound_to_free_vector ({}, in_param));
216221
217222 // Apply interactor
218223 if (sf.has_material ()) {
@@ -241,7 +246,10 @@ combinatorial_kalman_filter(
241246 best_links;
242247
243248 // Iterate over the measurements
249+ TRACCC_VERBOSE_HOST (" No. measurements: " << (up - lo));
244250 for (unsigned int meas_id = lo; meas_id < up; meas_id++) {
251+ TRACCC_VERBOSE_HOST (" Testing measurement: " << meas_id);
252+
245253 // The measurement on surface to handle.
246254 const measurement& meas = measurements.at (meas_id);
247255
@@ -258,9 +266,13 @@ combinatorial_kalman_filter(
258266
259267 const traccc::scalar chi2 = trk_state.filtered_chi2 ();
260268
269+ TRACCC_DEBUG_HOST (" KF status: " << fitter_debug_msg{res}());
270+
261271 // The chi2 from Kalman update should be less than chi2_max
262272 if (res == kalman_fitter_status::SUCCESS &&
263- chi2 < config.chi2_max ) {
273+ (chi2 < config.chi2_max )) {
274+
275+ TRACCC_VERBOSE_HOST (" Found measurement: " << meas_id);
264276
265277 best_links.push_back (
266278 {{.step = step,
@@ -285,9 +297,9 @@ combinatorial_kalman_filter(
285297 const unsigned int n_branches =
286298 std::min (config.max_num_branches_per_surface ,
287299 static_cast <unsigned int >(best_links.size ()));
288- TRACCC_VERBOSE (" Found " << n_branches << " branches for step "
289- << step << " and input parameter "
290- << in_param_id);
300+ TRACCC_VERBOSE_HOST (" Found " << n_branches << " branches for step "
301+ << step << " and input parameter "
302+ << in_param_id + 1 );
291303 for (unsigned int i = 0 ; i < n_branches; ++i) {
292304 const auto & [link, filtered_params] = best_links[i];
293305
@@ -296,9 +308,9 @@ combinatorial_kalman_filter(
296308
297309 // Add the updated parameter to the updated parameters
298310 updated_params.push_back (filtered_params);
299- TRACCC_VERBOSE (" updated_params["
300- << updated_params.size () - 1
301- << " ] = " << updated_params.back ());
311+ TRACCC_DEBUG_HOST (" updated_params["
312+ << updated_params.size () - 1
313+ << " ] = " << updated_params.back ());
302314 }
303315
304316 /* ****************************************************************
@@ -319,10 +331,12 @@ combinatorial_kalman_filter(
319331 .chi2_sum = prev_chi2_sum,
320332 .ndf_sum = prev_ndf_sum});
321333
334+ TRACCC_VERBOSE_HOST (" Hole state created" );
335+
322336 updated_params.push_back (in_param);
323- TRACCC_VERBOSE (" updated_params["
324- << updated_params.size () - 1
325- << " ] = " << updated_params.back ());
337+ TRACCC_DEBUG_HOST (" updated_params["
338+ << updated_params.size () - 1
339+ << " ] = " << updated_params.back ());
326340 }
327341 }
328342
@@ -439,6 +453,8 @@ combinatorial_kalman_filter(
439453 }
440454
441455 if (this_is_dominated) {
456+ TRACCC_VERBOSE_HOST (
457+ " Track is dead (deduplication)!" );
442458 param_liveness.at (tracks.at (i)) = 0u ;
443459 break ;
444460 }
@@ -466,11 +482,15 @@ combinatorial_kalman_filter(
466482 // link to be a tip
467483 if (links.at (step).at (link_id).n_skipped >
468484 config.max_num_skipping_per_cand ) {
485+ TRACCC_WARNING_HOST (
486+ " Create tip: Max no. of holes reached! Bound param:\n "
487+ << updated_params[link_id].vector ());
469488 tips.push_back ({step, link_id});
470489 continue ;
471490 }
472491
473492 const auto & param = updated_params[link_id];
493+
474494 // Create propagator state
475495 typename traccc::details::ckf_propagator_t <
476496 detector_t , bfield_t >::state propagation (param, field, det);
@@ -489,15 +509,19 @@ combinatorial_kalman_filter(
489509 typename detector_t ::algebra_type>::state s3{prop_cfg};
490510 typename detray::momentum_aborter<scalar_type>::state s4{};
491511 typename ckf_aborter::state s5;
512+
492513 // Update the actor config
493514 s4.min_pT (static_cast <scalar_type>(config.min_pT ));
494515 s4.min_p (static_cast <scalar_type>(config.min_p ));
495516 s5.min_step_length = config.min_step_length_for_next_surface ;
496517 s5.max_count = config.max_step_counts_for_next_surface ;
497518
498519 // Propagate to the next surface
520+ TRACCC_DEBUG_HOST (" Propagating... " );
499521 propagator.propagate (propagation,
500522 detray::tie (s0, s1, s2, s3, s4, s5));
523+ TRACCC_DEBUG_HOST (" Finished propagation: On surface "
524+ << propagation._navigation .barcode ());
501525
502526 // If a surface found, add the parameter for the next
503527 // step
@@ -511,14 +535,18 @@ combinatorial_kalman_filter(
511535 const scalar theta = out_param.theta ();
512536 if (theta <= 0 .f ||
513537 theta >= 2 .f * constant<traccc::scalar>::pi) {
538+ TRACCC_ERROR_HOST (" Theta is hit pole after propagation" );
514539 valid_track = false ;
515540 }
516541
517542 if (!std::isfinite (out_param.phi ())) {
543+ TRACCC_ERROR_HOST (
544+ " Phi is infinite after propagation (Matrix inversion)" );
518545 valid_track = false ;
519546 }
520547
521548 if (math::fabs (out_param.qop ()) == 0 .f ) {
549+ TRACCC_ERROR_HOST (" q over p is zero after propagation" );
522550 valid_track = false ;
523551 }
524552
@@ -531,13 +559,19 @@ combinatorial_kalman_filter(
531559 // tip
532560 if (!valid_track &&
533561 (step >= (config.min_track_candidates_per_track - 1u ))) {
562+ if (!s5.success ) {
563+ TRACCC_VERBOSE_HOST (" Create tip: No next sensitive found" );
564+ } else {
565+ TRACCC_VERBOSE_HOST (" Create tip: Encountered error" );
566+ }
534567 tips.push_back ({step, link_id});
535568 }
536569
537570 // If no more CKF step is expected, current candidate is
538571 // kept as a tip
539572 if (s5.success &&
540573 (step == (config.max_track_candidates_per_track - 1u ))) {
574+ TRACCC_ERROR_HOST (" Create tip: Max no. candidates" );
541575 tips.push_back ({step, link_id});
542576 }
543577 }
0 commit comments