diff --git a/core/include/traccc/finding/finding_config.hpp b/core/include/traccc/finding/finding_config.hpp index 73467903e2..f92884f0d7 100644 --- a/core/include/traccc/finding/finding_config.hpp +++ b/core/include/traccc/finding/finding_config.hpp @@ -41,7 +41,7 @@ struct finding_config { scalar_t chi2_max = 30.f; /// Propagation configuration - detray::propagation::config propagation{}; + detray::propagation::config propagation{}; /**************************** * GPU-specfic parameters diff --git a/core/include/traccc/fitting/fitting_config.hpp b/core/include/traccc/fitting/fitting_config.hpp index 29e9b838b5..6d8cccfe10 100644 --- a/core/include/traccc/fitting/fitting_config.hpp +++ b/core/include/traccc/fitting/fitting_config.hpp @@ -14,13 +14,12 @@ namespace traccc { /// Configuration struct for track fitting -template struct fitting_config { std::size_t n_iterations = 1; /// Propagation configuration - detray::propagation::config propagation{}; + detray::propagation::config propagation{}; }; } // namespace traccc diff --git a/core/include/traccc/fitting/kalman_filter/kalman_fitter.hpp b/core/include/traccc/fitting/kalman_filter/kalman_fitter.hpp index 304005b084..16799d5a5c 100644 --- a/core/include/traccc/fitting/kalman_filter/kalman_fitter.hpp +++ b/core/include/traccc/fitting/kalman_filter/kalman_fitter.hpp @@ -53,7 +53,7 @@ class kalman_fitter { using intersection_type = typename navigator_t::intersection_type; /// Configuration type - using config_type = fitting_config; + using config_type = fitting_config; // Field type using bfield_type = typename stepper_t::magnetic_field_type; diff --git a/examples/options/include/traccc/options/track_propagation.hpp b/examples/options/include/traccc/options/track_propagation.hpp index 4dddc0f3fb..4dd35c1f68 100644 --- a/examples/options/include/traccc/options/track_propagation.hpp +++ b/examples/options/include/traccc/options/track_propagation.hpp @@ -24,7 +24,7 @@ class track_propagation : public interface { /// @{ /// Propagation configuration object - detray::propagation::config config; + detray::propagation::config config; /// @} @@ -37,17 +37,6 @@ class track_propagation : public interface { /// void read(const boost::program_options::variables_map& vm) override; - /// Set up a configuration object based on the command line options - /// - /// @param cfg The configuration object to fill - /// - void setup(detray::propagation::config& cfg) const; - /// Set up a configuration object based on the command line options - /// - /// @param cfg The configuration object to fill - /// - void setup(detray::propagation::config& cfg) const; - private: /// Print the specific options of this class std::ostream& print_impl(std::ostream& out) const override; diff --git a/examples/options/src/track_propagation.cpp b/examples/options/src/track_propagation.cpp index 286ccd6002..7cf6bbfb16 100644 --- a/examples/options/src/track_propagation.cpp +++ b/examples/options/src/track_propagation.cpp @@ -57,52 +57,10 @@ void track_propagation::read(const po::variables_map&) { config.navigation.search_window = m_search_window; } -void track_propagation::setup(detray::propagation::config& cfg) const { - - cfg = config; - return; -} - -void track_propagation::setup(detray::propagation::config& cfg) const { - - cfg.stepping.min_stepsize = config.stepping.min_stepsize; - cfg.stepping.rk_error_tol = config.stepping.rk_error_tol; - cfg.stepping.step_constraint = config.stepping.step_constraint; - cfg.stepping.path_limit = config.stepping.path_limit; - cfg.stepping.max_rk_updates = config.stepping.max_rk_updates; - cfg.stepping.use_mean_loss = config.stepping.use_mean_loss; - cfg.stepping.use_eloss_gradient = config.stepping.use_eloss_gradient; - cfg.stepping.use_field_gradient = config.stepping.use_field_gradient; - cfg.stepping.do_covariance_transport = - config.stepping.do_covariance_transport; - - cfg.navigation.min_mask_tolerance = config.navigation.min_mask_tolerance; - cfg.navigation.max_mask_tolerance = config.navigation.max_mask_tolerance; - cfg.navigation.on_surface_tolerance = - config.navigation.on_surface_tolerance; - cfg.navigation.overstep_tolerance = config.navigation.overstep_tolerance; - cfg.navigation.search_window[0] = config.navigation.search_window[0]; - cfg.navigation.search_window[1] = config.navigation.search_window[1]; - return; -} - std::ostream& track_propagation::print_impl(std::ostream& out) const { - out << " Constraint step size : " - << config.stepping.step_constraint / detray::unit::mm - << " [mm]\n" - << " Overstep tolerance : " - << config.navigation.overstep_tolerance / detray::unit::um - << " [um]\n" - << " Minimum mask tolerance: " - << config.navigation.min_mask_tolerance / detray::unit::mm - << " [mm]\n" - << " Maximum mask tolerance: " - << config.navigation.max_mask_tolerance / detray::unit::mm - << " [mm]\n" - << " Search window : " << config.navigation.search_window[0] - << " x " << config.navigation.search_window[1] << "\n" - << " Runge-Kutta tolerance : " << config.stepping.rk_error_tol; + out << config; + return out; } diff --git a/examples/run/common/throughput_mt.ipp b/examples/run/common/throughput_mt.ipp index 3b25ee36c7..a0d5e1ad0f 100644 --- a/examples/run/common/throughput_mt.ipp +++ b/examples/run/common/throughput_mt.ipp @@ -150,10 +150,10 @@ int throughput_mt(std::string_view description, int argc, char* argv[], finding_cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; finding_cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(finding_cfg.propagation); + finding_cfg.propagation = propagation_opts.config; typename FULL_CHAIN_ALG::fitting_algorithm::config_type fitting_cfg; - propagation_opts.setup(fitting_cfg.propagation); + fitting_cfg.propagation = propagation_opts.config; // Set up the full-chain algorithm(s). One for each thread. std::vector algs; diff --git a/examples/run/common/throughput_st.ipp b/examples/run/common/throughput_st.ipp index 5853db6c51..4a42721ddf 100644 --- a/examples/run/common/throughput_st.ipp +++ b/examples/run/common/throughput_st.ipp @@ -135,10 +135,10 @@ int throughput_st(std::string_view description, int argc, char* argv[], finding_cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; finding_cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(finding_cfg.propagation); + finding_cfg.propagation = propagation_opts.config; typename FULL_CHAIN_ALG::fitting_algorithm::config_type fitting_cfg; - propagation_opts.setup(fitting_cfg.propagation); + fitting_cfg.propagation = propagation_opts.config; // Set up the full-chain algorithm. std::unique_ptr alg = std::make_unique( diff --git a/examples/run/cpu/seeding_example.cpp b/examples/run/cpu/seeding_example.cpp index 37d1070e5a..61282e1e0e 100644 --- a/examples/run/cpu/seeding_example.cpp +++ b/examples/run/cpu/seeding_example.cpp @@ -145,14 +145,14 @@ int seq_run(const traccc::opts::track_seeding& seeding_opts, cfg.chi2_max = finding_opts.chi2_max; cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(cfg.propagation); + cfg.propagation = propagation_opts.config; traccc::finding_algorithm host_finding(cfg); // Fitting algorithm object typename traccc::fitting_algorithm::config_type fit_cfg; - propagation_opts.setup(fit_cfg.propagation); + fit_cfg.propagation = propagation_opts.config; traccc::fitting_algorithm host_fitting(fit_cfg); diff --git a/examples/run/cpu/seq_example.cpp b/examples/run/cpu/seq_example.cpp index f76f1c22a3..d67ab1e8fb 100644 --- a/examples/run/cpu/seq_example.cpp +++ b/examples/run/cpu/seq_example.cpp @@ -144,10 +144,10 @@ int seq_run(const traccc::opts::input_data& input_opts, finding_cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; finding_cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(finding_cfg.propagation); + finding_cfg.propagation = propagation_opts.config; fitting_algorithm::config_type fitting_cfg; - propagation_opts.setup(fitting_cfg.propagation); + fitting_cfg.propagation = propagation_opts.config; // Algorithms traccc::host::clusterization_algorithm ca(host_mr); diff --git a/examples/run/cpu/truth_finding_example.cpp b/examples/run/cpu/truth_finding_example.cpp index bd04c376d1..c3a4f52878 100644 --- a/examples/run/cpu/truth_finding_example.cpp +++ b/examples/run/cpu/truth_finding_example.cpp @@ -123,7 +123,7 @@ int seq_run(const traccc::opts::track_finding& finding_opts, cfg.chi2_max = finding_opts.chi2_max; cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(cfg.propagation); + cfg.propagation = propagation_opts.config; // Finding algorithm object traccc::finding_algorithm @@ -131,7 +131,7 @@ int seq_run(const traccc::opts::track_finding& finding_opts, // Fitting algorithm object typename traccc::fitting_algorithm::config_type fit_cfg; - propagation_opts.setup(fit_cfg.propagation); + fit_cfg.propagation = propagation_opts.config; traccc::fitting_algorithm host_fitting(fit_cfg); diff --git a/examples/run/cpu/truth_fitting_example.cpp b/examples/run/cpu/truth_fitting_example.cpp index a4d2b0f119..86f26e76da 100644 --- a/examples/run/cpu/truth_fitting_example.cpp +++ b/examples/run/cpu/truth_fitting_example.cpp @@ -116,7 +116,7 @@ int main(int argc, char* argv[]) { // Fitting algorithm object typename traccc::fitting_algorithm::config_type fit_cfg; - propagation_opts.setup(fit_cfg.propagation); + fit_cfg.propagation = propagation_opts.config; traccc::fitting_algorithm host_fitting(fit_cfg); diff --git a/examples/run/cuda/seeding_example_cuda.cpp b/examples/run/cuda/seeding_example_cuda.cpp index c3cec4fffb..27df1f4269 100644 --- a/examples/run/cuda/seeding_example_cuda.cpp +++ b/examples/run/cuda/seeding_example_cuda.cpp @@ -192,7 +192,7 @@ int seq_run(const traccc::opts::track_seeding& seeding_opts, cfg.chi2_max = finding_opts.chi2_max; cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(cfg.propagation); + cfg.propagation = propagation_opts.config; // Finding algorithm object traccc::finding_algorithm @@ -202,7 +202,7 @@ int seq_run(const traccc::opts::track_seeding& seeding_opts, // Fitting algorithm object typename traccc::fitting_algorithm::config_type fit_cfg; - propagation_opts.setup(fit_cfg.propagation); + fit_cfg.propagation = propagation_opts.config; traccc::fitting_algorithm host_fitting(fit_cfg); traccc::cuda::fitting_algorithm device_fitting( diff --git a/examples/run/cuda/seq_example_cuda.cpp b/examples/run/cuda/seq_example_cuda.cpp index 0fb70af4ba..8400b0f1b6 100644 --- a/examples/run/cuda/seq_example_cuda.cpp +++ b/examples/run/cuda/seq_example_cuda.cpp @@ -168,10 +168,10 @@ int seq_run(const traccc::opts::detector& detector_opts, finding_cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; finding_cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(finding_cfg.propagation); + finding_cfg.propagation = propagation_opts.config; host_fitting_algorithm::config_type fitting_cfg; - propagation_opts.setup(fitting_cfg.propagation); + fitting_cfg.propagation = propagation_opts.config; // Constant B field for the track finding and fitting const traccc::vector3 field_vec = {0.f, 0.f, diff --git a/examples/run/cuda/truth_finding_example_cuda.cpp b/examples/run/cuda/truth_finding_example_cuda.cpp index 0c6646ce3a..8b01656ee1 100644 --- a/examples/run/cuda/truth_finding_example_cuda.cpp +++ b/examples/run/cuda/truth_finding_example_cuda.cpp @@ -167,7 +167,7 @@ int seq_run(const traccc::opts::track_finding& finding_opts, cfg.chi2_max = finding_opts.chi2_max; cfg.max_num_branches_per_seed = finding_opts.nmax_per_seed; cfg.max_num_skipping_per_cand = finding_opts.max_num_skipping_per_cand; - propagation_opts.setup(cfg.propagation); + cfg.propagation = propagation_opts.config; // Finding algorithm object traccc::finding_algorithm @@ -177,7 +177,7 @@ int seq_run(const traccc::opts::track_finding& finding_opts, // Fitting algorithm object typename traccc::fitting_algorithm::config_type fit_cfg; - propagation_opts.setup(fit_cfg.propagation); + fit_cfg.propagation = propagation_opts.config; traccc::fitting_algorithm host_fitting(fit_cfg); traccc::cuda::fitting_algorithm device_fitting( diff --git a/examples/run/cuda/truth_fitting_example_cuda.cpp b/examples/run/cuda/truth_fitting_example_cuda.cpp index 2895a78a5c..dc494c1191 100644 --- a/examples/run/cuda/truth_fitting_example_cuda.cpp +++ b/examples/run/cuda/truth_fitting_example_cuda.cpp @@ -158,7 +158,7 @@ int main(int argc, char* argv[]) { // Fitting algorithm object typename traccc::fitting_algorithm::config_type fit_cfg; - propagation_opts.setup(fit_cfg.propagation); + fit_cfg.propagation = propagation_opts.config; traccc::fitting_algorithm host_fitting(fit_cfg); traccc::cuda::fitting_algorithm device_fitting( diff --git a/examples/simulation/simulate.cpp b/examples/simulation/simulate.cpp index c265b81192..0181a998e8 100644 --- a/examples/simulation/simulate.cpp +++ b/examples/simulation/simulate.cpp @@ -121,7 +121,7 @@ int main(int argc, char* argv[]) { generation_opts.events, host_det, field, std::move(generator), std::move(smearer_writer_cfg), full_path); - propagation_opts.setup(sim.get_config().propagation); + sim.get_config().propagation = propagation_opts.config; sim.run(); diff --git a/examples/simulation/simulate_telescope.cpp b/examples/simulation/simulate_telescope.cpp index 72c8f729cb..d5c902d237 100644 --- a/examples/simulation/simulate_telescope.cpp +++ b/examples/simulation/simulate_telescope.cpp @@ -132,7 +132,7 @@ int simulate(const traccc::opts::generation& generation_opts, writer_type>( generation_opts.events, det, field, std::move(generator), std::move(smearer_writer_cfg), full_path); - propagation_opts.setup(sim.get_config().propagation); + sim.get_config().propagation = propagation_opts.config; sim.run(); diff --git a/examples/simulation/simulate_toy_detector.cpp b/examples/simulation/simulate_toy_detector.cpp index 2c77b71675..b08b7d1859 100644 --- a/examples/simulation/simulate_toy_detector.cpp +++ b/examples/simulation/simulate_toy_detector.cpp @@ -56,7 +56,7 @@ int simulate(const traccc::opts::generation& generation_opts, auto field = detray::bfield::create_const_field(B); // Create the toy geometry - detray::toy_det_config toy_cfg{}; + detray::toy_det_config toy_cfg{}; toy_cfg.n_brl_layers(4u).n_edc_layers(7u); // @TODO: Increase the material budget again toy_cfg.module_mat_thickness(0.11 * detray::unit::mm); @@ -104,7 +104,7 @@ int simulate(const traccc::opts::generation& generation_opts, writer_type>( generation_opts.events, det, field, std::move(generator), std::move(smearer_writer_cfg), full_path); - propagation_opts.setup(sim.get_config().propagation); + sim.get_config().propagation = propagation_opts.config; sim.run(); diff --git a/examples/simulation/simulate_wire_chamber.cpp b/examples/simulation/simulate_wire_chamber.cpp index e8d486c6aa..b64625a60c 100644 --- a/examples/simulation/simulate_wire_chamber.cpp +++ b/examples/simulation/simulate_wire_chamber.cpp @@ -105,7 +105,7 @@ int simulate(const traccc::opts::generation& generation_opts, writer_type>( generation_opts.events, det, field, std::move(generator), std::move(smearer_writer_cfg), full_path); - propagation_opts.setup(sim.get_config().propagation); + sim.get_config().propagation = propagation_opts.config; sim.run(); diff --git a/extern/detray/CMakeLists.txt b/extern/detray/CMakeLists.txt index 7dab7c1e31..fda310e97c 100644 --- a/extern/detray/CMakeLists.txt +++ b/extern/detray/CMakeLists.txt @@ -18,7 +18,7 @@ message( STATUS "Building Detray as part of the TRACCC project" ) # Declare where to get Detray from. set( TRACCC_DETRAY_SOURCE -"URL;https://github.com/acts-project/detray/archive/refs/tags/v0.65.1.tar.gz;URL_MD5;fbf57a881565fa6019d79d13409b588f" +"URL;https://github.com/acts-project/detray/archive/refs/tags/v0.66.1.tar.gz;URL_MD5;000a0a36f953f74466c9e889261dd166" CACHE STRING "Source for Detray, when built as part of this project" ) mark_as_advanced( TRACCC_DETRAY_SOURCE ) diff --git a/simulation/include/traccc/simulation/simulator.hpp b/simulation/include/traccc/simulation/simulator.hpp index 2f582a6d97..22af5a666e 100644 --- a/simulation/include/traccc/simulation/simulator.hpp +++ b/simulation/include/traccc/simulation/simulator.hpp @@ -33,7 +33,7 @@ struct simulator { using scalar_type = typename detector_t::scalar_type; struct config { - detray::propagation::config propagation; + detray::propagation::config propagation; }; using algebra_type = typename detector_t::algebra_type; diff --git a/tests/common/tests/kalman_fitting_telescope_test.hpp b/tests/common/tests/kalman_fitting_telescope_test.hpp index 32e08d9e8c..b27e9439b5 100644 --- a/tests/common/tests/kalman_fitting_telescope_test.hpp +++ b/tests/common/tests/kalman_fitting_telescope_test.hpp @@ -83,6 +83,7 @@ class KalmanFittingTelescopeTests : public KalmanFittingTests { auto writer_cfg = detray::io::detector_writer_config{} .format(detray::io::format::json) .replace_files(true) + .write_material(true) .path(std::get<0>(GetParam())); detray::io::write_detector(det, name_map, writer_cfg); } diff --git a/tests/common/tests/kalman_fitting_toy_detector_test.hpp b/tests/common/tests/kalman_fitting_toy_detector_test.hpp index f7bda7ab09..9cbc64c2e8 100644 --- a/tests/common/tests/kalman_fitting_toy_detector_test.hpp +++ b/tests/common/tests/kalman_fitting_toy_detector_test.hpp @@ -56,7 +56,7 @@ class KalmanFittingToyDetectorTests : public KalmanFittingTests { virtual void SetUp() override { vecmem::host_memory_resource host_mr; - detray::toy_det_config toy_cfg{}; + detray::toy_det_config toy_cfg{}; toy_cfg.n_brl_layers(n_barrels).n_edc_layers(n_endcaps).do_check(false); // Create the toy geometry @@ -66,6 +66,8 @@ class KalmanFittingToyDetectorTests : public KalmanFittingTests { auto writer_cfg = detray::io::detector_writer_config{} .format(detray::io::format::json) .replace_files(true) + .write_grids(true) + .write_material(true) .path(std::get<0>(GetParam())); detray::io::write_detector(det, name_map, writer_cfg); } diff --git a/tests/common/tests/kalman_fitting_wire_chamber_test.hpp b/tests/common/tests/kalman_fitting_wire_chamber_test.hpp index c10240f6a9..4b10538e0f 100644 --- a/tests/common/tests/kalman_fitting_wire_chamber_test.hpp +++ b/tests/common/tests/kalman_fitting_wire_chamber_test.hpp @@ -82,6 +82,8 @@ class KalmanFittingWireChamberTests : public KalmanFittingTests { auto writer_cfg = detray::io::detector_writer_config{} .format(detray::io::format::json) .replace_files(true) + .write_grids(true) + .write_material(true) .path(std::get<0>(GetParam())); detray::io::write_detector(det, name_map, writer_cfg); } diff --git a/tests/cpu/test_simulation.cpp b/tests/cpu/test_simulation.cpp index 153d135afc..68d20de473 100644 --- a/tests/cpu/test_simulation.cpp +++ b/tests/cpu/test_simulation.cpp @@ -77,7 +77,7 @@ GTEST_TEST(traccc_simulation, toy_detector_simulation) { auto field = detray::bfield::create_const_field(B); // Create geometry - detray::toy_det_config toy_cfg{}; + detray::toy_det_config toy_cfg{}; const auto [detector, names] = detray::build_toy_detector(host_mr, toy_cfg); using geo_cxt_t = typename decltype(detector)::geometry_context;