ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
material_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// Detray test include(s)
12#include "detray/test/framework/test_configuration.hpp"
13
14// Vecmem include(s)
15#include <vecmem/memory/memory_resource.hpp>
16
17// System include(s)
18#include <limits>
19#include <memory>
20#include <string>
21
22namespace detray::test {
23
25template <concepts::algebra algebra_t>
27 : public detray::test::configuration<dscalar<algebra_t>> {
34
36 std::string m_name{"material_validation"};
38 vecmem::memory_resource *m_dev_mr{nullptr};
40 std::string m_material_file{"navigation_material_trace"};
42 std::size_t m_n_tracks{detray::detail::invalid_value<std::size_t>()};
45
50 const std::string &name() const { return m_name; }
53 vecmem::memory_resource *device_mr() const { return m_dev_mr; }
56 const std::string &material_file() const { return m_material_file; }
59 std::size_t n_tracks() const { return m_n_tracks; }
64
70 material_validation_config &name(const std::string &n) {
71 m_name = n;
72 return *this;
73 }
74
77 material_validation_config &device_mr(vecmem::memory_resource *mr) {
78 m_dev_mr = mr;
79 return *this;
80 }
81
86 return *this;
87 }
88
92 m_n_tracks = n;
93 return *this;
94 }
95
99 assert(re > 0.f);
100 m_rel_error = re;
101 return *this;
102 }
103
104};
105
106} // namespace detray::test
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
get_vector3D_t< A, T > dvector3D
Three-dimensional vector type for algebra A and value type T.
Definition algebra.hpp:80
Test configuration type.
Definition test_configuration.hpp:22
Configuration for a detector scan test.
Definition material_validation_config.hpp:27
const std::string & material_file() const
Get the material trace file name.
Definition material_validation_config.hpp:56
vecmem::memory_resource * device_mr() const
Get the device memory resource.
Definition material_validation_config.hpp:53
vecmem::memory_resource * m_dev_mr
Vecmem memory resource for the device allocations.
Definition material_validation_config.hpp:38
dscalar< algebra_t > scalar_type
Scalar type used by the validation.
Definition material_validation_config.hpp:29
const std::string & name() const
GettersGet the test name.
Definition material_validation_config.hpp:50
material_validation_config & material_file(const std::string &f)
Set the material trace file name.
Definition material_validation_config.hpp:84
material_validation_config & name(const std::string &n)
SettersSet the test name.
Definition material_validation_config.hpp:70
std::string m_material_file
Name of the output file, containing the complete ray material traces.
Definition material_validation_config.hpp:40
dvector3D< algebra_t > vector3_type
Three-dimensional vector type used by the validation.
Definition material_validation_config.hpp:31
scalar_type relative_error() const
Get the allowed relative discrepancy.
Definition material_validation_config.hpp:62
detray::test::configuration< scalar_type > base_type
Base test configuration type.
Definition material_validation_config.hpp:33
std::size_t n_tracks() const
Get the maximum number of test tracks.
Definition material_validation_config.hpp:59
std::size_t m_n_tracks
The maximal number of test tracks to run.
Definition material_validation_config.hpp:42
scalar_type m_rel_error
Allowed relative discrepancy between truth and navigation material.
Definition material_validation_config.hpp:44
material_validation_config & device_mr(vecmem::memory_resource *mr)
Set the device memory resource.
Definition material_validation_config.hpp:77
material_validation_config & n_tracks(std::size_t n)
Set the maximum number of test tracks.
Definition material_validation_config.hpp:91
std::string m_name
Name of the test.
Definition material_validation_config.hpp:36
material_validation_config & relative_error(scalar_type re)
Set the allowed relative discrepancy.
Definition material_validation_config.hpp:98