EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Definitions.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Definitions.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2018 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 http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
11 // for GNU: ignore this specific warning, otherwise just include Eigen/Dense
12 #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
13 #pragma GCC diagnostic push
14 #pragma GCC diagnostic ignored "-Wmisleading-indentation"
15 #include <Eigen/Dense>
16 #pragma GCC diagnostic pop
17 #else
18 #include <Eigen/Dense>
19 #endif
20 
21 namespace Acts {
22 
24 static constexpr double s_epsilon = 3 * std::numeric_limits<double>::epsilon();
25 
31 static constexpr double s_onSurfaceTolerance = 1e-4;
32 
36 static constexpr double s_curvilinearProjTolerance = 0.999995;
37 
41 enum NavigationDirection : int { backward = -1, forward = 1 };
42 
47 enum MaterialUpdateStage : int {
48  preUpdate = -1,
51 };
52 
57 enum NoiseUpdateMode : int { removeNoise = -1, addNoise = 1 };
58 
59 // Eigen definitions
60 template <typename T, unsigned int rows, unsigned int cols>
61 using ActsMatrix = Eigen::Matrix<T, rows, cols>;
62 
63 template <unsigned int rows, unsigned int cols>
65 
66 template <unsigned int rows, unsigned int cols>
68 
69 template <typename T, unsigned int rows>
70 using ActsSymMatrix = Eigen::Matrix<T, rows, rows>;
71 
72 template <unsigned int rows>
74 
75 template <unsigned int rows>
77 
78 template <typename T, unsigned int rows>
79 using ActsVector = Eigen::Matrix<T, rows, 1>;
80 
81 template <unsigned int rows>
83 
84 template <unsigned int rows>
86 
87 template <typename T, unsigned int cols>
88 using ActsRowVector = Eigen::Matrix<T, 1, cols>;
89 
90 template <unsigned int cols>
92 
93 template <unsigned int cols>
95 
96 template <typename T>
97 using ActsMatrixX = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
98 
101 
102 template <typename T>
103 using ActsVectorX = Eigen::Matrix<T, Eigen::Dynamic, 1>;
104 
107 
108 template <typename T>
109 using ActsRowVectorX = Eigen::Matrix<T, 1, Eigen::Dynamic>;
110 
113 
121 
122 // coordinate vectors
129 // symmetric matrices e.g. for coordinate covariance matrices
136 
147 enum CoordinateIndices : unsigned int {
148  // generic position-like access
149  ePos0 = 0,
150  ePos1 = 1,
151  ePos2 = 2,
152  eTime = 3,
153  // generic momentum-like access
158  // Cartesian spatial coordinates
162 };
163 
164 // pure translation transformations
165 using Translation2F = Eigen::Translation<float, 2>;
166 using Translation3F = Eigen::Translation<float, 3>;
167 using Translation4F = Eigen::Translation<float, 4>;
168 using Translation2D = Eigen::Translation<double, 2>;
169 using Translation3D = Eigen::Translation<double, 3>;
170 using Translation4D = Eigen::Translation<double, 4>;
171 // linear (rotation) matrices
172 using RotationMatrix2F = Eigen::Matrix<float, 2, 2>;
173 using RotationMatrix3F = Eigen::Matrix<float, 3, 3>;
174 using RotationMatrix4F = Eigen::Matrix<float, 4, 4>;
175 using RotationMatrix2D = Eigen::Matrix<double, 2, 2>;
176 using RotationMatrix3D = Eigen::Matrix<double, 3, 3>;
177 using RotationMatrix4D = Eigen::Matrix<double, 4, 4>;
178 // pure rotation transformations. only available in 2d and 3d
179 using Rotation2F = Eigen::Rotation2D<float>;
180 using Rotation3F = Eigen::Quaternion<float>;
181 using AngleAxis3F = Eigen::AngleAxis<float>;
182 using Rotation2D = Eigen::Rotation2D<double>;
183 using Rotation3D = Eigen::Quaternion<double>;
184 using AngleAxis3D = Eigen::AngleAxis<double>;
185 // combined affine transformations. types are chosen for better data alignment:
186 // - 2d affine compact stored as 2x3 matrix
187 // - 3d affine stored as 4x4 matrix
188 // - 4d affine compact stored as 4x5 matrix
189 using Transform2F = Eigen::Transform<float, 2, Eigen::AffineCompact>;
190 using Transform3F = Eigen::Transform<float, 3, Eigen::Affine>;
191 using Transform4F = Eigen::Transform<float, 4, Eigen::AffineCompact>;
192 using Transform2D = Eigen::Transform<double, 2, Eigen::AffineCompact>;
193 using Transform3D = Eigen::Transform<double, 3, Eigen::Affine>;
194 using Transform4D = Eigen::Transform<double, 4, Eigen::AffineCompact>;
195 
197 
198 } // namespace Acts