@@ -28,7 +28,8 @@ namespace o2::itsmft::tracking
2828// Barrel: (Y, Z, Snp, Tgl, Q2Pt), referenceCoordinate is local X, alpha is frame angle.
2929// Forward: (X, Y, Phi, Tgl, Q2Pt), referenceCoordinate is global Z, alpha is unused (zero).
3030
31- // Fitted surface state. The field order keeps the device-facing representation
31+ // Fitted surface state for charged particles; valid tracks have absCharge > 0.
32+ // The field order keeps the device-facing representation
3233// compact while the parameter-only linearization state remains independent.
3334struct SurfaceTrackState {
3435 float parameters[5 ]{};
@@ -40,22 +41,14 @@ struct SurfaceTrackState {
4041 uint8_t absCharge{0 };
4142 o2::track::PID pid{o2::track::PID ::Pion};
4243
44+ GPUhdi () float getP () const noexcept
45+ {
46+ return absCharge * std::sqrt (1 .f + parameters[3 ] * parameters[3 ]) / std::abs (parameters[4 ]);
47+ }
48+
4349 GPUhdi () constexpr bool hasRecognizedKind () const noexcept { return isRecognizedSurfaceKind (kind); }
4450};
4551
46- static_assert (std::is_standard_layout_v<SurfaceTrackState>);
47- static_assert (std::is_trivially_copyable_v<SurfaceTrackState>);
48- static_assert (sizeof (SurfaceTrackState) == 92 );
49- static_assert (alignof (SurfaceTrackState) == 4 );
50- static_assert (offsetof(SurfaceTrackState, parameters) == 0 );
51- static_assert (offsetof(SurfaceTrackState, covariance) == 20 );
52- static_assert (offsetof(SurfaceTrackState, referenceCoordinate) == 80 );
53- static_assert (offsetof(SurfaceTrackState, alpha) == 84 );
54- static_assert (offsetof(SurfaceTrackState, kind) == 88 );
55- static_assert (offsetof(SurfaceTrackState, flags) == 89 );
56- static_assert (offsetof(SurfaceTrackState, absCharge) == 90 );
57- static_assert (offsetof(SurfaceTrackState, pid) == 91 );
58-
5952// Covariance-free surface parameters used as the propagation linearization
6053// point paired with one SurfaceTrackState.
6154struct SurfaceTrackParameters {
@@ -76,15 +69,6 @@ struct SurfaceTrackParameters {
7669 GPUhdi () constexpr bool hasRecognizedKind () const noexcept { return isRecognizedSurfaceKind (kind); }
7770};
7871
79- static_assert (std::is_standard_layout_v<SurfaceTrackParameters>);
80- static_assert (std::is_trivially_copyable_v<SurfaceTrackParameters>);
81- static_assert (sizeof (SurfaceTrackParameters) == 32 );
82- static_assert (alignof (SurfaceTrackParameters) == 4 );
83- static_assert (offsetof(SurfaceTrackParameters, parameters) == 0 );
84- static_assert (offsetof(SurfaceTrackParameters, referenceCoordinate) == 20 );
85- static_assert (offsetof(SurfaceTrackParameters, alpha) == 24 );
86- static_assert (offsetof(SurfaceTrackParameters, kind) == 28 );
87-
8872GPUhdi () constexpr uint8_t packedCovarianceIndex (uint8_t row, uint8_t column) noexcept
8973{
9074 return row >= column ? row * (row + 1 ) / 2 + column : column * (column + 1 ) / 2 + row;
0 commit comments