Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:16

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2020 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 // for GNU: ignore this specific warning, otherwise just include Eigen/Dense
0012 #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
0013 #pragma GCC diagnostic push
0014 #pragma GCC diagnostic ignored "-Wmisleading-indentation"
0015 #if __GNUC__ == 13
0016 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
0017 #endif
0018 #include <Eigen/Core>
0019 #include <Eigen/Geometry>
0020 #pragma GCC diagnostic pop
0021 #else
0022 #include <Eigen/Core>
0023 #include <Eigen/Geometry>
0024 #endif
0025 
0026 namespace Acts {
0027 
0028 /// @defgroup acts-algebra-types Vector/matrix types with a common scalar type
0029 ///
0030 /// These are the default vector/matrix types that should be used throughout the
0031 /// codebase. They all use the common Acts scalar type but support variable size
0032 /// either at compile- or runtime.
0033 ///
0034 /// Eigen does not have a distinct type for symmetric matrices. A typedef for
0035 /// fixed-size matrices is still defined to simplify definition (one template
0036 /// size vs two template size for generic matrices) and to clarify semantic
0037 /// meaning in interfaces. It also ensures that the matrix is square. However,
0038 /// the user is responsible for ensuring that the values are symmetric.
0039 ///
0040 /// Without a distinct type for symmetric matrices, there is no way to provide
0041 /// any conditions e.g. square size, for the dynamic-sized case. Consequently,
0042 /// no dynamic-sized symmetric matrix type is defined. Use the
0043 /// `ActsDynamicMatrix` instead.
0044 ///
0045 
0046 /// Common scalar (floating point type used for the default algebra types.
0047 ///
0048 /// Defaults to `double` but can be customized by the user.
0049 #ifdef ACTS_CUSTOM_SCALARTYPE
0050 using ActsScalar = ACTS_CUSTOM_SCALARTYPE;
0051 #else
0052 using ActsScalar = double;
0053 #endif
0054 
0055 template <unsigned int kSize>
0056 using ActsVector = Eigen::Matrix<ActsScalar, kSize, 1>;
0057 
0058 template <unsigned int kRows, unsigned int kCols>
0059 using ActsMatrix = Eigen::Matrix<ActsScalar, kRows, kCols>;
0060 
0061 template <unsigned int kSize>
0062 using ActsSquareMatrix = Eigen::Matrix<ActsScalar, kSize, kSize>;
0063 
0064 using ActsDynamicVector = Eigen::Matrix<ActsScalar, Eigen::Dynamic, 1>;
0065 
0066 using ActsDynamicMatrix =
0067     Eigen::Matrix<ActsScalar, Eigen::Dynamic, Eigen::Dynamic>;
0068 
0069 /// @defgroup coordinates-types Fixed-size vector/matrix types for coordinates
0070 ///
0071 /// These predefined types should always be used when handling coordinate
0072 /// vectors in different coordinate systems, i.e. on surfaces (2d), spatial
0073 /// position (3d), or space-time (4d).
0074 ///
0075 
0076 // coordinate vectors
0077 using Vector2 = ActsVector<2>;
0078 using Vector3 = ActsVector<3>;
0079 using Vector4 = ActsVector<4>;
0080 
0081 // square matrices e.g. for coordinate covariance matrices
0082 using SquareMatrix2 = ActsSquareMatrix<2>;
0083 using SquareMatrix3 = ActsSquareMatrix<3>;
0084 using SquareMatrix4 = ActsSquareMatrix<4>;
0085 
0086 // pure translation transformations
0087 using Translation2 = Eigen::Translation<ActsScalar, 2>;
0088 using Translation3 = Eigen::Translation<ActsScalar, 3>;
0089 
0090 // linear (rotation) matrices
0091 using RotationMatrix2 = ActsMatrix<2, 2>;
0092 using RotationMatrix3 = ActsMatrix<3, 3>;
0093 
0094 // pure rotation defined by a rotation angle around a rotation axis
0095 using AngleAxis3 = Eigen::AngleAxis<ActsScalar>;
0096 
0097 // combined affine transformations. types are chosen for better data alignment:
0098 // - 2d affine compact stored as 2x3 matrix
0099 // - 3d affine stored as 4x4 matrix
0100 using Transform2 = Eigen::Transform<ActsScalar, 2, Eigen::AffineCompact>;
0101 using Transform3 = Eigen::Transform<ActsScalar, 3, Eigen::Affine>;
0102 
0103 }  // namespace Acts