ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
navigation_validation_config.hpp
1// This file is part of the ACTS project.
2//
3// Copyright (C) 2016 CERN for the benefit of the ACTS project
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9#pragma once
10
11// Project include(s)
12#include "detray/definitions/pdg_particle.hpp"
13
14// detray plugin include(s)
15#include "detray/plugins/svgtools/styling/styling.hpp"
16
17// Detray test include(s)
18#include "detray/test/framework/test_configuration.hpp"
19
20// System include(s)
21#include <limits>
22#include <memory>
23#include <string>
24
25namespace detray::test {
26
28template <concepts::algebra algebra_t>
30 : public detray::test::configuration<dscalar<algebra_t>> {
37
39 std::string m_name{"navigation_validation"};
41 std::string m_intersection_file{"truth_intersections.csv"};
43 std::string m_track_param_file{"truth_trk_parameters.csv"};
45 std::size_t m_n_tracks{detray::detail::invalid_value<std::size_t>()};
49 navigation::direction m_nav_dir{navigation::direction::e_forward};
53 bool m_display_svg{false};
57 bool m_fail_on_diff{true};
59 bool m_verbose{true};
64 detray::detail::invalid_value<scalar_type>(),
65 detray::detail::invalid_value<scalar_type>()};
66
69
72
77 const std::string &name() const { return m_name; }
80 const std::string &intersection_file() const { return m_intersection_file; }
83 const std::string &track_param_file() const { return m_track_param_file; }
86 std::size_t n_tracks() const { return m_n_tracks; }
92 navigation::direction navigation_direction() const { return m_nav_dir; }
98 bool display_svg() const { return m_display_svg; }
104 bool fail_on_diff() const { return m_fail_on_diff; }
107 bool verbose() const { return m_verbose; }
113 const vector3_type &B_vector() const { return m_B; }
116 const auto &svg_style() const { return m_style; }
118
124 navigation_validation_config &name(const std::string &n) {
125 m_name = n;
126 return *this;
127 }
128
133 return *this;
134 }
135
140 return *this;
141 }
142
147 m_ptc_hypo = pdg_ptc;
148 return *this;
149 }
150
154 const navigation::direction dir) {
155 m_nav_dir = dir;
156 return *this;
157 }
158
162 const bool only_sensitives) {
163 m_collect_sensitives_only = only_sensitives;
164 return *this;
165 }
166
170 m_display_svg = do_display;
171 return *this;
172 }
173
177 m_display_only_missed = only_missed;
178 return *this;
179 }
180
187
191 m_verbose = v;
192 return *this;
193 }
194
198 m_n_tracks = n;
199 return *this;
200 }
201
205 m_p_range = pr;
206 return *this;
207 }
208
212 m_B = B;
213 return *this;
214 }
215
221 const scalar_type B1,
222 const scalar_type B2) {
223 m_B = vector3_type{B0, B1, B2};
224 return *this;
225 }
226
227};
228
229} // namespace detray::test
const styling::style style
Complete style configuration using the Tableau colorblind palette.
Definition styling.hpp:316
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
std::array< value_t, kDIM > darray
Fixed-size array container.
Definition containers.hpp:30
get_vector3D_t< A, T > dvector3D
Three-dimensional vector type for algebra A and value type T.
Definition algebra.hpp:80
Negative muon hypothesis.
Definition pdg_particle.hpp:111
Particle hypothesis identified by PDG number, mass, and electric charge.
Definition pdg_particle.hpp:24
Global styling options.
Definition styling.hpp:184
Test configuration type.
Definition test_configuration.hpp:22
Configuration for a detector scan test.
Definition navigation_validation_config.hpp:30
bool collect_sensitives_only() const
Check whether only sensitive surfaces are collected.
Definition navigation_validation_config.hpp:95
darray< scalar_type, 2 > p_range() const
Get the configured momentum range.
Definition navigation_validation_config.hpp:110
navigation_validation_config & B_vector(const vector3_type &B)
Set the magnetic field vector.
Definition navigation_validation_config.hpp:211
bool fail_on_diff() const
Check whether validation stops at the first difference.
Definition navigation_validation_config.hpp:104
vector3_type m_B
B-field vector for helix.
Definition navigation_validation_config.hpp:67
bool display_svg() const
Check whether SVG output is enabled.
Definition navigation_validation_config.hpp:98
bool m_display_only_missed
Drop an SVG only if navigation missed a surface.
Definition navigation_validation_config.hpp:55
std::string m_intersection_file
Name of the input file, containing the complete ray scan traces.
Definition navigation_validation_config.hpp:41
bool m_display_svg
Toggle SVG display.
Definition navigation_validation_config.hpp:53
darray< scalar_type, 2 > m_p_range
Configured momentum range of the test sample (only needed to generate correct file names).
Definition navigation_validation_config.hpp:63
navigation_validation_config & p_range(const darray< scalar_type, 2 > pr)
Set the momentum range.
Definition navigation_validation_config.hpp:204
navigation_validation_config & display_svg(const bool do_display)
Set whether SVG output is enabled.
Definition navigation_validation_config.hpp:169
std::string m_name
Name of the test.
Definition navigation_validation_config.hpp:39
pdg_particle< scalar_type > m_ptc_hypo
Particle hypothesis (truth particle from simulation).
Definition navigation_validation_config.hpp:47
detray::svgtools::styling::style m_style
Visualization style to be applied to the SVGs.
Definition navigation_validation_config.hpp:70
dscalar< algebra_t > scalar_type
Scalar type used by the validation.
Definition navigation_validation_config.hpp:32
navigation::direction navigation_direction() const
Get the navigation direction.
Definition navigation_validation_config.hpp:92
navigation_validation_config & collect_sensitives_only(const bool only_sensitives)
Set whether to collect only sensitive surfaces.
Definition navigation_validation_config.hpp:161
bool m_fail_on_diff
Whether to stop execution at the first error.
Definition navigation_validation_config.hpp:57
navigation_validation_config & fail_on_diff(const bool fail_on_diff)
Set whether validation stops at the first difference.
Definition navigation_validation_config.hpp:183
navigation_validation_config & track_param_file(const std::string &f)
Set the track parameter input file name.
Definition navigation_validation_config.hpp:138
navigation_validation_config & n_tracks(std::size_t n)
Set the maximum number of tracks.
Definition navigation_validation_config.hpp:197
bool verbose() const
Check whether verbose output is enabled.
Definition navigation_validation_config.hpp:107
pdg_particle< scalar_type > ptc_hypothesis() const
Get the particle hypothesis.
Definition navigation_validation_config.hpp:89
navigation_validation_config & intersection_file(const std::string &f)
Set the intersection input file name.
Definition navigation_validation_config.hpp:131
std::size_t n_tracks() const
Get the maximum number of tracks.
Definition navigation_validation_config.hpp:86
const std::string & intersection_file() const
Get the intersection input file name.
Definition navigation_validation_config.hpp:80
navigation_validation_config & ptc_hypothesis(pdg_particle< scalar_type > pdg_ptc)
Set the particle hypothesis.
Definition navigation_validation_config.hpp:145
bool m_verbose
Verbosity of the console output.
Definition navigation_validation_config.hpp:59
std::size_t m_n_tracks
The maximum number of test tracks to run.
Definition navigation_validation_config.hpp:45
navigation_validation_config & B_vector(const scalar_type B0, const scalar_type B1, const scalar_type B2)
Set the magnetic field vector components.
Definition navigation_validation_config.hpp:220
bool m_collect_sensitives_only
Collect only the sensitive intersections for comparison.
Definition navigation_validation_config.hpp:51
bool display_only_missed() const
Check whether SVG output is limited to missed surfaces.
Definition navigation_validation_config.hpp:101
navigation_validation_config & display_only_missed(const bool only_missed)
Set whether SVG output is limited to missed surfaces.
Definition navigation_validation_config.hpp:176
navigation_validation_config & navigation_direction(const navigation::direction dir)
Set the navigation direction.
Definition navigation_validation_config.hpp:153
const vector3_type & B_vector() const
Get the magnetic field vector.
Definition navigation_validation_config.hpp:113
navigation::direction m_nav_dir
Navigation direction.
Definition navigation_validation_config.hpp:49
navigation_validation_config & name(const std::string &n)
SettersSet the test name.
Definition navigation_validation_config.hpp:124
dvector3D< algebra_t > vector3_type
Three-dimensional vector type used by the validation.
Definition navigation_validation_config.hpp:34
const std::string & track_param_file() const
Get the track parameter input file name.
Definition navigation_validation_config.hpp:83
const std::string & name() const
GettersGet the test name.
Definition navigation_validation_config.hpp:77
navigation_validation_config & verbose(const bool v)
Set whether verbose output is enabled.
Definition navigation_validation_config.hpp:190
std::string m_track_param_file
Name of the input file containing track parameters.
Definition navigation_validation_config.hpp:43
detray::test::configuration< scalar_type > base_type
Base test configuration type.
Definition navigation_validation_config.hpp:36
const auto & svg_style() const
Get the SVG style.
Definition navigation_validation_config.hpp:116
static constexpr scalar_t T
Magnetic field, native unit GeV/(e*mm).
Definition units.hpp:108