1818
1919#include < array>
2020#include " ITStracking/Constants.h"
21+ #include " ITStracking/MathUtils.h"
2122#include " GPUCommonRtypes.h"
2223#include " GPUCommonDef.h"
2324
@@ -29,26 +30,21 @@ class IndexTableUtils;
2930
3031struct Cluster final {
3132 GPUhdDefault () Cluster() = default ;
32- GPUhd () Cluster(const float x, const float y, const float z, const int idx);
33- template <int nLayers>
34- GPUhd () Cluster(const int , const IndexTableUtils<nLayers>& utils, const Cluster&);
35- template <int nLayers>
36- GPUhd () Cluster(const int , const float3&, const IndexTableUtils<nLayers>& utils, const Cluster&);
37- GPUhdDefault () Cluster(const Cluster&) = default ;
38- GPUhdDefault () Cluster(Cluster&&) noexcept = default ;
39- GPUhdDefault () ~Cluster () = default ;
40-
41- GPUhdDefault () Cluster& operator =(const Cluster&) = default ;
42- GPUhdDefault () Cluster& operator =(Cluster&&) noexcept = default ;
43- GPUhdDefault () bool operator ==(const Cluster&) const = default ;
44-
33+ GPUhd () Cluster(const float x, const float y, const float z, const int idx)
34+ : xCoordinate(x),
35+ yCoordinate (y),
36+ zCoordinate(z),
37+ phi(math_utils::computeNormalizedPhi(x, y)),
38+ radius(math_utils::hypot(x, y)),
39+ clusterId(idx),
40+ indexTableBinIndex(0 ) {}
4541 GPUhd () void print() const ;
4642
47- float xCoordinate{- 999 . f };
48- float yCoordinate{- 999 . f };
49- float zCoordinate{- 999 . f };
50- float phi{- 999 . f };
51- float radius{- 999 . f };
43+ float xCoordinate{constants::UnsetValue };
44+ float yCoordinate{constants::UnsetValue };
45+ float zCoordinate{constants::UnsetValue };
46+ float phi{constants::UnsetValue };
47+ float radius{constants::UnsetValue };
5248 int clusterId{constants::UnusedIndex};
5349 int indexTableBinIndex{constants::UnusedIndex};
5450
@@ -57,23 +53,18 @@ struct Cluster final {
5753
5854struct TrackingFrameInfo final {
5955 GPUhdDefault () TrackingFrameInfo() = default ;
60- GPUhd () TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, std::array<float , 2 >&& posTF, std::array<float , 3 >&& covTF);
61- GPUhdDefault () TrackingFrameInfo(const TrackingFrameInfo&) = default ;
62- GPUhdDefault () TrackingFrameInfo(TrackingFrameInfo&&) noexcept = default ;
63- GPUhdDefault () ~TrackingFrameInfo () = default ;
64-
65- GPUhdDefault () TrackingFrameInfo& operator =(const TrackingFrameInfo&) = default ;
66- GPUhdDefault () TrackingFrameInfo& operator =(TrackingFrameInfo&&) = default ;
56+ GPUhd () TrackingFrameInfo(float x, float y, float z, float xTF, float alpha, const std::array<float , 2 >& posTF, const std::array<float , 3 >& covTF)
57+ : xCoordinate(x), yCoordinate(y), zCoordinate(z), xTrackingFrame(xTF), alphaTrackingFrame(alpha), positionTrackingFrame(posTF), covarianceTrackingFrame(covTF) {}
6758
6859 GPUhd () void print () const ;
6960
70- float xCoordinate{- 999 . f };
71- float yCoordinate{- 999 . f };
72- float zCoordinate{- 999 . f };
73- float xTrackingFrame{- 999 . f };
74- float alphaTrackingFrame{- 999 . f };
75- std::array<float , 2 > positionTrackingFrame = {- 999 . f , - 999 . f } ;
76- std::array<float , 3 > covarianceTrackingFrame = {- 999 . f , - 999 . f , - 999 . f } ;
61+ float xCoordinate{constants::UnsetValue };
62+ float yCoordinate{constants::UnsetValue };
63+ float zCoordinate{constants::UnsetValue };
64+ float xTrackingFrame{constants::UnsetValue };
65+ float alphaTrackingFrame{constants::UnsetValue };
66+ std::array<float , 2 > positionTrackingFrame = constants::helpers::initArray< float , 2 , constants::UnsetValue>() ;
67+ std::array<float , 3 > covarianceTrackingFrame = constants::helpers::initArray< float , 3 , constants::UnsetValue>() ;
7768
7869 ClassDefNV (TrackingFrameInfo, 1 );
7970};
0 commit comments