Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
niermann999 committed Sep 24, 2024
1 parent 5127dcd commit 14bf98e
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions benchmarks/common/benchmarks/toy_detector_benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
traccc::seedfinder_config seeding_cfg;
traccc::seedfilter_config filter_cfg;
traccc::spacepoint_grid_config grid_cfg{seeding_cfg};
traccc::finding_config finding_cfg;
traccc::finding_config finding_cfg = get_trk_finding_config();
traccc::fitting_config fitting_cfg;

static constexpr std::array<float, 2> phi_range{
-traccc::constant<float>::pi, traccc::constant<float>::pi};
static constexpr std::array<float, 2> theta_range{
0.f, traccc::constant<float>::pi};
static constexpr std::array<float, 2> eta_range{-3, 3};
static constexpr std::array<float, 2> mom_range{
10.f * traccc::unit<float>::GeV, 100.f * traccc::unit<float>::GeV};

Expand Down Expand Up @@ -101,7 +100,7 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
generator_type::configuration gen_cfg{};
gen_cfg.n_tracks(n_tracks);
gen_cfg.phi_range(phi_range);
gen_cfg.theta_range(theta_range);
gen_cfg.eta_range(eta_range);
gen_cfg.mom_range(mom_range);
generator_type generator(gen_cfg);

Expand Down Expand Up @@ -130,6 +129,8 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
// Set constrained step size to 1 mm
sim.get_config().propagation.stepping.step_constraint =
1.f * detray::unit<traccc::scalar>::mm;
// Otherwise same propagation configuration for sim and reco
sim.get_config().propagation = finding_cfg.propagation;

sim.run();

Expand All @@ -155,6 +156,18 @@ class ToyDetectorBenchmark : public benchmark::Fixture {
return toy_cfg;
}

traccc::finding_config get_trk_finding_config() const {

traccc::finding_config finding_cfg{};

// Configure the propagation for the toy detector
finding_cfg.propagation.navigation.search_window = {3, 3};
finding_cfg.propagation.navigation.overstep_tolerance =
-300.f * detray::unit<traccc::scalar>::um;

return finding_cfg;
}

void SetUp(::benchmark::State& /*state*/) {

// Read events
Expand Down

0 comments on commit 14bf98e

Please sign in to comment.