Belle II Software development
KDTHit Struct Reference

Lightweight 2D representation of a CDC hit for KD-tree sorting. More...

#include <Utils.h>

Public Member Functions

double squaredDistanceTo (const KDTHit &other) const
 Compute squared distance to another KDTHit.
 

Public Attributes

double x
 X coordinate of the hit.
 
double y
 Y coordinate of the hit.
 
int hitIndex
 Index of the hit in the original input collection.
 

Detailed Description

Lightweight 2D representation of a CDC hit for KD-tree sorting.

Represents a CDC hit by its 2D coordinates and a corresponding index.

Definition at line 23 of file Utils.h.

Member Function Documentation

◆ squaredDistanceTo()

double squaredDistanceTo ( const KDTHit & other) const
inline

Compute squared distance to another KDTHit.

Parameters
otherAnother KDTHit.
Returns
Squared Euclidean distance.

Definition at line 35 of file Utils.h.

36 {
37 double dx = x - other.x;
38 double dy = y - other.y;
39 return dx * dx + dy * dy;
40 }

Member Data Documentation

◆ hitIndex

int hitIndex

Index of the hit in the original input collection.

Definition at line 29 of file Utils.h.

◆ x

double x

X coordinate of the hit.

Definition at line 25 of file Utils.h.

◆ y

double y

Y coordinate of the hit.

Definition at line 27 of file Utils.h.


The documentation for this struct was generated from the following file: