Skip to content

Commit e91fb9b

Browse files
authored
Merge pull request #506 from beomki-yeo/rk-tolerance
Add rk tolerance option
2 parents 103d9f9 + e36b765 commit e91fb9b

File tree

17 files changed

+43
-7
lines changed

17 files changed

+43
-7
lines changed

core/include/traccc/finding/finding_algorithm.ipp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,9 @@ finding_algorithm<stepper_t, navigator_t>::operator()(
215215
m_cfg.overstep_tolerance);
216216
propagation._stepping.template set_constraint<
217217
detray::step::constraint::e_accuracy>(
218-
m_cfg.constrained_step_size);
218+
m_cfg.step_constraint);
219219
propagation.set_mask_tolerance(m_cfg.mask_tolerance);
220+
propagation._stepping.set_tolerance(m_cfg.rk_tolerance);
220221

221222
typename detray::pathlimit_aborter::state s0;
222223
typename detray::parameter_transporter<

core/include/traccc/finding/finding_config.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ struct finding_config {
3939

4040
/// Constrained step size for propagation
4141
/// @TODO: Make a separate file for propagation config?
42-
scalar_t constrained_step_size = std::numeric_limits<scalar_t>::max();
42+
scalar_t step_constraint = std::numeric_limits<scalar_t>::max();
4343

4444
scalar_t overstep_tolerance = -100 * detray::unit<scalar_t>::um;
4545
scalar_t mask_tolerance = 15.f * detray::unit<scalar_t>::um;
46+
scalar_t rk_tolerance = 1e-4;
4647

4748
/// GPU-specific parameter for the number of measurements to be
4849
/// iterated per thread

core/include/traccc/fitting/fitting_config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct fitting_config {
2121
scalar_t overstep_tolerance = -100 * detray::unit<scalar_t>::um;
2222
scalar_t step_constraint = std::numeric_limits<scalar_t>::max();
2323
scalar_t mask_tolerance = 15.f * detray::unit<scalar_t>::um;
24+
scalar_t rk_tolerance = 1e-4;
2425
};
2526

2627
} // namespace traccc

core/include/traccc/fitting/kalman_filter/kalman_fitter.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class kalman_fitter {
180180
.template set_constraint<detray::step::constraint::e_accuracy>(
181181
m_cfg.step_constraint);
182182
propagation.set_mask_tolerance(m_cfg.mask_tolerance);
183+
propagation._stepping.set_tolerance(m_cfg.rk_tolerance);
183184

184185
// Run forward filtering
185186
propagator.propagate(propagation, fitter_state());

device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ TRACCC_DEVICE inline void propagate_to_next_surface(
6565
propagation._stepping().set_overstep_tolerance(cfg.overstep_tolerance);
6666
propagation._stepping
6767
.template set_constraint<detray::step::constraint::e_accuracy>(
68-
cfg.constrained_step_size);
68+
cfg.step_constraint);
6969
propagation.set_mask_tolerance(cfg.mask_tolerance);
70+
propagation._stepping.set_tolerance(cfg.rk_tolerance);
7071

7172
// Actor state
7273
// @TODO: simplify the syntax here

examples/options/include/traccc/options/propagation_options.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct propagation_options {
2828
scalar_t step_constraint{std::numeric_limits<scalar_t>::max()};
2929
scalar_t overstep_tolerance{-100.f * detray::unit<scalar_t>::um};
3030
scalar_t mask_tolerance{15.f * detray::unit<scalar_t>::um};
31+
scalar_t rk_tolerance{1e-4};
3132

3233
propagation_options(po::options_description& desc) {
3334
desc.add_options()("constraint-step-size-mm",
@@ -40,6 +41,9 @@ struct propagation_options {
4041
desc.add_options()("mask-tolerance-um",
4142
po::value<scalar_t>()->default_value(15.f),
4243
"The mask tolerance [um]");
44+
desc.add_options()("rk-tolerance",
45+
po::value<scalar_t>()->default_value(1e-4),
46+
"The Runge-Kutta stepper tolerance");
4347
}
4448

4549
void read(const po::variables_map& vm) {
@@ -49,6 +53,7 @@ struct propagation_options {
4953
detray::unit<scalar_t>::um;
5054
mask_tolerance =
5155
vm["mask-tolerance-um"].as<scalar_t>() * detray::unit<scalar_t>::um;
56+
rk_tolerance = vm["rk-tolerance"].as<scalar_t>();
5257
}
5358
};
5459

examples/run/cpu/seeding_example.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,
129129
cfg.min_track_candidates_per_track = finding_cfg.track_candidates_range[0];
130130
cfg.max_track_candidates_per_track = finding_cfg.track_candidates_range[1];
131131
cfg.chi2_max = finding_cfg.chi2_max;
132-
cfg.constrained_step_size = propagation_opts.step_constraint;
132+
cfg.step_constraint = propagation_opts.step_constraint;
133133
cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
134134
cfg.mask_tolerance = propagation_opts.mask_tolerance;
135+
cfg.rk_tolerance = propagation_opts.rk_tolerance;
135136

136137
traccc::finding_algorithm<rk_stepper_type, host_navigator_type>
137138
host_finding(cfg);
@@ -141,6 +142,8 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,
141142
fit_cfg.step_constraint = propagation_opts.step_constraint;
142143
fit_cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
143144
fit_cfg.mask_tolerance = propagation_opts.mask_tolerance;
145+
fit_cfg.rk_tolerance = propagation_opts.rk_tolerance;
146+
144147
traccc::fitting_algorithm<host_fitter_type> host_fitting(fit_cfg);
145148

146149
// Loop over events

examples/run/cpu/truth_finding_example.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ int seq_run(const traccc::finding_input_config<traccc::scalar>& i_cfg,
113113
cfg.min_track_candidates_per_track = i_cfg.track_candidates_range[0];
114114
cfg.max_track_candidates_per_track = i_cfg.track_candidates_range[1];
115115
cfg.chi2_max = i_cfg.chi2_max;
116-
cfg.constrained_step_size = propagation_opts.step_constraint;
116+
cfg.step_constraint = propagation_opts.step_constraint;
117117
cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
118118
cfg.mask_tolerance = propagation_opts.mask_tolerance;
119+
cfg.rk_tolerance = propagation_opts.rk_tolerance;
119120

120121
// Finding algorithm object
121122
traccc::finding_algorithm<rk_stepper_type, host_navigator_type>
@@ -126,6 +127,8 @@ int seq_run(const traccc::finding_input_config<traccc::scalar>& i_cfg,
126127
fit_cfg.step_constraint = propagation_opts.step_constraint;
127128
fit_cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
128129
fit_cfg.mask_tolerance = propagation_opts.mask_tolerance;
130+
fit_cfg.rk_tolerance = propagation_opts.rk_tolerance;
131+
129132
traccc::fitting_algorithm<host_fitter_type> host_fitting(fit_cfg);
130133

131134
// Seed generator

examples/run/cpu/truth_fitting_example.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ int main(int argc, char* argv[]) {
127127
fit_cfg.step_constraint = propagation_opts.step_constraint;
128128
fit_cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
129129
fit_cfg.mask_tolerance = propagation_opts.mask_tolerance;
130+
fit_cfg.rk_tolerance = propagation_opts.rk_tolerance;
131+
130132
traccc::fitting_algorithm<host_fitter_type> host_fitting(fit_cfg);
131133

132134
// Seed generator

examples/run/cuda/seeding_example_cuda.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,
180180
cfg.min_track_candidates_per_track = finding_cfg.track_candidates_range[0];
181181
cfg.max_track_candidates_per_track = finding_cfg.track_candidates_range[1];
182182
cfg.chi2_max = finding_cfg.chi2_max;
183-
cfg.constrained_step_size = propagation_opts.step_constraint;
183+
cfg.step_constraint = propagation_opts.step_constraint;
184+
cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
185+
cfg.mask_tolerance = propagation_opts.mask_tolerance;
186+
cfg.rk_tolerance = propagation_opts.rk_tolerance;
184187

185188
// Finding algorithm object
186189
traccc::finding_algorithm<rk_stepper_type, host_navigator_type>
@@ -191,6 +194,9 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,
191194
// Fitting algorithm object
192195
typename traccc::fitting_algorithm<host_fitter_type>::config_type fit_cfg;
193196
fit_cfg.step_constraint = propagation_opts.step_constraint;
197+
fit_cfg.overstep_tolerance = propagation_opts.overstep_tolerance;
198+
fit_cfg.mask_tolerance = propagation_opts.mask_tolerance;
199+
fit_cfg.rk_tolerance = propagation_opts.rk_tolerance;
194200

195201
traccc::fitting_algorithm<host_fitter_type> host_fitting(fit_cfg);
196202
traccc::cuda::fitting_algorithm<device_fitter_type> device_fitting(

0 commit comments

Comments
 (0)