Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackParametrization.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackParametrization.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 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 
12 
13 #include <type_traits>
14 
15 // The user can override the track parameters ordering. If the preprocessor
16 // variable is defined, it must point to a header file that contains the same
17 // enum definitions for bound and free track parameters as given below.
18 #ifdef ACTS_PARAMETER_DEFINITIONS_HEADER
19 #include ACTS_PARAMETER_DEFINITIONS_HEADER
20 #else
21 
22 namespace Acts {
23 
24 // Note:
25 // The named indices are used to access raw data vectors and matrices at the
26 // lowest level. Since the interpretation of some components, e.g. local
27 // position and the inverse-momentum-like component, depend on additional
28 // information the names have some ambiguity. This can only be resolved at a
29 // higher logical level and no attempt is made to resolve it here.
30 
37 enum BoundIndices : unsigned int {
38  // Local position on the reference surface.
39  // This is intentionally named different from the position components in
40  // the other data vectors, to clarify that this is defined on a surface
41  // while the others are defined in free space.
44  // Direction angles
45  eBoundPhi = 2,
47  // Global inverse-momentum-like parameter, i.e. q/p or 1/p
48  // The naming is inconsistent for the case of neutral track parameters where
49  // the value is interpreted as 1/p not as q/p. This is intentional to avoid
50  // having multiple aliases for the same element and for lack of an acceptable
51  // common name.
54  // Last uninitialized value contains the total number of components
56 };
57 
64 enum FreeIndices : unsigned int {
65  // Spatial position
66  // The spatial position components must be stored as one continuous block.
70  // Time
72  // (Unit) direction
73  // The direction components must be stored as one continuous block.
77  // Global inverse-momentum-like parameter, i.e. q/p or 1/p
78  // See BoundIndices for further information
80  // Last uninitialized value contains the total number of components
82 };
83 
84 } // namespace Acts
85 #endif
86 
87 namespace Acts {
88 
89 // Ensure bound track parameters definition is valid.
90 static_assert(std::is_enum_v<BoundIndices>,
91  "'BoundIndices' must be an enum type");
92 static_assert(std::is_convertible_v<BoundIndices, size_t>,
93  "'BoundIndices' must be convertible to size_t");
94 // Only the order can be user-defined
95 static_assert(BoundIndices::eBoundSize == 6u,
96  "Bound track parameters must have six components");
97 
98 // Ensure free track parameters definition is valid.
99 static_assert(std::is_enum_v<FreeIndices>,
100  "'FreeIndices' must be an enum type");
101 static_assert(std::is_convertible_v<FreeIndices, size_t>,
102  "'FreeIndices' must be convertible to size_t");
103 // Only the order can be user-defined
104 static_assert(FreeIndices::eFreeSize == 8u,
105  "Free track parameters must have eight components");
106 
107 // Ensure bound track parameter indices are consistently defined.
108 static_assert(eBoundLoc0 != eBoundLoc1, "Local parameters must be different");
109 
110 // Ensure free track parameter indices are consistently defined.
111 static_assert(eFreePos1 == eFreePos0 + 1u, "Position must be continuous");
112 static_assert(eFreePos2 == eFreePos0 + 2u, "Position must be continuous");
113 static_assert(eFreeDir1 == eFreeDir0 + 1u, "Direction must be continuous");
114 static_assert(eFreeDir2 == eFreeDir0 + 2u, "Direction must be continuous");
115 
116 // Shorthand vector/matrix types related to bound track parameters.
120 // Mapping from bound track parameters.
122 
123 // Shorthand vector/matrix types related to free track parameters.
127 // Mapping from free track parameters.
130 
131 } // namespace Acts