forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackParametersConcept.hpp
More file actions
66 lines (55 loc) · 2.18 KB
/
TrackParametersConcept.hpp
File metadata and controls
66 lines (55 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// This file is part of the ACTS project.
//
// Copyright (C) 2016 CERN for the benefit of the ACTS project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
#pragma once
#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include <optional>
#include <tuple>
namespace Acts {
class Surface;
namespace Concepts {
template <typename Parameters>
concept BasicTrackParameters = requires {
typename Parameters::ParametersVector;
typename Parameters::CovarianceMatrix;
requires requires(const Parameters &p) {
{ p.time() } -> std::floating_point;
{ p.direction() } -> std::same_as<Vector3>;
{ p.absoluteMomentum() } -> std::floating_point;
{ p.charge() } -> std::floating_point;
};
};
} // namespace Concepts
/// @brief Concept that asserts that a given type meets the requirements to be
/// considered free track parameters in Acts.
template <typename Parameters>
concept FreeTrackParametersConcept =
Concepts::BasicTrackParameters<Parameters> &&
requires(const Parameters &p) {
{ p.parameters() } -> std::convertible_to<FreeVector>;
{ p.covariance() } -> std::convertible_to<std::optional<FreeMatrix>>;
{ p.fourPosition() } -> std::same_as<Vector4>;
{ p.position() } -> std::same_as<Vector3>;
};
/// @brief Concept that asserts that a given type meets the requirements to be
/// considered bound track parameters in Acts.
template <typename Parameters>
concept BoundTrackParametersConcept =
Concepts::BasicTrackParameters<Parameters> &&
requires(const Parameters &p) {
{ p.parameters() } -> std::convertible_to<BoundVector>;
{ p.covariance() } -> std::convertible_to<std::optional<BoundMatrix>>;
{ p.referenceSurface() } -> std::same_as<const Surface &>;
requires requires(GeometryContext &c) {
{ p.position(c) } -> std::same_as<Vector3>;
{ p.fourPosition(c) } -> std::same_as<Vector4>;
{ p.position(c) } -> std::same_as<Vector3>;
};
};
} // namespace Acts