From da3f58f0e2b7137e5e516a0249177d656f1c9c22 Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay Date: Tue, 5 Mar 2024 15:13:15 +0100 Subject: [PATCH 1/2] Unified the setup of the command line option reading code. Made all structs behave the same way, and introduced print operators for all of them. --- examples/options/CMakeLists.txt | 17 +-- .../include/traccc/options/common_options.hpp | 54 +++++++--- .../traccc/options/detector_input_options.hpp | 40 +++++-- .../traccc/options/finding_input_options.hpp | 71 ++++++------ .../options/full_tracking_input_options.hpp | 42 ++++++-- .../include/traccc/options/mt_options.hpp | 4 +- .../traccc/options/particle_gen_options.hpp | 101 +++++++----------- .../traccc/options/propagation_options.hpp | 75 ++++--------- .../traccc/options/seeding_input_options.hpp | 34 ++++-- .../options/telescope_detector_options.hpp | 91 +++++++--------- .../traccc/options/throughput_options.hpp | 11 +- .../options/src/options/common_options.cpp | 83 +++++++++----- .../src/options/detector_input_options.cpp | 41 ++++--- .../src/options/finding_input_options.cpp | 45 ++++++++ .../options/full_tracking_input_options.cpp | 31 ++++-- examples/options/src/options/mt_options.cpp | 9 +- .../src/options/particle_gen_options.cpp | 79 ++++++++++++++ .../src/options/propagation_options.cpp | 94 ++++++++++++++++ .../src/options/seeding_input_options.cpp | 23 +++- .../options/telescope_detector_options.cpp | 69 ++++++++++++ .../src/options/throughput_options.cpp | 83 +++++++------- 21 files changed, 740 insertions(+), 357 deletions(-) create mode 100644 examples/options/src/options/finding_input_options.cpp create mode 100644 examples/options/src/options/particle_gen_options.cpp create mode 100644 examples/options/src/options/propagation_options.cpp create mode 100644 examples/options/src/options/telescope_detector_options.cpp diff --git a/examples/options/CMakeLists.txt b/examples/options/CMakeLists.txt index bdae297a24..e989fbc7a5 100644 --- a/examples/options/CMakeLists.txt +++ b/examples/options/CMakeLists.txt @@ -1,6 +1,6 @@ # TRACCC library, part of the ACTS project (R&D line) # -# (c) 2022-2023 CERN for the benefit of the ACTS project +# (c) 2022-2024 CERN for the benefit of the ACTS project # # Mozilla Public License Version 2.0 @@ -9,23 +9,28 @@ traccc_add_library( traccc_options options TYPE SHARED # header files "include/traccc/options/common_options.hpp" "include/traccc/options/detector_input_options.hpp" + "include/traccc/options/finding_input_options.hpp" + "include/traccc/options/full_tracking_input_options.hpp" "include/traccc/options/handle_argument_errors.hpp" "include/traccc/options/mt_options.hpp" "include/traccc/options/options.hpp" "include/traccc/options/particle_gen_options.hpp" "include/traccc/options/propagation_options.hpp" - "include/traccc/options/finding_input_options.hpp" "include/traccc/options/seeding_input_options.hpp" - "include/traccc/options/full_tracking_input_options.hpp" + "include/traccc/options/telescope_detector_options.hpp" "include/traccc/options/throughput_options.hpp" # source files "src/options/common_options.cpp" "src/options/detector_input_options.cpp" + "src/options/finding_input_options.cpp" + "src/options/full_tracking_input_options.cpp" "src/options/handle_argument_errors.cpp" "src/options/mt_options.cpp" + "src/options/particle_gen_options.cpp" + "src/options/propagation_options.cpp" "src/options/seeding_input_options.cpp" - "src/options/full_tracking_input_options.cpp" + "src/options/telescope_detector_options.cpp" "src/options/throughput_options.cpp" ) -target_link_libraries( traccc_options PUBLIC traccc::io - traccc::performance Boost::program_options) \ No newline at end of file +target_link_libraries( traccc_options PUBLIC traccc::io + traccc::performance Boost::program_options) diff --git a/examples/options/include/traccc/options/common_options.hpp b/examples/options/include/traccc/options/common_options.hpp index c3b913342e..c497566710 100644 --- a/examples/options/include/traccc/options/common_options.hpp +++ b/examples/options/include/traccc/options/common_options.hpp @@ -8,24 +8,48 @@ // Project include(s) #include "traccc/io/data_format.hpp" -// Boost +// Boost include(s). #include -namespace traccc { +// System include(s). +#include +#include -namespace po = boost::program_options; +namespace traccc { +/// Common options for the example applications struct common_options { + + /// The input data format traccc::data_format input_data_format = traccc::data_format::csv; - std::string input_directory; - unsigned int events; - int skip; - unsigned short target_cells_per_partition; - bool check_performance; - bool perform_ambiguity_resolution; - - common_options(po::options_description& desc); - void read(const po::variables_map& vm); -}; - -} // namespace traccc \ No newline at end of file + /// The data input directory + std::string input_directory = "tml_full/ttbar_mu20/"; + /// The number of events to process + unsigned int events = 1; + /// The number of events to skip + unsigned int skip = 0; + /// The number of cells to merge in a partition + unsigned short target_cells_per_partition = 1024; + /// Whether to check the reconstructions performance + bool check_performance = false; + /// Whether to perform ambiguity resolution + bool perform_ambiguity_resolution = true; + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + common_options(boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); + +}; // struct common_options + +/// Printout helper for @c traccc::common_options +std::ostream& operator<<(std::ostream& out, const common_options& opt); + +} // namespace traccc diff --git a/examples/options/include/traccc/options/detector_input_options.hpp b/examples/options/include/traccc/options/detector_input_options.hpp index 37bc48aa93..f696877bde 100644 --- a/examples/options/include/traccc/options/detector_input_options.hpp +++ b/examples/options/include/traccc/options/detector_input_options.hpp @@ -1,24 +1,46 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2023 CERN for the benefit of the ACTS project + * (c) 2023-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// Boost +#pragma once + +// Boost include(s). #include -namespace traccc { +// System include(s). +#include +#include -namespace po = boost::program_options; +namespace traccc { +/// Options for the detector description struct detector_input_options { - std::string detector_file; + + /// The file containing the detector description + std::string detector_file = "tml_detector/trackml-detector.csv"; + /// The file containing the material description std::string material_file; + /// The file containing the surface grid description std::string grid_file; - detector_input_options(po::options_description& desc); - void read(const po::variables_map& vm); -}; + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + detector_input_options(boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); + +}; // struct detector_input_options + +/// Printout helper for @c traccc::detector_input_options +std::ostream& operator<<(std::ostream& out, const detector_input_options& opt); -} // namespace traccc \ No newline at end of file +} // namespace traccc diff --git a/examples/options/include/traccc/options/finding_input_options.hpp b/examples/options/include/traccc/options/finding_input_options.hpp index 6df90c5dd4..3ab11ad882 100644 --- a/examples/options/include/traccc/options/finding_input_options.hpp +++ b/examples/options/include/traccc/options/finding_input_options.hpp @@ -1,52 +1,49 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2023 CERN for the benefit of the ACTS project + * (c) 2023-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ +#pragma once + // Project include(s). #include "traccc/options/options.hpp" -// Boost +// Boost include(s). #include +// System include(s). +#include +#include + namespace traccc { -namespace po = boost::program_options; - -template -struct finding_input_config { - Reals track_candidates_range; - scalar_t chi2_max; - unsigned int nmax_per_seed; - - finding_input_config(po::options_description& desc) { - - desc.add_options()("track-candidates-range", - po::value>() - ->value_name("MIN:MAX") - ->default_value({3, 100}), - "Range of track candidates number"); - desc.add_options()( - "chi2-max", - po::value()->value_name("chi2-max")->default_value(30.f), - "Maximum Chi suqare that measurements can be included in the " - "track"); - desc.add_options()( - "nmax_per_seed", - po::value() - ->value_name("nmax_per_seed") - ->default_value(std::numeric_limits::max()), - "Maximum number of branches which each initial seed can have at a " - "step."); - } - void read(const po::variables_map& vm) { - track_candidates_range = - vm["track-candidates-range"].as>(); - chi2_max = vm["chi2-max"].as(); - nmax_per_seed = vm["nmax_per_seed"].as(); - } -}; +/// Configuration for track finding +struct finding_input_options { + + /// Number of track candidates per seed + Reals track_candidates_range{3, 100}; + /// Maximum chi2 for a measurement to be included in the track + float chi2_max = 30.f; + /// Maximum number of branches which each initial seed can have at a step + unsigned int nmax_per_seed = std::numeric_limits::max(); + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + finding_input_options(boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); + +}; // struct finding_input_options + +/// Printout helper for @c traccc::finding_input_options +std::ostream& operator<<(std::ostream& out, const finding_input_options& opt); } // namespace traccc diff --git a/examples/options/include/traccc/options/full_tracking_input_options.hpp b/examples/options/include/traccc/options/full_tracking_input_options.hpp index 0d39c01a50..a62ddd2b92 100644 --- a/examples/options/include/traccc/options/full_tracking_input_options.hpp +++ b/examples/options/include/traccc/options/full_tracking_input_options.hpp @@ -1,23 +1,45 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// Boost +#pragma once + +// Boost include(s). #include +// System include(s). +#include +#include + namespace traccc { -namespace po = boost::program_options; +/// Configuration for a full tracking chain +struct full_tracking_input_options { + + /// The digitization configuration file + std::string digitization_config_file = + "tml_detector/default-geometric-config-generic.json"; + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + full_tracking_input_options( + boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); -struct full_tracking_input_config { - std::string detector_file; - std::string digitization_config_file; +}; // struct full_tracking_input_config - full_tracking_input_config(po::options_description& desc); - void read(const po::variables_map& vm); -}; +/// Printout helper for @c traccc::full_tracking_input_options +std::ostream& operator<<(std::ostream& out, + const full_tracking_input_options& opt); -} // namespace traccc \ No newline at end of file +} // namespace traccc diff --git a/examples/options/include/traccc/options/mt_options.hpp b/examples/options/include/traccc/options/mt_options.hpp index e71f2f28ec..138bd961fd 100644 --- a/examples/options/include/traccc/options/mt_options.hpp +++ b/examples/options/include/traccc/options/mt_options.hpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -28,7 +28,7 @@ struct mt_options { /// mt_options(boost::program_options::options_description& desc); - /// Read the command line options + /// Read/process the command line options /// /// @param vm The command line options to interpret/read /// diff --git a/examples/options/include/traccc/options/particle_gen_options.hpp b/examples/options/include/traccc/options/particle_gen_options.hpp index 4be4d29b4e..032b10fc77 100644 --- a/examples/options/include/traccc/options/particle_gen_options.hpp +++ b/examples/options/include/traccc/options/particle_gen_options.hpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2023 CERN for the benefit of the ACTS project + * (c) 2023-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -9,75 +9,48 @@ // Project include(s). #include "traccc/options/options.hpp" -#include "traccc/utils/ranges.hpp" -// Detray include(s). -#include "detray/definitions/units.hpp" - -// Boost +// Boost include(s). #include -namespace traccc { +// System include(s). +#include -namespace po = boost::program_options; +namespace traccc { -template +/// Configuration for particle generation struct particle_gen_options { - unsigned int gen_nparticles{1}; - Reals vertex{0., 0., 0.}; - Reals vertex_stddev{0., 0., 0.}; - Reals mom_range{1., 1.}; - Reals phi_range{0., 0.}; - Reals theta_range{0., 0.}; - scalar_t charge{-1.f}; - particle_gen_options(po::options_description& desc) { - desc.add_options()("gen-nparticles", - po::value()->default_value(1), - "The number of particles to generate per event"); - desc.add_options()( - "gen-vertex-xyz-mm", - po::value>()->value_name("X:Y:Z")->default_value( - {{0.f, 0.f, 0.f}}), - "Vertex [mm]"); - desc.add_options()( - "gen-vertex-xyz-std-mm", - po::value>()->value_name("X:Y:Z")->default_value( - {{0.f, 0.f, 0.f}}), - "Standard deviation of the vertex [mm]"); - desc.add_options()("gen-mom-gev", - po::value>() - ->value_name("MIN:MAX") - ->default_value({1.f, 1.f}), - "Range of momentum [GeV]"); - desc.add_options()("gen-phi-degree", - po::value>() - ->value_name("MIN:MAX") - ->default_value({0.f, 0.f}), - "Range of phi [Degree]"); - desc.add_options()("gen-eta", - po::value>() - ->value_name("MIN:MAX") - ->default_value({0.f, 0.f}), - "Range of eta"); - desc.add_options()( - "charge", - po::value()->value_name("charge")->default_value(-1.f), - "Charge of particles"); - } - void read(const po::variables_map& vm) { - gen_nparticles = vm["gen-nparticles"].as(); - vertex = vm["gen-vertex-xyz-mm"].as>(); - vertex_stddev = vm["gen-vertex-xyz-std-mm"].as>(); - mom_range = vm["gen-mom-gev"].as>(); - const auto phi_range_degree = - vm["gen-phi-degree"].as>(); - const auto eta_range = vm["gen-eta"].as>(); - theta_range = eta_to_theta_range(eta_range); - phi_range = {phi_range_degree[0] * detray::unit::degree, - phi_range_degree[1] * detray::unit::degree}; - charge = vm["charge"].as(); - } -}; + /// The number of particles to generate per event + unsigned int gen_nparticles{1u}; + /// Vertex position [mm] + Reals vertex{0., 0., 0.}; + /// Standard deviation of the vertex position [mm] + Reals vertex_stddev{0., 0., 0.}; + /// Range of momentum [GeV] + Reals mom_range{1., 1.}; + /// Range of phi [rad] + Reals phi_range{0., 0.}; + /// Range of theta [rad] + Reals theta_range{0., 0.}; + /// Charge of particles + float charge{-1.f}; + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + particle_gen_options(boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); + +}; // struct particle_gen_options + +/// Printout helper for @c traccc::particle_gen_options +std::ostream& operator<<(std::ostream& out, const particle_gen_options& opt); } // namespace traccc \ No newline at end of file diff --git a/examples/options/include/traccc/options/propagation_options.hpp b/examples/options/include/traccc/options/propagation_options.hpp index 7aae1e027a..d6ce1a5346 100644 --- a/examples/options/include/traccc/options/propagation_options.hpp +++ b/examples/options/include/traccc/options/propagation_options.hpp @@ -7,73 +7,38 @@ #pragma once -// Project include(s). -#include "traccc/options/options.hpp" - // Detray include(s). -#include "detray/definitions/units.hpp" #include "detray/propagator/propagation_config.hpp" -// Boost +// Boost include(s). #include -// System -#include +// System include(s). +#include namespace traccc { -namespace po = boost::program_options; - -template +/// Command line options used in the propagation tests struct propagation_options { - detray::propagation::config propagation{}; + /// Propagation configuration object + detray::propagation::config propagation; + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + propagation_options(boost::program_options::options_description& desc); - propagation_options(po::options_description& desc) { - desc.add_options()("constraint-step-size-mm", - po::value()->default_value( - std::numeric_limits::max()), - "The constrained step size [mm]"); - desc.add_options()("overstep-tolerance-um", - po::value()->default_value(-100.f), - "The overstep tolerance [um]"); - desc.add_options()("mask-tolerance-um", - po::value()->default_value(15.f), - "The mask tolerance [um]"); - desc.add_options()("search_window", - po::value>()->multitoken(), - "Size of the grid surface search window"); - desc.add_options()("rk-tolerance", - po::value()->default_value(1e-4), - "The Runge-Kutta stepper tolerance"); - } + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); - void read(const po::variables_map& vm) { - propagation.stepping.step_constraint = - vm["constraint-step-size-mm"].as() * - detray::unit::mm; - propagation.navigation.overstep_tolerance = - vm["overstep-tolerance-um"].as() * - detray::unit::um; - propagation.navigation.mask_tolerance = - vm["mask-tolerance-um"].as() * detray::unit::um; - propagation.stepping.rk_error_tol = vm["rk-tolerance"].as(); +}; // struct propagation_options - // Grid neighborhood size - if (vm.count("search_window")) { - const auto window = - vm["search_window"].as>(); - if (window.size() != 2u) { - throw std::invalid_argument( - "Incorrect surface grid search window. Please provide two " - "integer distances."); - } - propagation.navigation.search_window = {window[0], window[1]}; - } else { - // default - propagation.navigation.search_window = {0u, 0u}; - } - } -}; +/// Printout helper for @c traccc::propagation_options +std::ostream& operator<<(std::ostream& out, const propagation_options& opt); } // namespace traccc diff --git a/examples/options/include/traccc/options/seeding_input_options.hpp b/examples/options/include/traccc/options/seeding_input_options.hpp index 771bcebf37..d13bf23d28 100644 --- a/examples/options/include/traccc/options/seeding_input_options.hpp +++ b/examples/options/include/traccc/options/seeding_input_options.hpp @@ -1,20 +1,38 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// Boost +#pragma once + +// Boost include(s). #include +// System include(s). +#include + namespace traccc { -namespace po = boost::program_options; +/// Command line options used in the seeding input tests +struct seeding_input_options { + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + seeding_input_options(boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); + +}; // struct seeding_input_options -struct seeding_input_config { - seeding_input_config(po::options_description& desc); - void read(const po::variables_map& vm); -}; +/// Printout helper for @c traccc::seeding_input_options +std::ostream& operator<<(std::ostream& out, const seeding_input_options& opt); -} // namespace traccc \ No newline at end of file +} // namespace traccc diff --git a/examples/options/include/traccc/options/telescope_detector_options.hpp b/examples/options/include/traccc/options/telescope_detector_options.hpp index 82712ee169..cb25a4fbec 100644 --- a/examples/options/include/traccc/options/telescope_detector_options.hpp +++ b/examples/options/include/traccc/options/telescope_detector_options.hpp @@ -1,64 +1,53 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2023 CERN for the benefit of the ACTS project + * (c) 2023-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// Project include(s). -#include "traccc/options/options.hpp" +#pragma once -// Detray include(s). -#include "detray/definitions/units.hpp" - -// Boost +// Boost include(s). #include -namespace traccc { +// System include(s). +#include -namespace po = boost::program_options; +namespace traccc { -template +/// Command line options used in the telescope detector tests struct telescope_detector_options { - bool empty_material; - unsigned int n_planes; - scalar_t thickness; - scalar_t spacing; - scalar_t smearing; - scalar_t half_length; - - telescope_detector_options(po::options_description& desc) { - desc.add_options()("empty-material", - po::value()->default_value(false), - "Build detector without materials"); - desc.add_options()("n-planes", - po::value()->default_value(9), - "Number of planes"); - desc.add_options()("thickness-mm", - po::value()->default_value(0.5f), - "Slab thickness in [mm]"); - desc.add_options()("spacing", - po::value()->default_value(20.f), - "Space between planes in [mm]"); - desc.add_options()("smearing-um", - po::value()->default_value(50.f), - "Measurement smearing in [um]"); - desc.add_options()("half-length-mm", - po::value()->default_value(1000000.f), - "Half length of plane [mm]"); - } - - void read(const po::variables_map& vm) { - empty_material = vm["empty-material"].as(); - n_planes = vm["n-planes"].as(); - thickness = - vm["thickness-mm"].as() * detray::unit::mm; - spacing = vm["spacing-mm"].as() * detray::unit::mm; - smearing = - vm["smearing-um"].as() * detray::unit::um; - half_length = - vm["half-length-mm"].as() * detray::unit::mm; - } -}; -} // namespace traccc \ No newline at end of file + /// Build detector without materials + bool empty_material = false; + /// Number of planes + unsigned int n_planes = 9; + /// Slab thickness in [mm] + float thickness = 0.5f; + /// Space between planes in [mm] + float spacing = 20.f; + /// Measurement smearing in [um] + float smearing = 50.f; + /// Half length of plane [mm] + float half_length = 1000000.f; + + /// Constructor on top of a common @c program_options object + /// + /// @param desc The program options to add to + /// + telescope_detector_options( + boost::program_options::options_description& desc); + + /// Read/process the command line options + /// + /// @param vm The command line options to interpret/read + /// + void read(const boost::program_options::variables_map& vm); + +}; // struct telescope_detector_options + +/// Printout helper for @c traccc::telescope_detector_options +std::ostream& operator<<(std::ostream& out, + const telescope_detector_options& opt); + +} // namespace traccc diff --git a/examples/options/include/traccc/options/throughput_options.hpp b/examples/options/include/traccc/options/throughput_options.hpp index f5cf4b56ec..e3c334ac0b 100644 --- a/examples/options/include/traccc/options/throughput_options.hpp +++ b/examples/options/include/traccc/options/throughput_options.hpp @@ -26,17 +26,18 @@ struct throughput_options { /// The data format of the input files data_format input_data_format = data_format::csv; /// Directory of the input files - std::string input_directory; + std::string input_directory = "tml_full/ttbar_mu20/"; /// The file describing the detector geometry - std::string detector_file; + std::string detector_file = "tml_detector/trackml-detector.csv"; /// The file describing the detector digitization configuration - std::string digitization_config_file; + std::string digitization_config_file = + "tml_detector/default-geometric-config-generic.json"; /// The average number of cells in each partition. /// Equal to the number of threads in the clusterization kernels multiplied /// by CELLS_PER_THREAD defined in clusterization. Adapt to different GPUs' /// capabilities. - unsigned short target_cells_per_partition; + unsigned short target_cells_per_partition = 1024; /// The number of input events to load into memory std::size_t loaded_events = 10; @@ -55,7 +56,7 @@ struct throughput_options { /// throughput_options(boost::program_options::options_description& desc); - /// Read the command line options + /// Read/process the command line options /// /// @param vm The command line options to interpret/read /// diff --git a/examples/options/src/options/common_options.cpp b/examples/options/src/options/common_options.cpp index e65858e6db..e70c139e2d 100644 --- a/examples/options/src/options/common_options.cpp +++ b/examples/options/src/options/common_options.cpp @@ -1,49 +1,82 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// options +// Project include(s). #include "traccc/options/common_options.hpp" +// System include(s). +#include + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +/// Type alias for the data format enumeration +using data_format_type = std::string; +/// Name of the data format option +static const char* data_format_option = "input-data-format"; + traccc::common_options::common_options(po::options_description& desc) { - desc.add_options()("input-csv", "Use csv input file"); - desc.add_options()("input-binary", "Use binary input file"); - desc.add_options()("input-directory", po::value()->required(), - "specify the directory of input data"); - desc.add_options()("events", po::value()->required(), + desc.add_options()(data_format_option, + po::value()->default_value("csv"), + "Format of the input file(s)"); + desc.add_options()( + "input-directory", + po::value(&input_directory)->default_value(input_directory), + "specify the directory of input data"); + desc.add_options()("events", po::value(&events)->default_value(events), "number of events"); - desc.add_options()("skip", po::value()->default_value(0), + desc.add_options()("skip", po::value(&skip)->default_value(skip), "number of events to skip"); desc.add_options()("target-cells-per-partition", - po::value()->default_value(1024), + po::value(&target_cells_per_partition) + ->default_value(target_cells_per_partition), "Number of cells to merge in a partition. Equal to the " "number of threads multiplied by CELLS_PER_THREAD " "defined in clusterization."); - desc.add_options()("check-performance", - po::value()->default_value(false), + desc.add_options()("check-performance", po::bool_switch(&check_performance), "generate performance result"); desc.add_options()("perform-ambiguity-resolution", - po::value()->default_value(true), + po::value(&perform_ambiguity_resolution) + ->default_value(perform_ambiguity_resolution), "perform ambiguity resolution"); } void traccc::common_options::read(const po::variables_map& vm) { - if (vm.count("input-csv")) { - input_data_format = traccc::data_format::csv; - } else if (vm.count("input-binary")) { - input_data_format = traccc::data_format::binary; + // Set the input data format. + if (vm.count(data_format_option)) { + const auto input_format_string = + vm[data_format_option].as(); + if (input_format_string == "csv") { + input_data_format = data_format::csv; + } else if (input_format_string == "binary") { + input_data_format = data_format::binary; + } else { + throw std::invalid_argument("Invalid input data format specified"); + } } - input_directory = vm["input-directory"].as(); - events = vm["events"].as(); - skip = vm["skip"].as(); - target_cells_per_partition = - vm["target-cells-per-partition"].as(); - check_performance = vm["check-performance"].as(); - perform_ambiguity_resolution = - vm["perform-ambiguity-resolution"].as(); -} \ No newline at end of file +} + +std::ostream& operator<<(std::ostream& out, const common_options& opt) { + + out << ">>> Common options <<<\n" + << " Input data format : " << opt.input_data_format << "\n" + << " Input directory : " << opt.input_directory << "\n" + << " Events : " << opt.events << "\n" + << " Skipped events : " << opt.skip << "\n" + << " Target cells per partition : " << opt.target_cells_per_partition + << "\n" + << " Check performance : " << opt.check_performance << "\n" + << " Perform ambiguity resolution : " + << opt.perform_ambiguity_resolution; + return out; +} + +} // namespace traccc diff --git a/examples/options/src/options/detector_input_options.cpp b/examples/options/src/options/detector_input_options.cpp index ace6b469d8..c63b8474fc 100644 --- a/examples/options/src/options/detector_input_options.cpp +++ b/examples/options/src/options/detector_input_options.cpp @@ -1,31 +1,44 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2023 CERN for the benefit of the ACTS project + * (c) 2023-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// options +// Project include(s). #include "traccc/options/detector_input_options.hpp" +// System include(s). +#include + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + traccc::detector_input_options::detector_input_options( po::options_description& desc) { - desc.add_options()("detector-file", po::value()->required(), + + desc.add_options()("detector-file", + po::value(&detector_file)->default_value(detector_file), "specify detector file"); desc.add_options()("material-file", - po::value()->default_value(""), + po::value(&material_file)->default_value(material_file), "specify material file"); - desc.add_options()("grid-file", po::value()->default_value(""), + desc.add_options()("grid-file", + po::value(&grid_file)->default_value(grid_file), "specify surface grid file"); } -void traccc::detector_input_options::read(const po::variables_map& vm) { +void traccc::detector_input_options::read(const po::variables_map&) {} + +std::ostream& operator<<(std::ostream& out, const detector_input_options& opt) { + + out << ">>> Detector options <<<\n" + << " Detector file : " << opt.detector_file << "\n" + << " Material file : " << opt.material_file << "\n" + << " Grid file : " << opt.grid_file; + return out; +} - detector_file = vm["detector-file"].as(); - if (vm.count("material-file")) { - material_file = vm["material-file"].as(); - } - if (vm.count("grid-file")) { - grid_file = vm["grid-file"].as(); - } -} \ No newline at end of file +} // namespace traccc diff --git a/examples/options/src/options/finding_input_options.cpp b/examples/options/src/options/finding_input_options.cpp new file mode 100644 index 0000000000..fd13bdbb32 --- /dev/null +++ b/examples/options/src/options/finding_input_options.cpp @@ -0,0 +1,45 @@ +/** TRACCC library, part of the ACTS project (R&D line) + * + * (c) 2023-2024 CERN for the benefit of the ACTS project + * + * Mozilla Public License Version 2.0 + */ + +// Project include(s). +#include "traccc/options/finding_input_options.hpp" + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +finding_input_options::finding_input_options(po::options_description& desc) { + + desc.add_options()("track-candidates-range", + po::value(&track_candidates_range) + ->value_name("MIN:MAX") + ->default_value(track_candidates_range), + "Range of track candidates number"); + desc.add_options()( + "chi2-max", po::value(&chi2_max)->default_value(chi2_max), + "Maximum Chi suqare that measurements can be included in the track"); + desc.add_options()( + "nmax_per_seed", + po::value(&nmax_per_seed)->default_value(nmax_per_seed), + "Maximum number of branches which each initial seed can have at a " + "step."); +} + +void finding_input_options::read(const po::variables_map&) {} + +std::ostream& operator<<(std::ostream& out, const finding_input_options& opt) { + + out << ">>> Track finding options <<<\n" + << " Track candidates range : " << opt.track_candidates_range + << "\n" + << " Maximum Chi2 : " << opt.chi2_max << "\n" + << " Maximum branches per step : " << opt.nmax_per_seed; + return out; +} + +} // namespace traccc diff --git a/examples/options/src/options/full_tracking_input_options.cpp b/examples/options/src/options/full_tracking_input_options.cpp index bb5d9208d8..f7d33f4586 100644 --- a/examples/options/src/options/full_tracking_input_options.cpp +++ b/examples/options/src/options/full_tracking_input_options.cpp @@ -1,20 +1,39 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ -// options +// Project include(s). #include "traccc/options/full_tracking_input_options.hpp" -traccc::full_tracking_input_config::full_tracking_input_config( +// System include(s). +#include + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +full_tracking_input_options::full_tracking_input_options( po::options_description& desc) { + desc.add_options()("digitization-config-file", - po::value()->required(), + po::value(&digitization_config_file) + ->default_value(digitization_config_file), "specify the digitization configuration file"); } -void traccc::full_tracking_input_config::read(const po::variables_map& vm) { - digitization_config_file = vm["digitization-config-file"].as(); +void full_tracking_input_options::read(const po::variables_map&) {} + +std::ostream& operator<<(std::ostream& out, + const full_tracking_input_options& opt) { + + out << ">>> Full tracking chain options <<<\n" + << " Digitization configuration file: " + << opt.digitization_config_file; + return out; } + +} // namespace traccc diff --git a/examples/options/src/options/mt_options.cpp b/examples/options/src/options/mt_options.cpp index c35d9c0fc3..3ccfa7b63d 100644 --- a/examples/options/src/options/mt_options.cpp +++ b/examples/options/src/options/mt_options.cpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -18,13 +18,12 @@ mt_options::mt_options(boost::program_options::options_description& desc) { desc.add_options()( "threads", - boost::program_options::value()->default_value(1), + boost::program_options::value(&threads)->default_value(threads), "The number of CPU threads to use"); } -void mt_options::read(const boost::program_options::variables_map& vm) { +void mt_options::read(const boost::program_options::variables_map&) { - threads = vm["threads"].as(); if (threads == 0) { throw std::invalid_argument{"Must use threads>0"}; } @@ -33,7 +32,7 @@ void mt_options::read(const boost::program_options::variables_map& vm) { std::ostream& operator<<(std::ostream& out, const mt_options& opt) { out << ">>> Multi-threading options <<<\n" - << "CPU threads: " << opt.threads; + << " CPU threads: " << opt.threads; return out; } diff --git a/examples/options/src/options/particle_gen_options.cpp b/examples/options/src/options/particle_gen_options.cpp new file mode 100644 index 0000000000..411c983c89 --- /dev/null +++ b/examples/options/src/options/particle_gen_options.cpp @@ -0,0 +1,79 @@ +/** TRACCC library, part of the ACTS project (R&D line) + * + * (c) 2023-2024 CERN for the benefit of the ACTS project + * + * Mozilla Public License Version 2.0 + */ + +// Project include(s). +#include "traccc/options/particle_gen_options.hpp" + +#include "traccc/utils/ranges.hpp" + +// Detray include(s). +#include "detray/definitions/units.hpp" + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +/// Type alias for the eta range argument +using eta_range_type = Reals; +/// Name of the eta range option +static const char* eta_range_option = "gen-eta"; + +particle_gen_options::particle_gen_options(po::options_description& desc) { + + desc.add_options()( + "gen-nparticles", + po::value(&gen_nparticles)->default_value(gen_nparticles), + "The number of particles to generate per event"); + desc.add_options()( + "gen-vertex-xyz-mm", + po::value(&vertex)->value_name("X:Y:Z")->default_value(vertex), + "Vertex [mm]"); + desc.add_options()("gen-vertex-xyz-std-mm", + po::value(&vertex_stddev) + ->value_name("X:Y:Z") + ->default_value(vertex_stddev), + "Standard deviation of the vertex [mm]"); + desc.add_options()( + "gen-mom-gev", + po::value(&mom_range)->value_name("MIN:MAX")->default_value(mom_range), + "Range of momentum [GeV]"); + desc.add_options()( + "gen-phi-degree", + po::value(&phi_range)->value_name("MIN:MAX")->default_value(phi_range), + "Range of phi [Degree]"); + desc.add_options()( + eta_range_option, + po::value()->value_name("MIN:MAX")->default_value( + {0.f, 0.f}), + "Range of eta"); + desc.add_options()("charge", po::value(&charge)->default_value(charge), + "Charge of particles"); +} + +void particle_gen_options::read(const po::variables_map& vm) { + + phi_range[0] *= detray::unit::degree; + phi_range[1] *= detray::unit::degree; + theta_range = eta_to_theta_range(vm[eta_range_option].as()); +} + +std::ostream& operator<<(std::ostream& out, const particle_gen_options& opt) { + + out << ">>> Particle generation options: <<<\n" + << " Number of particles to generate : " << opt.gen_nparticles << "\n" + << " Vertex : " << opt.vertex << " mm\n" + << " Vertex standard deviation : " << opt.vertex_stddev + << " mm\n" + << " Momentum range : " << opt.mom_range << " GeV\n" + << " Phi range : " << opt.phi_range << " rad\n" + << " Theta range : " << opt.theta_range << " rad\n" + << " Charge : " << opt.charge << "\n"; + return out; +} + +} // namespace traccc diff --git a/examples/options/src/options/propagation_options.cpp b/examples/options/src/options/propagation_options.cpp new file mode 100644 index 0000000000..45df1f2f76 --- /dev/null +++ b/examples/options/src/options/propagation_options.cpp @@ -0,0 +1,94 @@ +/** TRACCC library, part of the ACTS project (R&D line) + * + * (c) 2023-2024 CERN for the benefit of the ACTS project + * + * Mozilla Public License Version 2.0 + */ + +// Project include(s). +#include "traccc/options/propagation_options.hpp" + +// Detray include(s). +#include "detray/definitions/units.hpp" + +// System include(s). +#include +#include + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +/// Type alias for the search window argument +using search_window_argument_type = std::vector; +/// Name of the search window option +static const char* search_window_option = "search-window"; + +propagation_options::propagation_options(po::options_description& desc) { + + desc.add_options()("constraint-step-size-mm", + po::value(&(propagation.stepping.step_constraint)) + ->default_value(std::numeric_limits::max()), + "The constrained step size [mm]"); + desc.add_options()("overstep-tolerance-um", + po::value(&(propagation.navigation.overstep_tolerance)) + ->default_value(-100.f), + "The overstep tolerance [um]"); + desc.add_options()("mask-tolerance-um", + po::value(&(propagation.navigation.mask_tolerance)) + ->default_value(15.f), + "The mask tolerance [um]"); + desc.add_options()(search_window_option, + po::value()->multitoken(), + "Size of the grid surface search window"); + desc.add_options()( + "rk-tolerance", + po::value(&(propagation.stepping.rk_error_tol))->default_value(1e-4), + "The Runge-Kutta stepper tolerance"); +} + +void propagation_options::read(const po::variables_map& vm) { + + propagation.stepping.step_constraint *= detray::unit::mm; + propagation.navigation.overstep_tolerance *= detray::unit::um; + propagation.navigation.mask_tolerance *= detray::unit::um; + + // Set the search window parameter by hand, since boost::program_options + // does not support std::array options directly. + if (vm.count(search_window_option)) { + const auto window = + vm[search_window_option].as(); + if (window.size() != 2u) { + throw std::invalid_argument( + "Incorrect surface grid search window. Please provide two " + "integer distances."); + } + propagation.navigation.search_window = {window[0], window[1]}; + } else { + propagation.navigation.search_window = {0u, 0u}; + } +} + +std::ostream& operator<<(std::ostream& out, const propagation_options& opt) { + + out << ">>> Propagation options <<<\n" + << " Constraint step size : " + << opt.propagation.stepping.step_constraint / detray::unit::mm + << " [mm]\n" + << " Overstep tolerance : " + << opt.propagation.navigation.overstep_tolerance / + detray::unit::um + << " [um]\n" + << " Mask tolerance : " + << opt.propagation.navigation.mask_tolerance / detray::unit::um + << " [um]\n" + << " Search window : " + << opt.propagation.navigation.search_window[0] << " x " + << opt.propagation.navigation.search_window[1] << "\n" + << " Runge-Kutta tolerance : " << opt.propagation.stepping.rk_error_tol + << "\n"; + return out; +} + +} // namespace traccc diff --git a/examples/options/src/options/seeding_input_options.cpp b/examples/options/src/options/seeding_input_options.cpp index 53ae3d7c98..b9ded9af25 100644 --- a/examples/options/src/options/seeding_input_options.cpp +++ b/examples/options/src/options/seeding_input_options.cpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022-2023 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -8,7 +8,22 @@ // options #include "traccc/options/seeding_input_options.hpp" -traccc::seeding_input_config::seeding_input_config( - po::options_description& /*desc*/) {} +// System include(s). +#include -void traccc::seeding_input_config::read(const po::variables_map& /*vm*/) {} +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +seeding_input_options::seeding_input_options(po::options_description&) {} + +void seeding_input_options::read(const po::variables_map&) {} + +std::ostream& operator<<(std::ostream& out, const seeding_input_options&) { + + out << ">>> Seeding input options <<<"; + return out; +} + +} // namespace traccc diff --git a/examples/options/src/options/telescope_detector_options.cpp b/examples/options/src/options/telescope_detector_options.cpp new file mode 100644 index 0000000000..be9539beda --- /dev/null +++ b/examples/options/src/options/telescope_detector_options.cpp @@ -0,0 +1,69 @@ +/** TRACCC library, part of the ACTS project (R&D line) + * + * (c) 2023-2024 CERN for the benefit of the ACTS project + * + * Mozilla Public License Version 2.0 + */ + +// Project include(s). +#include "traccc/options/telescope_detector_options.hpp" + +// Detray include(s). +#include "detray/definitions/units.hpp" + +// System include(s). +#include + +namespace traccc { + +/// Convenience namespace shorthand +namespace po = boost::program_options; + +telescope_detector_options::telescope_detector_options( + po::options_description& desc) { + + desc.add_options()("empty-material", po::bool_switch(&empty_material), + "Build detector without materials"); + desc.add_options()("n-planes", + po::value(&n_planes)->default_value(n_planes), + "Number of planes"); + desc.add_options()("thickness-mm", + po::value(&thickness)->default_value(thickness), + "Slab thickness in [mm]"); + desc.add_options()("spacing", po::value(&spacing)->default_value(spacing), + "Space between planes in [mm]"); + desc.add_options()("smearing-um", + po::value(&smearing)->default_value(smearing), + "Measurement smearing in [um]"); + desc.add_options()("half-length-mm", + po::value(&half_length)->default_value(half_length), + "Half length of plane [mm]"); +} + +void telescope_detector_options::read(const po::variables_map&) { + + thickness *= detray::unit::mm; + spacing *= detray::unit::mm; + smearing *= detray::unit::um; + half_length *= detray::unit::mm; +} + +std::ostream& operator<<(std::ostream& out, + const telescope_detector_options& opt) { + + out << ">>> Telescope detector options <<<\n" + << " Empty material : " << (opt.empty_material ? "true" : "false") + << "\n" + << " Number of planes : " << opt.n_planes << "\n" + << " Slab thickness : " << opt.thickness / detray::unit::mm + << " [mm]\n" + << " Spacing : " << opt.spacing / detray::unit::mm + << " [mm]\n" + << " Smearing : " << opt.smearing / detray::unit::um + << " [um]\n" + << " Half length : " << opt.half_length / detray::unit::mm + << " [mm]"; + return out; +} + +} // namespace traccc diff --git a/examples/options/src/options/throughput_options.cpp b/examples/options/src/options/throughput_options.cpp index 83e720cf15..dab8cc3461 100644 --- a/examples/options/src/options/throughput_options.cpp +++ b/examples/options/src/options/throughput_options.cpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -14,47 +14,59 @@ namespace traccc { +/// Convenience namespace shorthand namespace po = boost::program_options; +/// Type alias for the data format enumeration +using data_format_type = std::string; +/// Name of the data format option +static const char* data_format_option = "input-data-format"; + throughput_options::throughput_options(po::options_description& desc) { - desc.add_options()("input-data-format", - po::value()->default_value("csv"), + desc.add_options()(data_format_option, + po::value()->default_value("csv"), "Format of the input file(s)"); - desc.add_options()("input_directory", po::value()->required(), - "Directory holding the input files"); - desc.add_options()("detector-file", po::value()->required(), + desc.add_options()( + "input-directory", + po::value(&input_directory)->default_value(input_directory), + "Directory holding the input files"); + desc.add_options()("detector-file", + po::value(&detector_file)->default_value(detector_file), "Detector geometry description file"); desc.add_options()("digitization-config-file", - po::value()->required(), + po::value(&digitization_config_file) + ->default_value(digitization_config_file), "Digitization configuration file"); desc.add_options()( "target-cells-per-partition", - po::value()->default_value(1024), + po::value(&target_cells_per_partition) + ->default_value(target_cells_per_partition), "Average number of cells in a partition. Equal to the number of " "threads in the clusterization kernels multiplied by CELLS_PER_THREAD " "defined in clusterization."); desc.add_options()("loaded-events", - po::value()->default_value(10), + po::value(&loaded_events)->default_value(loaded_events), "Number of input events to load"); - desc.add_options()("processed-events", - po::value()->default_value(100), - "Number of events to process"); - desc.add_options()("cold-run-events", - po::value()->default_value(10), - "Number of events to run 'cold'"); desc.add_options()( - "log-file", - po::value()->default_value( - "\0", "File where result logs will be printed (in append mode).")); + "processed-events", + po::value(&processed_events)->default_value(processed_events), + "Number of events to process"); + desc.add_options()( + "cold-run-events", + po::value(&cold_run_events)->default_value(cold_run_events), + "Number of events to run 'cold'"); + desc.add_options()( + "log-file", po::value(&log_file), + "File where result logs will be printed (in append mode)."); } void throughput_options::read(const po::variables_map& vm) { // Set the input data format. - if (vm.count("input-data-format")) { - const std::string input_format_string = - vm["input-data-format"].as(); + if (vm.count(data_format_option)) { + const auto input_format_string = + vm[data_format_option].as(); if (input_format_string == "csv") { input_data_format = data_format::csv; } else if (input_format_string == "binary") { @@ -63,33 +75,22 @@ void throughput_options::read(const po::variables_map& vm) { throw std::invalid_argument("Invalid input data format specified"); } } - - // Set the rest of the options. - input_directory = vm["input-directory"].as(); - detector_file = vm["detector-file"].as(); - digitization_config_file = vm["digitization-config-file"].as(); - target_cells_per_partition = - vm["target-cells-per-partition"].as(); - loaded_events = vm["loaded-events"].as(); - processed_events = vm["processed-events"].as(); - cold_run_events = vm["cold-run-events"].as(); - log_file = vm["log-file"].as(); } std::ostream& operator<<(std::ostream& out, const throughput_options& opt) { out << ">>> Throughput options <<<\n" - << "Input data format : " << opt.input_data_format << "\n" - << "Input directory : " << opt.input_directory << "\n" - << "Detector geometry : " << opt.detector_file << "\n" - << "Digitization config : " << opt.digitization_config_file + << " Input data format : " << opt.input_data_format << "\n" + << " Input directory : " << opt.input_directory << "\n" + << " Detector geometry : " << opt.detector_file << "\n" + << " Digitization config : " << opt.digitization_config_file << "\n" - << "Target cells per partition : " << opt.target_cells_per_partition + << " Target cells per partition : " << opt.target_cells_per_partition << "\n" - << "Loaded event(s) : " << opt.loaded_events << "\n" - << "Cold run event(s) : " << opt.cold_run_events << "\n" - << "Processed event(s) : " << opt.processed_events << "\n" - << "Log_file : " << opt.log_file; + << " Loaded event(s) : " << opt.loaded_events << "\n" + << " Cold run event(s) : " << opt.cold_run_events << "\n" + << " Processed event(s) : " << opt.processed_events << "\n" + << " Log_file : " << opt.log_file; return out; } From 93dc0d127fa4cc57dea28b43d278a9fe3e4cdac1 Mon Sep 17 00:00:00 2001 From: Attila Krasznahorkay Date: Tue, 5 Mar 2024 15:14:29 +0100 Subject: [PATCH 2/2] Updated the example applications for the modified "options code". Made all of the applications print their configuration parameters in a uniform way, using the helper code introduced with the "options code". --- .../run/alpaka/seeding_example_alpaka.cpp | 32 +++++++++++-------- examples/run/cpu/seeding_example.cpp | 21 +++++++----- examples/run/cpu/seq_example.cpp | 12 ++++--- examples/run/cpu/truth_finding_example.cpp | 17 ++++++---- examples/run/cpu/truth_fitting_example.cpp | 10 ++++-- examples/run/cuda/seeding_example_cuda.cpp | 21 +++++++----- examples/run/cuda/seq_example_cuda.cpp | 12 ++++--- .../run/cuda/truth_finding_example_cuda.cpp | 17 ++++++---- .../run/cuda/truth_fitting_example_cuda.cpp | 10 ++++-- .../run/kokkos/seeding_example_kokkos.cpp | 13 +++++--- examples/run/sycl/seeding_example_sycl.sycl | 11 ++++--- examples/run/sycl/seq_example_sycl.sycl | 14 ++++---- examples/simulation/simulate.cpp | 4 +-- examples/simulation/simulate_telescope.cpp | 12 +++---- examples/simulation/simulate_toy_detector.cpp | 8 ++--- examples/simulation/simulate_wire_chamber.cpp | 8 ++--- 16 files changed, 133 insertions(+), 89 deletions(-) diff --git a/examples/run/alpaka/seeding_example_alpaka.cpp b/examples/run/alpaka/seeding_example_alpaka.cpp index e37d4fa115..b8acc311c7 100644 --- a/examples/run/alpaka/seeding_example_alpaka.cpp +++ b/examples/run/alpaka/seeding_example_alpaka.cpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2023 CERN for the benefit of the ACTS project + * (c) 2023-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -61,12 +61,11 @@ using namespace traccc; namespace po = boost::program_options; -int seq_run( - const traccc::seeding_input_config& /*i_cfg*/, - const traccc::finding_input_config& /*finding_cfg*/, - const traccc::propagation_options& /*propagation_opts*/, - const traccc::common_options& common_opts, - const traccc::detector_input_options& det_opts, bool run_cpu) { +int seq_run(const traccc::seeding_input_options& /*i_cfg*/, + const traccc::finding_input_options& /*finding_cfg*/, + const traccc::propagation_options& /*propagation_opts*/, + const traccc::common_options& common_opts, + const traccc::detector_input_options& det_opts, bool run_cpu) { using host_detector_type = detray::detector<>; @@ -318,9 +317,9 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::seeding_input_config seeding_input_cfg(desc); - traccc::finding_input_config finding_input_cfg(desc); - traccc::propagation_options propagation_opts(desc); + traccc::seeding_input_options seeding_input_cfg(desc); + traccc::finding_input_options finding_input_cfg(desc); + traccc::propagation_options propagation_opts(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -334,12 +333,17 @@ int main(int argc, char* argv[]) { common_opts.read(vm); det_opts.read(vm); seeding_input_cfg.read(vm); - // finding_input_cfg.read(vm); - // propagation_opts.read(vm); + finding_input_cfg.read(vm); + propagation_opts.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " << det_opts.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the tracking chain using Alpaka\n\n" + << common_opts << "\n" + << det_opts << "\n" + << seeding_input_cfg << "\n" + << finding_input_cfg << "\n" + << propagation_opts << "\n" << std::endl; return seq_run(seeding_input_cfg, finding_input_cfg, propagation_opts, diff --git a/examples/run/cpu/seeding_example.cpp b/examples/run/cpu/seeding_example.cpp index f1b2acecd6..ee7d6a6aae 100644 --- a/examples/run/cpu/seeding_example.cpp +++ b/examples/run/cpu/seeding_example.cpp @@ -53,9 +53,9 @@ using namespace traccc; namespace po = boost::program_options; -int seq_run(const traccc::seeding_input_config& /*i_cfg*/, - const traccc::finding_input_config& finding_cfg, - const traccc::propagation_options& propagation_opts, +int seq_run(const traccc::seeding_input_options& /*i_cfg*/, + const traccc::finding_input_options& finding_cfg, + const traccc::propagation_options& propagation_opts, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts) { @@ -272,9 +272,9 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::seeding_input_config seeding_input_cfg(desc); - traccc::finding_input_config finding_input_cfg(desc); - traccc::propagation_options propagation_opts(desc); + traccc::seeding_input_options seeding_input_cfg(desc); + traccc::finding_input_options finding_input_cfg(desc); + traccc::propagation_options propagation_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -289,8 +289,13 @@ int main(int argc, char* argv[]) { finding_input_cfg.read(vm); propagation_opts.read(vm); - std::cout << "Running " << argv[0] << " " << det_opts.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the tracking chain on the host\n\n" + << common_opts << "\n" + << det_opts << "\n" + << seeding_input_cfg << "\n" + << finding_input_cfg << "\n" + << propagation_opts << "\n" << std::endl; return seq_run(seeding_input_cfg, finding_input_cfg, propagation_opts, diff --git a/examples/run/cpu/seq_example.cpp b/examples/run/cpu/seq_example.cpp index 709c9453e4..8e973df89b 100644 --- a/examples/run/cpu/seq_example.cpp +++ b/examples/run/cpu/seq_example.cpp @@ -34,7 +34,7 @@ namespace po = boost::program_options; -int seq_run(const traccc::full_tracking_input_config& i_cfg, +int seq_run(const traccc::full_tracking_input_options& i_cfg, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts) { @@ -162,7 +162,7 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::full_tracking_input_config full_tracking_input_cfg(desc); + traccc::full_tracking_input_options full_tracking_input_cfg(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -175,9 +175,11 @@ int main(int argc, char* argv[]) { det_opts.read(vm); full_tracking_input_cfg.read(vm); - std::cout << "Running " << argv[0] << " " - << full_tracking_input_cfg.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the full tracking chain on the host\n\n" + << common_opts << "\n" + << det_opts << "\n" + << full_tracking_input_cfg << "\n" << std::endl; return seq_run(full_tracking_input_cfg, common_opts, det_opts); diff --git a/examples/run/cpu/truth_finding_example.cpp b/examples/run/cpu/truth_finding_example.cpp index 64b5a01e0d..57ce07f345 100644 --- a/examples/run/cpu/truth_finding_example.cpp +++ b/examples/run/cpu/truth_finding_example.cpp @@ -43,8 +43,8 @@ using namespace traccc; namespace po = boost::program_options; -int seq_run(const traccc::finding_input_config& i_cfg, - const traccc::propagation_options& propagation_opts, +int seq_run(const traccc::finding_input_options& i_cfg, + const traccc::propagation_options& propagation_opts, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts) { @@ -203,8 +203,8 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::finding_input_config finding_input_cfg(desc); - traccc::propagation_options propagation_opts(desc); + traccc::finding_input_options finding_input_cfg(desc); + traccc::propagation_options propagation_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -218,8 +218,13 @@ int main(int argc, char* argv[]) { finding_input_cfg.read(vm); propagation_opts.read(vm); - std::cout << "Running " << argv[0] << " " << common_opts.input_directory - << " " << common_opts.events << std::endl; + // Tell the user what's happening. + std::cout << "\nRunning truth track finding on the host\n\n" + << common_opts << "\n" + << det_opts << "\n" + << finding_input_cfg << "\n" + << propagation_opts << "\n" + << std::endl; return seq_run(finding_input_cfg, propagation_opts, common_opts, det_opts); } diff --git a/examples/run/cpu/truth_fitting_example.cpp b/examples/run/cpu/truth_fitting_example.cpp index 0479aa74b0..d22f8d253c 100644 --- a/examples/run/cpu/truth_fitting_example.cpp +++ b/examples/run/cpu/truth_fitting_example.cpp @@ -50,7 +50,7 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::propagation_options propagation_opts(desc); + traccc::propagation_options propagation_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); @@ -64,8 +64,12 @@ int main(int argc, char* argv[]) { propagation_opts.read(vm); - std::cout << "Running " << argv[0] << " " << common_opts.input_directory - << " " << common_opts.events << std::endl; + // Tell the user what's happening. + std::cout << "\nRunning truth track fitting on the host\n\n" + << common_opts << "\n" + << det_opts << "\n" + << propagation_opts << "\n" + << std::endl; /// Type declarations using host_detector_type = detray::detector& finding_cfg, - const traccc::propagation_options& propagation_opts, +int seq_run(const traccc::seeding_input_options& /*i_cfg*/, + const traccc::finding_input_options& finding_cfg, + const traccc::propagation_options& propagation_opts, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts, bool run_cpu) { @@ -485,9 +485,9 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::seeding_input_config seeding_input_cfg(desc); - traccc::finding_input_config finding_input_cfg(desc); - traccc::propagation_options propagation_opts(desc); + traccc::seeding_input_options seeding_input_cfg(desc); + traccc::finding_input_options finding_input_cfg(desc); + traccc::propagation_options propagation_opts(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -505,8 +505,13 @@ int main(int argc, char* argv[]) { propagation_opts.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " << det_opts.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the tracking chain using CUDA\n\n" + << common_opts << "\n" + << det_opts << "\n" + << seeding_input_cfg << "\n" + << finding_input_cfg << "\n" + << propagation_opts << "\n" << std::endl; return seq_run(seeding_input_cfg, finding_input_cfg, propagation_opts, diff --git a/examples/run/cuda/seq_example_cuda.cpp b/examples/run/cuda/seq_example_cuda.cpp index b8480fb6bd..fe5810923b 100644 --- a/examples/run/cuda/seq_example_cuda.cpp +++ b/examples/run/cuda/seq_example_cuda.cpp @@ -39,7 +39,7 @@ namespace po = boost::program_options; -int seq_run(const traccc::full_tracking_input_config& i_cfg, +int seq_run(const traccc::full_tracking_input_options& i_cfg, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts, bool run_cpu) { @@ -308,7 +308,7 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::full_tracking_input_config full_tracking_input_cfg(desc); + traccc::full_tracking_input_options full_tracking_input_cfg(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -324,9 +324,11 @@ int main(int argc, char* argv[]) { full_tracking_input_cfg.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " - << full_tracking_input_cfg.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the full tracking chain using CUDA\n\n" + << common_opts << "\n" + << det_opts << "\n" + << full_tracking_input_cfg << "\n" << std::endl; return seq_run(full_tracking_input_cfg, common_opts, det_opts, run_cpu); diff --git a/examples/run/cuda/truth_finding_example_cuda.cpp b/examples/run/cuda/truth_finding_example_cuda.cpp index 660f45781a..af6ae51a94 100644 --- a/examples/run/cuda/truth_finding_example_cuda.cpp +++ b/examples/run/cuda/truth_finding_example_cuda.cpp @@ -55,8 +55,8 @@ using namespace traccc; namespace po = boost::program_options; -int seq_run(const traccc::finding_input_config& i_cfg, - const traccc::propagation_options& propagation_opts, +int seq_run(const traccc::finding_input_options& i_cfg, + const traccc::propagation_options& propagation_opts, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts, bool run_cpu) { @@ -360,8 +360,8 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::finding_input_config finding_input_cfg(desc); - traccc::propagation_options propagation_opts(desc); + traccc::finding_input_options finding_input_cfg(desc); + traccc::propagation_options propagation_opts(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -379,8 +379,13 @@ int main(int argc, char* argv[]) { propagation_opts.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " << common_opts.input_directory - << " " << common_opts.events << std::endl; + // Tell the user what's happening. + std::cout << "\nRunning truth track finding using CUDA\n\n" + << common_opts << "\n" + << det_opts << "\n" + << finding_input_cfg << "\n" + << propagation_opts << "\n" + << std::endl; return seq_run(finding_input_cfg, propagation_opts, common_opts, det_opts, run_cpu); diff --git a/examples/run/cuda/truth_fitting_example_cuda.cpp b/examples/run/cuda/truth_fitting_example_cuda.cpp index 2aced2cb0b..470214b465 100644 --- a/examples/run/cuda/truth_fitting_example_cuda.cpp +++ b/examples/run/cuda/truth_fitting_example_cuda.cpp @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::propagation_options propagation_opts(desc); + traccc::propagation_options propagation_opts(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -78,8 +78,12 @@ int main(int argc, char* argv[]) { propagation_opts.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " << common_opts.input_directory - << " " << common_opts.events << std::endl; + // Tell the user what's happening. + std::cout << "\nRunning truth track fitting using CUDA\n\n" + << common_opts << "\n" + << det_opts << "\n" + << propagation_opts << "\n" + << std::endl; /// Type declarations using host_detector_type = detray::detector()->default_value(false), "run cpu tracking as well"); @@ -173,8 +173,11 @@ int main(int argc, char* argv[]) { seeding_input_cfg.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " << det_opts.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the tracking chain using Kokkos\n\n" + << common_opts << "\n" + << det_opts << "\n" + << seeding_input_cfg << "\n" << std::endl; int ret = seq_run(seeding_input_cfg, common_opts, det_opts, run_cpu); diff --git a/examples/run/sycl/seeding_example_sycl.sycl b/examples/run/sycl/seeding_example_sycl.sycl index ebe66f124f..a5d7d311e8 100644 --- a/examples/run/sycl/seeding_example_sycl.sycl +++ b/examples/run/sycl/seeding_example_sycl.sycl @@ -50,7 +50,7 @@ namespace po = boost::program_options; -int seq_run(const traccc::seeding_input_config& /*i_cfg*/, +int seq_run(const traccc::seeding_input_options& /*i_cfg*/, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts, bool run_cpu) { @@ -279,7 +279,7 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::seeding_input_config seeding_input_cfg(desc); + traccc::seeding_input_options seeding_input_cfg(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -296,8 +296,11 @@ int main(int argc, char* argv[]) { seeding_input_cfg.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " << det_opts.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the tracking chain using SYCL\n\n" + << common_opts << "\n" + << det_opts << "\n" + << seeding_input_cfg << "\n" << std::endl; return seq_run(seeding_input_cfg, common_opts, det_opts, run_cpu); diff --git a/examples/run/sycl/seq_example_sycl.sycl b/examples/run/sycl/seq_example_sycl.sycl index f7358cbf22..a5e6c0a81f 100644 --- a/examples/run/sycl/seq_example_sycl.sycl +++ b/examples/run/sycl/seq_example_sycl.sycl @@ -63,7 +63,7 @@ auto handle_async_error = [](::sycl::exception_list elist) { } }; -int seq_run(const traccc::full_tracking_input_config& i_cfg, +int seq_run(const traccc::full_tracking_input_options& i_cfg, const traccc::common_options& common_opts, const traccc::detector_input_options& det_opts, bool run_cpu) { @@ -334,7 +334,7 @@ int main(int argc, char* argv[]) { desc.add_options()("help,h", "Give some help with the program's options"); traccc::common_options common_opts(desc); traccc::detector_input_options det_opts(desc); - traccc::full_tracking_input_config full_tracking_input_cfg(desc); + traccc::full_tracking_input_options full_tracking_input_cfg(desc); desc.add_options()("run-cpu", po::value()->default_value(false), "run cpu tracking as well"); @@ -350,10 +350,12 @@ int main(int argc, char* argv[]) { full_tracking_input_cfg.read(vm); auto run_cpu = vm["run-cpu"].as(); - std::cout << "Running " << argv[0] << " " - << full_tracking_input_cfg.detector_file << " " - << common_opts.input_directory << " " << common_opts.events + // Tell the user what's happening. + std::cout << "\nRunning the full tracking chain using SYCL\n\n" + << common_opts << "\n" + << det_opts << "\n" + << full_tracking_input_cfg << "\n" << std::endl; return seq_run(full_tracking_input_cfg, common_opts, det_opts, run_cpu); -} \ No newline at end of file +} diff --git a/examples/simulation/simulate.cpp b/examples/simulation/simulate.cpp index 77bb4d3c74..91cf17c6b6 100644 --- a/examples/simulation/simulate.cpp +++ b/examples/simulation/simulate.cpp @@ -52,8 +52,8 @@ int main(int argc, char* argv[]) { desc.add_options()("events", po::value()->required(), "number of events"); traccc::detector_input_options det_opts(desc); - traccc::particle_gen_options pg_opts(desc); - traccc::propagation_options propagation_opts(desc); + traccc::particle_gen_options pg_opts(desc); + traccc::propagation_options propagation_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); diff --git a/examples/simulation/simulate_telescope.cpp b/examples/simulation/simulate_telescope.cpp index 1c7cea33c8..7eb42a4eeb 100644 --- a/examples/simulation/simulate_telescope.cpp +++ b/examples/simulation/simulate_telescope.cpp @@ -39,9 +39,9 @@ using namespace traccc; namespace po = boost::program_options; int simulate(std::string output_directory, unsigned int events, - const traccc::particle_gen_options& pg_opts, - const traccc::propagation_options& propagation_opts, - const traccc::telescope_detector_options& telescope_opts) { + const traccc::particle_gen_options& pg_opts, + const traccc::propagation_options& propagation_opts, + const traccc::telescope_detector_options& telescope_opts) { // Use deterministic random number generator for testing using uniform_gen_t = @@ -156,9 +156,9 @@ int main(int argc, char* argv[]) { "specify the directory of output data"); desc.add_options()("events", po::value()->required(), "number of events"); - traccc::particle_gen_options pg_opts(desc); - traccc::propagation_options propagation_opts(desc); - traccc::telescope_detector_options telescope_opts(desc); + traccc::particle_gen_options pg_opts(desc); + traccc::propagation_options propagation_opts(desc); + traccc::telescope_detector_options telescope_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); diff --git a/examples/simulation/simulate_toy_detector.cpp b/examples/simulation/simulate_toy_detector.cpp index 8fc9e016bd..8c9be4b4f2 100644 --- a/examples/simulation/simulate_toy_detector.cpp +++ b/examples/simulation/simulate_toy_detector.cpp @@ -34,8 +34,8 @@ using namespace traccc; namespace po = boost::program_options; int simulate(std::string output_directory, unsigned int events, - const traccc::particle_gen_options& pg_opts, - const traccc::propagation_options& propagation_opts) { + const traccc::particle_gen_options& pg_opts, + const traccc::propagation_options& propagation_opts) { // Use deterministic random number generator for testing using uniform_gen_t = @@ -124,8 +124,8 @@ int main(int argc, char* argv[]) { "specify the directory of output data"); desc.add_options()("events", po::value()->required(), "number of events"); - traccc::particle_gen_options pg_opts(desc); - traccc::propagation_options propagation_opts(desc); + traccc::particle_gen_options pg_opts(desc); + traccc::propagation_options propagation_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm); diff --git a/examples/simulation/simulate_wire_chamber.cpp b/examples/simulation/simulate_wire_chamber.cpp index b18ec6f635..11378a2a01 100644 --- a/examples/simulation/simulate_wire_chamber.cpp +++ b/examples/simulation/simulate_wire_chamber.cpp @@ -34,8 +34,8 @@ using namespace traccc; namespace po = boost::program_options; int simulate(std::string output_directory, unsigned int events, - const traccc::particle_gen_options& pg_opts, - const traccc::propagation_options& propagation_opts) { + const traccc::particle_gen_options& pg_opts, + const traccc::propagation_options& propagation_opts) { // Use deterministic random number generator for testing using uniform_gen_t = @@ -129,8 +129,8 @@ int main(int argc, char* argv[]) { "specify the directory of output data"); desc.add_options()("events", po::value()->required(), "number of events"); - traccc::particle_gen_options pg_opts(desc); - traccc::propagation_options propagation_opts(desc); + traccc::particle_gen_options pg_opts(desc); + traccc::propagation_options propagation_opts(desc); po::variables_map vm; po::store(po::parse_command_line(argc, argv, desc), vm);