21 #include <boost/program_options.hpp>
23 namespace po = boost::program_options;
25 using namespace Acts::UnitLiterals;
27 int main(
int argc,
char* argv[]) {
28 unsigned int toys = 1;
31 double maxPathInM = 1;
40 po::options_description desc(
"Allowed options");
43 (
"help",
"produce help message")
44 (
"toys",po::value<unsigned int>(&toys)->default_value(20000),
"number of tracks to propagate")
45 (
"pT",po::value<double>(&ptInGeV)->default_value(1),
"transverse momentum in GeV")
46 (
"B",po::value<double>(&BzInT)->default_value(2),
"z-component of B-field in T")
47 (
"path",po::value<double>(&maxPathInM)->default_value(5),
"maximum path length in m")
48 (
"cov",po::value<bool>(&withCov)->default_value(
true),
"propagation with covariance matrix")
49 (
"verbose",po::value<unsigned int>(&lvl)->default_value(
Acts::Logging::INFO),
"logging level");
52 po::store(po::parse_command_line(argc, argv, desc), vm);
55 if (vm.count(
"help") != 0
u) {
56 std::cout << desc << std::endl;
59 }
catch (std::exception&
e) {
60 std::cerr <<
"error: " << e.what() << std::endl;
68 ACTS_INFO(
"propagating " << toys <<
" tracks with pT = " << ptInGeV
69 <<
"GeV in a " << BzInT <<
"T B-field");
79 Propagator_type propagator(
std::move(atlas_stepper));
88 cov << 10_mm, 0, 0, 0, 0, 0,
92 0, 0, 0, 0, 1_e / 10_GeV, 0,
96 std::optional<Covariance> covOpt = std::nullopt;
103 double totalPathLength = 0;
104 size_t num_iters = 0;
107 auto r = propagator.propagate(pars, options).value();
108 if (totalPathLength == 0.) {
110 <<
r.endParameters->position(tgContext).transpose()
111 <<
" in " <<
r.steps <<
" steps");
113 totalPathLength +=
r.pathLength;
119 ACTS_INFO(
"Execution stats: " << propagation_bench_result);
120 ACTS_INFO(
"average path length = " << totalPathLength / num_iters / 1_mm