JetReconstruction.jl
Jet reconstruction (reclustering) with Julia

This package implements sequential Jet Reconstruction (clustering) algorithms, which are used in high-energy physics as part of event reconstruction for
Algorithms used are based on the C++ FastJet package (https://fastjet.fr, hep-ph/0512210, arXiv:1111.6097), reimplemented natively in Julia.
The algorithms include
The main interface for reconstruction is jet_reconstruct, called as, e.g.,
jet_reconstruct(particles; p = -1, R = 1.0)Where particles is a collection of 4-vector objects to reconstruct.
The object returned is a ClusterSequence, which internally tracks all merge steps.
Three strategies are available for the different algorithms:
| Strategy Name | Notes | Interface |
|---|---|---|
RecoStrategy.Best | Dynamically switch strategy based on input particle density | jet_reconstruct |
RecoStrategy.N2Plain | Global matching of particles at each interation (works well for low | plain_jet_reconstruct |
RecoStrategy.N2Tiled | Use tiles of radius | tiled_jet_reconstruct |
Generally one can use the jet_reconstruct interface, shown above, as the Best strategy safely as the overhead is extremely low. That interface supports a strategy option to switch to a different option.
Another option, if one wishes to use a specific strategy, is to call that strategy's interface directly, e.g.,
# For N2Plain strategy called directly
plain_jet_reconstruct(particles::Vector{T}; p = -1, R = 1.0, recombine = +)Note that there is no strategy option in these interfaces.
To obtain final jets both inclusive (
Sorting vectors is trivial in Julia, no special sorting methods are provided. As an example, to sort exclusive jets of
sorted_jets = sort!(inclusive_jets(cs::ClusterSequence; ptmin=5.0),
by=JetReconstruction.energy, rev=true)
To visualise the clustered jets as a 3d bar plot (see illustration above) we now use Makie.jl. See the jetsplot function in ext/JetVisualisation.jl and its documentation for more. There are two worked examples in the examples directory.
The plotting code is a package extension and will load if the one of the Makie modules is loaded in the environment.
The animatereco function will animate the reconstruction sequence, given a ClusterSequence object. See the function documentation for the many options that can be customised.
The package also provides methods such as loadjets, loadjets!, and savejets that one can use to save and load objects on/from disk easily in a very flexible format. See documentation for more.
Although it has been developed further since the CHEP2023 conference, the CHEP conference proceedings, 10.1051/epjconf/202429505017, should be cited if you use this package:
@article{refId0,
author = {{Stewart, Graeme Andrew} and {Gras, Philippe} and {Hegner, Benedikt} and {Krasnopolski, Atell}},
doi = {10.1051/epjconf/202429505017},
journal = {EPJ Web of Conf.},
pages = {05017},
title = {Polyglot Jet Finding},
url = {https://doi.org/10.1051/epjconf/202429505017},
volume = 295,
year = 2024,
eprint={2309.17309},
archivePrefix={arXiv},
primaryClass={hep-ex}
}The original paper on arXiv is:
@misc{stewart2023polyglot,
title={Polyglot Jet Finding},
author={Graeme Andrew Stewart and Philippe Gras and Benedikt Hegner and Atell Krasnopolski},
year={2023},
eprint={2309.17309},
archivePrefix={arXiv},
primaryClass={hep-ex}
}Code in this package is authored by:
Atell Krasnopolski <delta_atell@protonmail.com>
Graeme A Stewart <graeme.andrew.stewart@cern.ch>
Philippe Gras <philippe.gras@cern.ch>
and is Copyright 2022-2024 The Authors, CERN.
The code is under the MIT License.