Skip to content

Audit for member variables that are really per-call-scoped state #544

Description

@kjvbrt

addons/FastJet/JetClustering.h's clustering_* structs (kt, antikt,
cambridge, ee_kt, ee_genkt, genkt, valencia, jade) hold _cs and
_recombScheme as private members, but both are only ever written and read
within a single call (_cs inside operator(), _recombScheme inside the
constructor) — never across calls, never accessed externally (checked via
repo-wide grep). They could be plain local variables instead.

_jetAlgorithm may be a related case for clustering_kt/antikt/
cambridge/ee_kt/ee_genkt/genkt (a plain enum, constructor-only use),
but for clustering_valencia/clustering_jade it's an owning raw pointer
passed into fastjet::JetDefinition, and localizing it would need checking
FastJet's actual ownership contract first — not a confirmed case.

This is likely not unique to JetClustering — worth a broader look at the
codebase for the same smell (member state that's really call-scoped) rather
than treating this as a JetClustering-only cleanup.

Not urgent, no functional bug — just unnecessary state on hot per-jet objects.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions