Skip to content

JetReconstruction.jl

Jet reconstruction (reclustering) with Julia

DocumenterVitepress

Jet Reconstruction

This package implements sequential Jet Reconstruction (clustering) algorithms, which are used in high-energy physics as part of event reconstruction for pp and e+e colliders.

Algorithms

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 antikT, Cambridge/Aachen and inclusive kT.

Reconstruction Interface

The main interface for reconstruction is jet_reconstruct, called as, e.g.,

julia
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.

Strategy

Three strategies are available for the different algorithms:

Strategy NameNotesInterface
RecoStrategy.BestDynamically switch strategy based on input particle densityjet_reconstruct
RecoStrategy.N2PlainGlobal matching of particles at each interation (works well for low N)plain_jet_reconstruct
RecoStrategy.N2TiledUse tiles of radius R to limit search space (works well for higher N)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.,

julia
# 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.

Inclusive and Exclusive Selections

To obtain final jets both inclusive (pT cut) and exclusive (njets or dij cut) selections are supported:

Sorting

Sorting vectors is trivial in Julia, no special sorting methods are provided. As an example, to sort exclusive jets of >5.0 (usually GeV, depending on your EDM) from highest energy to lowest:

julia
sorted_jets = sort!(inclusive_jets(cs::ClusterSequence; ptmin=5.0), 
  by=JetReconstruction.energy, rev=true)

Plotting and Animation

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.

Serialisation

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.

Reference

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:

bibtex
@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:

bibtex
@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.