From c34b62043e8178e5d72ef323323155f83239d2af Mon Sep 17 00:00:00 2001 From: Moritz Kiehn <msmk@cern.ch> Date: Fri, 13 Mar 2020 18:14:02 +0100 Subject: [PATCH] Utilities: update bound parameters index enum --- .../detail/DefaultParameterDefinitions.hpp | 56 +++++++++++++++---- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp b/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp index e371c348c..5d6b5337d 100644 --- a/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp +++ b/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp @@ -15,23 +15,54 @@ #include "Acts/Utilities/ParameterTypes.hpp" namespace Acts { -enum ParDef : unsigned int { - eLOC_0 = 0, ///< first coordinate in local surface frame - eLOC_1 = 1, ///< second coordinate in local surface frame + +/// Components of a bound track parameters vector. +/// +/// To be used to access components by named indices instead of just numbers. +/// This must be a regular `enum` and not a scoped `enum class` to allow +/// implicit conversion to an integer. The enum value are thus visible directly +/// in `namespace Acts` and are prefixed to avoid naming collisions. +enum BoundParametersIndices : unsigned int { + // Local position on the reference surface. + // This is intentionally named different from the position components in + // the other data vectors, to clarify that this is defined on a surface + // while the others are defined in free space. + eBoundLoc0 = 0, + eBoundLoc1 = 1, + // Direction angles + eBoundPhi = 2, + eBoundTheta = 3, + // Global inverse-momentum-like parameter, i.e. q/p or 1/p + // The naming is inconsistent for the case of neutral track parameters where + // the value is interpreted as 1/p not as q/p. This is intentional to avoid + // having multiple aliases for the same element and for lack of an acceptable + // common name. + eBoundQOverP = 4, + eBoundTime = 5, + // Last uninitialized value contains the total number of components + eBoundParametersSize, + // The following aliases without prefix exist for historical reasons + // Generic spatial coordinates on the local surface + eLOC_0 = eBoundLoc0, + eLOC_1 = eBoundLoc1, + // Spatial coordinates on a disk in polar coordinates eLOC_R = eLOC_0, eLOC_PHI = eLOC_1, - eLOC_RPHI = eLOC_0, - eLOC_Z = eLOC_1, + // Spatial coordinates on a disk in Cartesian coordinates eLOC_X = eLOC_0, eLOC_Y = eLOC_1, + // Spatial coordinates on a cylinder + eLOC_RPHI = eLOC_0, + eLOC_Z = eLOC_1, + // Closest approach coordinates on a virtual perigee surface eLOC_D0 = eLOC_0, eLOC_Z0 = eLOC_1, - ePHI = 2, ///< phi direction of momentum in global frame - eTHETA = 3, ///< theta direction of momentum in global frame - eQOP = 4, ///< charge/momentum for charged tracks, for neutral tracks it is - /// 1/momentum - eT = 5, /// < The time of the particle - BoundParsDim /// < The local dimensions + // Direction angles + ePHI = eBoundPhi, + eTHETA = eBoundTheta, + eQOP = eBoundQOverP, + eT = eBoundTime, + BoundParsDim = eBoundParametersSize, }; /// Components of a free track parameters vector. @@ -89,7 +120,8 @@ enum SpacePointIndices : unsigned int { SpacePointDim = eSpacePointSize, }; -using ParID_t = ParDef; +using ParDef = BoundParametersIndices; +using ParID_t = BoundParametersIndices; using ParValue_t = double; /// -- GitLab