Crate jetty[][src]

Expand description

Implementations of common inclusive jet clustering algorithms.

In the current version, the following distance measures are implemented:

This crate uses a naive clustering implementation. For state-of-the-art implementations of many more jet algorithms, have a look at the excellent fastjet library.


Cluster a number of partons into jets using the anti-kt algorithm with radius 0.4:

use jetty::{anti_kt_f, cluster, cluster_if, pseudojet_f};

let partons = vec![
    pseudojet_f(0.2626773221934335, -0.08809521946454194, -0.1141608706693822, -0.2195584284654444),
    pseudojet_f(2.21902459329915, -0.7529973704809976, -0.9658189214109036, -1.850475321845671)

// get all jets
let all_jets = cluster(partons.clone(), &anti_kt_f(0.4));
assert_eq!(all_jets.len(), 1);

// get all jets with at least 40 GeV
let jets_40gev = cluster_if(
   |jet| jet.pt2() > 40. * 40.
assert_eq!(jets_40gev.len(), 0);


pub use pseudojet::PseudoJet;
pub use pseudojet::pseudojet;
pub use pseudojet::pseudojet_f;
pub use distance::anti_kt;
pub use distance::kt;
pub use distance::gen_kt;
pub use distance::cambridge_aachen;
pub use distance::anti_kt_f;
pub use distance::kt_f;
pub use distance::gen_kt_f;
pub use distance::cambridge_aachen_f;
pub use cluster::cluster;
pub use cluster::cluster_if;