Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:49

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/TrackParametrization.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 
0015 #include <optional>
0016 
0017 namespace Acts {
0018 
0019 class Surface;
0020 
0021 namespace Concepts {
0022 template <typename Parameters>
0023 concept BasicTrackParameters = requires {
0024   typename Parameters::ParametersVector;
0025   typename Parameters::CovarianceMatrix;
0026 
0027   requires requires(const Parameters &p) {
0028     { p.time() } -> std::floating_point;
0029     { p.direction() } -> std::same_as<Vector3>;
0030     { p.absoluteMomentum() } -> std::floating_point;
0031     { p.charge() } -> std::floating_point;
0032   };
0033 };
0034 }  // namespace Concepts
0035 
0036 /// @brief Concept that asserts that a given type meets the requirements to be
0037 /// considered free track parameters in Acts.
0038 template <typename Parameters>
0039 concept FreeTrackParametersConcept =
0040     Concepts::BasicTrackParameters<Parameters> &&
0041     requires(const Parameters &p) {
0042       { p.parameters() } -> std::convertible_to<FreeVector>;
0043       {
0044         p.covariance()
0045       } -> std::convertible_to<std::optional<FreeSquareMatrix>>;
0046       { p.fourPosition() } -> std::same_as<Vector4>;
0047       { p.position() } -> std::same_as<Vector3>;
0048     };
0049 
0050 /// @brief Concept that asserts that a given type meets the requirements to be
0051 /// considered bound track parameters in Acts.
0052 template <typename Parameters>
0053 concept BoundTrackParametersConcept =
0054     Concepts::BasicTrackParameters<Parameters> &&
0055     requires(const Parameters &p) {
0056       { p.parameters() } -> std::convertible_to<BoundVector>;
0057       {
0058         p.covariance()
0059       } -> std::convertible_to<std::optional<BoundSquareMatrix>>;
0060       { p.referenceSurface() } -> std::same_as<const Surface &>;
0061 
0062       requires requires(GeometryContext &c) {
0063         { p.position(c) } -> std::same_as<Vector3>;
0064         { p.fourPosition(c) } -> std::same_as<Vector4>;
0065         { p.position(c) } -> std::same_as<Vector3>;
0066       };
0067     };
0068 
0069 }  // namespace Acts