ClusteringResult

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

ClusteringResult

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

Attributes

Name Description
jets Return inclusive jets ordered by decreasing transverse momentum.

jets

ClusteringResult.jets: builtins.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:]))
True

Methods

Name Description
__getitem__ Return one jet by decreasing-transverse-momentum index.
__iter__ Iterate over jets from highest to lowest transverse momentum.
__len__ Return the number of clustered jets.
__repr__ Return a concise summary of the clustered jet collection.
_repr_html_ Render a bounded table of clustered jet kinematics
_repr_pretty_ Write the concise collection summary to an IPython pretty printer.

__getitem__

ClusteringResult.__getitem__(index: builtins.int) -> Jet

Return one jet by decreasing-transverse-momentum index.

Examples

Using the setup in the ClusteringResult class example:

leading_jet = clustering[0]

Parameters

  • index (int) Zero-based index; negative indices count from the end.

__iter__

ClusteringResult.__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]

__len__

ClusteringResult.__len__() -> builtins.int

Return the number of clustered jets.

Examples

Using the setup in the ClusteringResult class example:

jet_multiplicity = len(clustering)

__repr__

ClusteringResult.__repr__() -> builtins.str

Return a concise summary of the clustered jet collection.

Examples

Using the setup in the ClusteringResult class example:

print(clustering)

_repr_html_

ClusteringResult._repr_html_() -> builtins.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_

ClusteringResult._repr_pretty_(pretty: typing.Any, cycle: builtins.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

  • pretty (object) The IPython pretty-printer object.
  • cycle (bool) Whether this object is part of a recursive formatting cycle.