EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParameterDefinitions.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParameterDefinitions.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) parameter ordering and underlying scalar
16 // type. If the variable is defined, it must point to a header file that
17 // contains the same enum and type definitions for bound and free track
18 // parameters as well as space points as given below.
19 #ifdef ACTS_PARAMETER_DEFINITIONS_HEADER
20 #include ACTS_PARAMETER_DEFINITIONS_HEADER
21 #else
22 namespace Acts {
23 
24 // Note:
25 // The named indices are use to access raw data vectors and matrices at the
26 // lowest level. Since the interpretation of some of the 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 
59 using BoundScalar = double;
60 
67 enum FreeIndices : unsigned int {
68  // Spatial position
69  // The spatial position components must be stored as one continous block.
73  // Time
75  // (Unit) direction
76  // The direction components must be stored as one continous block.
80  // Global inverse-momentum-like parameter, i.e. q/p or 1/p
81  // See BoundIndices for further information
83  // Last uninitialized value contains the total number of components
85 };
86 
88 using FreeScalar = double;
89 
90 } // namespace Acts
91 #endif
92 
93 namespace Acts {
94 
95 // Ensure bound track parameters definition is valid.
96 static_assert(std::is_enum_v<BoundIndices>,
97  "'BoundIndices' must be an enum type");
98 static_assert(std::is_convertible_v<BoundIndices, size_t>,
99  "'BoundIndices' must be convertible to size_t");
100 static_assert(2 <= BoundIndices::eBoundSize,
101  "Bound track parameters must have at least two components");
102 static_assert(std::is_floating_point_v<BoundScalar>,
103  "'BoundScalar' must be a floating point type");
104 
105 // Ensure free track parameters definition is valid.
106 static_assert(std::is_enum_v<FreeIndices>,
107  "'FreeIndices' must be an enum type");
108 static_assert(std::is_convertible_v<FreeIndices, size_t>,
109  "'FreeIndices' must be convertible to size_t");
110 static_assert(6 <= FreeIndices::eFreeSize,
111  "Free track parameters must have at least six components");
112 static_assert(std::is_floating_point_v<FreeScalar>,
113  "'FreeScalar' must be a floating point type");
114 
115 // Ensure bound track parameter indices are consistently defined.
116 static_assert(eBoundLoc0 != eBoundLoc1, "Local parameters must be differents");
117 
118 // Ensure free track parameter indices are consistently defined.
119 static_assert(eFreePos1 == eFreePos0 + 1u, "Position must be continous");
120 static_assert(eFreePos2 == eFreePos0 + 2u, "Position must be continous");
121 static_assert(eFreeDir1 == eFreeDir0 + 1u, "Direction must be continous");
122 static_assert(eFreeDir2 == eFreeDir0 + 2u, "Direction must be continous");
123 
124 // The following matrix and vector types are automatically derived from the
125 // indices enums and scalar typedefs.
126 
127 // Matrix and vector types related to bound track parameters.
128 
133 
135 
136 // Matrix and vector types related to free track parameters.
137 
142 
143 // Mapping to bound track parameters.
144 //
145 // Assumes that matrices represent maps from another space into the space of
146 // bound track parameters. Thus, the bound scalar type is sufficient
147 // to retain accuracy.
148 
150 
151 // Mapping to free track parameters.
152 //
153 // Assumes that matrices represent maps from another space into the space of
154 // free track parameters. Thus, the free scalar type is sufficient
155 // to retain accuracy.
156 
158 
159 } // namespace Acts