@@ -47,85 +47,97 @@ TRACCC_DEVICE inline void propagate_to_next_surface(
47
47
const unsigned int s_pos = num_tracks_per_seed.fetch_add (1 );
48
48
vecmem::device_vector<unsigned int > params_liveness (
49
49
payload.params_liveness_view );
50
-
51
- if (s_pos >= cfg.max_num_branches_per_seed ) {
52
- params_liveness[param_id] = 0u ;
53
- return ;
54
- }
55
-
56
- // tips
57
50
vecmem::device_vector<typename candidate_link::link_index_type> tips (
58
51
payload.tips_view );
52
+ vecmem::device_vector<unsigned int > tip_lengths (payload.tip_lengths_view );
59
53
60
- if (links.at (param_id).n_skipped > cfg.max_num_skipping_per_cand ) {
61
- params_liveness[param_id] = 0u ;
62
- tips.push_back ({payload.step , param_id});
63
- return ;
64
- }
65
-
66
- // Detector
67
- typename propagator_t ::detector_type det (payload.det_data );
68
-
69
- // Parameters
70
- bound_track_parameters_collection_types::device params (payload.params_view );
54
+ bool create_tip = false ;
71
55
72
- if (params_liveness.at (param_id) == 0u ) {
73
- return ;
56
+ if (s_pos >= cfg.max_num_branches_per_seed ) {
57
+ params_liveness.at (param_id) = 0u ;
58
+ } else if (links.at (param_id).n_skipped > cfg.max_num_skipping_per_cand ) {
59
+ params_liveness.at (param_id) = 0u ;
60
+ create_tip = true ;
74
61
}
75
62
76
- // Input bound track parameter
77
- const bound_track_parameters<> in_par = params.at (param_id);
78
-
79
- // Create propagator
80
- propagator_t propagator (cfg.propagation );
81
-
82
- // Create propagator state
83
- typename propagator_t ::state propagation (in_par, payload.field_data , det);
84
- propagation.set_particle (
85
- detail::correct_particle_hypothesis (cfg.ptc_hypothesis , in_par));
86
- propagation._stepping
87
- .template set_constraint <detray::step::constraint::e_accuracy>(
88
- cfg.propagation .stepping .step_constraint );
89
-
90
- // Actor state
91
- // @TODO: simplify the syntax here
92
- // @NOTE: Post material interaction might be required here
93
- using actor_list_type =
94
- typename propagator_t ::actor_chain_type::actor_list_type;
95
- typename detray::detail::tuple_element<0 , actor_list_type>::type::state
96
- s0{};
97
- typename detray::detail::tuple_element<1 , actor_list_type>::type::state
98
- s1{};
99
- typename detray::detail::tuple_element<3 , actor_list_type>::type::state
100
- s3{};
101
- typename detray::detail::tuple_element<2 , actor_list_type>::type::state s2{
102
- s3};
103
- typename detray::detail::tuple_element<4 , actor_list_type>::type::state s4;
104
- s4.min_step_length = cfg.min_step_length_for_next_surface ;
105
- s4.max_count = cfg.max_step_counts_for_next_surface ;
106
-
107
- // @TODO: Should be removed once detray is fixed to set the volume in the
108
- // constructor
109
- propagation._navigation .set_volume (in_par.surface_link ().volume ());
110
-
111
- // Propagate to the next surface
112
- propagator.propagate_sync (propagation, detray::tie (s0, s1, s2, s3, s4));
113
-
114
- // If a surface found, add the parameter for the next step
115
- if (s4.success ) {
116
- params[param_id] = propagation._stepping .bound_params ();
117
-
118
- if (payload.step == cfg.max_track_candidates_per_track - 1 ) {
119
- tips.push_back ({payload.step , param_id});
120
- params_liveness[param_id] = 0u ;
63
+ if (params_liveness.at (param_id) != 0u ) {
64
+ // Detector
65
+ typename propagator_t ::detector_type det (payload.det_data );
66
+
67
+ // Parameters
68
+ bound_track_parameters_collection_types::device params (
69
+ payload.params_view );
70
+
71
+ // Input bound track parameter
72
+ const bound_track_parameters<> in_par = params.at (param_id);
73
+
74
+ // Create propagator
75
+ propagator_t propagator (cfg.propagation );
76
+
77
+ // Create propagator state
78
+ typename propagator_t ::state propagation (in_par, payload.field_data ,
79
+ det);
80
+ propagation.set_particle (
81
+ detail::correct_particle_hypothesis (cfg.ptc_hypothesis , in_par));
82
+ propagation._stepping
83
+ .template set_constraint <detray::step::constraint::e_accuracy>(
84
+ cfg.propagation .stepping .step_constraint );
85
+
86
+ // Actor state
87
+ // @TODO: simplify the syntax here
88
+ // @NOTE: Post material interaction might be required here
89
+ using actor_list_type =
90
+ typename propagator_t ::actor_chain_type::actor_list_type;
91
+ typename detray::detail::tuple_element<0 , actor_list_type>::type::state
92
+ s0{};
93
+ typename detray::detail::tuple_element<1 , actor_list_type>::type::state
94
+ s1{};
95
+ typename detray::detail::tuple_element<3 , actor_list_type>::type::state
96
+ s3{};
97
+ typename detray::detail::tuple_element<2 , actor_list_type>::type::state
98
+ s2{s3};
99
+ typename detray::detail::tuple_element<4 , actor_list_type>::type::state
100
+ s4;
101
+ s4.min_step_length = cfg.min_step_length_for_next_surface ;
102
+ s4.max_count = cfg.max_step_counts_for_next_surface ;
103
+
104
+ // @TODO: Should be removed once detray is fixed to set the volume in
105
+ // the constructor
106
+ propagation._navigation .set_volume (in_par.surface_link ().volume ());
107
+
108
+ // Propagate to the next surface
109
+ propagator.propagate_sync (propagation, detray::tie (s0, s1, s2, s3, s4));
110
+
111
+ // If a surface found, add the parameter for the next step
112
+ if (s4.success ) {
113
+ params[param_id] = propagation._stepping .bound_params ();
114
+
115
+ if (payload.step == cfg.max_track_candidates_per_track - 1 ) {
116
+ create_tip = true ;
117
+ params_liveness[param_id] = 0u ;
118
+ } else {
119
+ params_liveness[param_id] = 1u ;
120
+ }
121
121
} else {
122
- params_liveness[param_id] = 1u ;
122
+ params_liveness[param_id] = 0u ;
123
+
124
+ if (payload.step >= cfg.min_track_candidates_per_track - 1 ) {
125
+ create_tip = true ;
126
+ }
123
127
}
124
- } else {
125
- params_liveness[param_id] = 0u ;
128
+ }
129
+
130
+ if (create_tip) {
131
+ const auto & L = links.at (param_id);
132
+
133
+ const unsigned int num_meas = payload.step + 1 - L.n_skipped ;
126
134
127
- if (payload.step >= cfg.min_track_candidates_per_track - 1 ) {
128
- tips.push_back ({payload.step , param_id});
135
+ // Criteria for valid tracks
136
+ if (num_meas >= cfg.min_track_candidates_per_track &&
137
+ num_meas <= cfg.max_track_candidates_per_track ) {
138
+ const unsigned int tip_pos =
139
+ tips.push_back ({payload.step , param_id});
140
+ tip_lengths.at (tip_pos) = num_meas;
129
141
}
130
142
}
131
143
}
0 commit comments