Skip to content

Add perfect cluster diagnostic metrics - #525

Open
ryux1 wants to merge 1 commit into
gnn-tracking:mainfrom
ryux1:feat/perfect-cluster-diagnostics
Open

ryux1 wants to merge 1 commit into
gnn-tracking:mainfrom
ryux1:feat/perfect-cluster-diagnostics

Conversation

@ryux1

@ryux1 ryux1 commented Sep 6, 2026

Copy link
Copy Markdown

Adds separate perfectly_homogeneous and perfectly_inclusive tracking metrics so failures of the existing perfect efficiency can be attributed to fragmentation or contamination.

The predicates reuse the two halves of perfect_match, preserving the existing 0.99 homogeneity threshold. Both diagnostics use the same particle denominator as perfect; homogeneous matches count unique majority particle IDs so splitting one particle into multiple pure clusters cannot produce an efficiency above 1.

The focused regression covers both directions:

  • fragmented pure clusters are homogeneous but not inclusive
  • one contaminated cluster containing all hits of its majority particle is inclusive but not homogeneous

Closes #500

Validation:

  • GITHUB_ACTIONS=1 PYTHONPATH=src .venv/bin/python -m pytest tests/test_cluster_metrics.py -q (16 passed, 1 repository-declared xfail)
  • Ruff 0.4.3 checks passed
  • git diff --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add perfectly-homogeneous and perfectly-inclusive metrics to debug perfect metric

1 participant