FeynKit · latest
On this page

ClusteringResult

symbolica.community.hepkit Class

ClusteringResult()

The selected jets from one clustering operation.

Jets are ordered by decreasing transverse momentum, and each jet's constituent_indices map back to positions in the supplied momentum list.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
particles = [hep.FourMomentum(50.0, 30.0, 40.0, 0.0),
             hep.FourMomentum(25.0, -15.0, -20.0, 0.0)]
definition = hep.JetDefinition.anti_kt(radius=0.4, minimum_pt=20.0)
clustering = definition.cluster(particles)
jets = clustering.jets
assert len(jets) == 2

Member details

jets

Property · read-only#
jets: list[Jet]

Return inclusive jets ordered by decreasing transverse momentum.

Examples

Using the setup in the ClusteringResult class example:

jets = clustering.jets
all(left.pt >= right.pt for left, right in zip(jets, jets[1:]))

__len__

Method#
__len__() -> int

Return the number of clustered jets.

Examples

Using the setup in the ClusteringResult class example:

jet_multiplicity = len(clustering)

__getitem__

Method#
__getitem__(index: int) -> Jet

Return one jet by decreasing-transverse-momentum index.

Examples

Using the setup in the ClusteringResult class example:

leading_jet = clustering[0]

Parameters

NameTypeDefaultDescription
indexint—

Zero-based index; negative indices count from the end.

__iter__

Method#
__iter__() -> collections.abc.Iterator[Jet]

Iterate over jets from highest to lowest transverse momentum.

Examples

Using the setup in the ClusteringResult class example:

transverse_momenta = [jet.pt for jet in clustering]

__repr__

Method#
__repr__() -> str

Return a concise summary of the clustered jet collection.

Examples

Using the setup in the ClusteringResult class example:

print(clustering)

_repr_html_

Method#
_repr_html_() -> str

Render a bounded table of clustered jet kinematics.

At most 20 jets are included so notebook display remains responsive for unusually large clustering results.

Examples

Using the setup in the ClusteringResult class example:

from IPython.display import display
display(clustering)

_repr_pretty_

Method#
_repr_pretty_(pretty: Any, cycle: bool) -> None

Write the concise collection summary to an IPython pretty printer.

Examples

Using the setup in the ClusteringResult class example:

from IPython.lib.pretty import pretty
text = pretty(clustering)

Parameters

NameTypeDefaultDescription
prettyAny—

The IPython pretty-printer object.

cyclebool—

Whether this object is part of a recursive formatting cycle.