graphicle.select.arg_closest(focus: MomentumArray, candidate: MomentumArray, num_threads: int = 1) list[int][source]

Assigns four-momenta elements in candidate to the nearest four-momenta elements in focus. Elements in candidate are assigned to one element in focus only.

New in version 0.2.14.

Changed in version 0.3.8: Modified the distance metric to include transverse momentum.

Parameters:
focus : MomentumArray

Four-momenta of objects to receive assignments to nearest candidate objects.

candidate : MomentumArray

Four-momenta of candidate objects to draw from until focus objects have each received an assignment.

num_threads : int

Number of threads to parallelise the cost matrix computation over. Default is 1.

Returns:

Indices of elements in candidate assigned to each respective element in focus. This will be the same length as focus.

Return type:

list[int]

See also

monte_carlo_tag

MC truth parton assignment to particle clustering.

Notes

Since only one focus element can receive a given candidate element, this must be regarded a cost-minimisation problem. The costs here are the distances in the azimuth-rapidity plane between elements. To illustrate, if one candidate element is the closest for two focus elements, it must be assigned to the smaller distance of the two, and the remaining focus element must be assigned the next-nearest candidate element. This is equivalent to the Assignment Problem [1] for a complete bipartite graph, and uses SciPy’s modified Jonker-Volgenant algorithm with no initialisation ref. [2] under the hood.

References


Last update: Jun 27, 2025