@@ -48,20 +48,12 @@ struct Line final {
4848
4949 float originPoint[3 ] = {0 , 0 , 0 };
5050 float cosinesDirector[3 ] = {0 , 0 , 0 };
51- // float weightMatrix[6] = {1., 0., 0., 1., 0., 1.};
52- // weightMatrix is a symmetric matrix internally stored as
53- // 0 --> row = 0, col = 0
54- // 1 --> 0,1
55- // 2 --> 0,2
56- // 3 --> 1,1
57- // 4 --> 1,2
58- // 5 --> 2,2
5951 TimeEstBC mTime ;
6052
6153 ClassDefNV (Line, 1 );
6254};
6355
64- GPUhdi () Line::Line(const Tracklet& tracklet, const Cluster* innerClusters, const Cluster* outerClusters)
56+ GPUhdi () Line::Line(const Tracklet& tracklet, const Cluster* innerClusters, const Cluster* outerClusters) : mTime (tracklet. mTime )
6557{
6658 originPoint[0 ] = innerClusters[tracklet.firstClusterIndex ].xCoordinate ;
6759 originPoint[1 ] = innerClusters[tracklet.firstClusterIndex ].yCoordinate ;
@@ -75,8 +67,6 @@ GPUhdi() Line::Line(const Tracklet& tracklet, const Cluster* innerClusters, cons
7567 cosinesDirector[0 ] *= inverseNorm;
7668 cosinesDirector[1 ] *= inverseNorm;
7769 cosinesDirector[2 ] *= inverseNorm;
78-
79- mTime = tracklet.mTime ;
8070}
8171
8272// static functions:
@@ -140,9 +130,9 @@ GPUhdi() void Line::getDCAComponents(const Line& line, const float point[3], flo
140130 destArray[0 ] = line.originPoint [0 ] - point[0 ] + line.cosinesDirector [0 ] * cdelta;
141131 destArray[3 ] = line.originPoint [1 ] - point[1 ] + line.cosinesDirector [1 ] * cdelta;
142132 destArray[5 ] = line.originPoint [2 ] - point[2 ] + line.cosinesDirector [2 ] * cdelta;
143- destArray[1 ] = o2::gpu::CAMath::Sqrt (destArray[0 ] * destArray[ 0 ] + destArray[ 3 ] * destArray[3 ]);
144- destArray[2 ] = o2::gpu::CAMath::Sqrt (destArray[0 ] * destArray[ 0 ] + destArray[ 5 ] * destArray[5 ]);
145- destArray[4 ] = o2::gpu::CAMath::Sqrt (destArray[3 ] * destArray[ 3 ] + destArray[ 5 ] * destArray[5 ]);
133+ destArray[1 ] = o2::gpu::CAMath::Hypot (destArray[0 ], destArray[3 ]);
134+ destArray[2 ] = o2::gpu::CAMath::Hypot (destArray[0 ], destArray[5 ]);
135+ destArray[4 ] = o2::gpu::CAMath::Hypot (destArray[3 ], destArray[5 ]);
146136}
147137
148138inline bool Line::operator ==(const Line& rhs) const
@@ -163,28 +153,27 @@ class ClusterLines final
163153{
164154 public:
165155 ClusterLines () = default ;
166- ClusterLines (const int firstLabel, const Line& firstLine, const int secondLabel, const Line& secondLine,
167- const bool weight = false );
168- ClusterLines (const Line& firstLine, const Line& secondLine);
169- void add (const int lineLabel, const Line& line, const bool weight = false );
156+ ClusterLines (const int firstLabel, const Line& firstLine, const int secondLabel, const Line& secondLine);
157+ void add (const int lineLabel, const Line& line);
170158 void computeClusterCentroid ();
171- inline std::array< float , 3 > getVertex () const { return mVertex ; }
172- inline std::array<float , 6 > getRMS2 () const { return mRMS2 ; }
173- inline float getAvgDistance2 () const { return mAvgDistance2 ; }
174- inline auto getSize () const noexcept { return mLabels .size (); }
159+ auto const & getVertex () const { return mVertex ; }
160+ std::array<float , 6 > getRMS2 () const { return mRMS2 ; }
161+ float getAvgDistance2 () const { return mAvgDistance2 ; }
162+ auto getSize () const noexcept { return mLabels .size (); }
175163 auto & getLabels () noexcept { return mLabels ; }
176164 const auto & getTimeStamp () const noexcept { return mTime ; }
177165 bool operator ==(const ClusterLines& rhs) const noexcept ;
166+ float getR2 () const noexcept { return (mVertex [0 ] * mVertex [0 ]) + (mVertex [1 ] * mVertex [1 ]); }
167+ float getR () const noexcept { return std::sqrt (getR2 ()); }
178168
179169 protected:
180170 std::array<float , 6 > mAMatrix = {}; // AX=B
181171 std::array<float , 3 > mBMatrix = {}; // AX=B
182- // std::array<float, 9> mWeightMatrix = {}; // weight matrix
183- std::array<float , 3 > mVertex = {}; // cluster centroid position
184- std::array<float , 6 > mRMS2 = {}; // symmetric matrix: diagonal is RMS2
185- float mAvgDistance2 = 0 .f; // substitute for chi2
186- TimeEstBC mTime ; // time stamp
187- std::vector<int > mLabels ; // contributing labels
172+ std::array<float , 3 > mVertex = {}; // cluster centroid position
173+ std::array<float , 6 > mRMS2 = {}; // symmetric matrix: diagonal is RMS2
174+ float mAvgDistance2 = 0 .f; // substitute for chi2
175+ TimeEstBC mTime ; // time stamp
176+ std::vector<int > mLabels ; // contributing labels
188177};
189178
190179} // namespace o2::its
0 commit comments