Skip to content

New silicon seed pruning module (PHSiliconSeedPruner and PHSiliconSeedPrunerHelper) - #4446

Merged
osbornjd merged 7 commits into
sPHENIX-Collaboration:masterfrom
hrjheng:SiliconSeedPruning
Sep 22, 2026
Merged

osbornjd merged 7 commits into
sPHENIX-Collaboration:masterfrom
hrjheng:SiliconSeedPruning

Conversation

@hrjheng

@hrjheng hrjheng commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work for users)
  • Requiring change in macros repository (Please provide links to the macros pull request in the last section)
  • I am a member of GitHub organization of sPHENIX Collaboration, EIC, or ECCE (contact Chris Pinkenburg to join)

What kind of change does this PR introduce? (Bug fix, feature, ...)

This PR adds a new Fun4All module, PHSiliconSeedPruner (and the helper PHSiliconSeedPrunerHelper), that handles the silicon-seed cluster ambiguity and produces a new container for the pruned seeds. For each valid crossing, the module first groups seeds that share clusters (prioritizing seeds with a complete MVTX triplet), collapses identical triplets, and finally retains the largest set of seeds with mutually independent MVTX clusters through the recursive include-exclude search.

The pruning algorithm is isolated in an helper PHSiliconSeedPrunerHelper, while PHSiliconSeedPruner handles Fun4All node access and creates a new TrackSeedContainer. Random selections use a GSL generator initialized through PHRandomSeed(), with a public seed setter for reproducibility and systematic variations.

This module is a re-implementation of an analysis helper for the charged hadron multiplicity measurement in p+p and O+O. An example that walks through the pruning algorithm could be found in this presentation: https://indico.bnl.gov/event/33530/#4-hao-rens-update

(Marking this as a draft PR now for internal review and Jenkins checks)

TODOs (if applicable)

Links to other PRs in macros and calibration repositories (if applicable)

Motivation / context

Silicon seeds can share MVTX clusters and create reconstruction ambiguities. This PR adds PHSiliconSeedPruner to retain a large set of mutually independent seeds for each valid crossing.

Key changes

  • Add the PHSiliconSeedPruner Fun4All module.
  • Add PHSiliconSeedPrunerHelper with ambiguity grouping, MVTX triplet prioritization, duplicate-triplet handling, budgeted exact search, heuristic fallback, and GSL-based random selection.
  • Store selected seeds in PrunedSiliconTrackSeedContainer.
  • Preserve seeds with SHRT_MAX crossings.
  • Add configurable input/output container names and random seeds.
  • Create the output container under DST/SVTX when needed.
  • Update the build system.

Potential risk areas

  • Pruning changes reconstruction output.
  • Large ambiguity groups can increase CPU use.
  • Results vary with the random seed.
  • The new output container changes reconstruction data flow. No serialized I/O format change is shown.
  • Thread-safety is not established because the module owns mutable container and RNG state.
  • Test results and review-finding severity counts are unavailable from the supplied evidence.

Possible future improvements

  • Add unit tests for grouping, duplicate triplets, search limits, and heuristic fallback.
  • Benchmark large ambiguity groups.
  • Document tuning and reproducibility settings.
  • Confirm thread-safety requirements for concurrent reconstruction.

AI-generated summaries can contain mistakes. Contributors should verify these points against the implementation and integration tests.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: sPHENIX-Collaboration/coresoftware/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 90c28888-3774-4190-80ed-b1c90a24a271

📥 Commits

Reviewing files that changed from the base of the PR and between bf83253 and 140cee6.

📒 Files selected for processing (1)
  • offline/packages/trackreco/PHSiliconSeedPruner.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • offline/packages/trackreco/PHSiliconSeedPruner.h

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds PHSiliconSeedPruner and its helper. The module groups silicon seeds by crossing, resolves cluster ambiguities with exact or heuristic independent-set selection, and writes selected seeds to an output container.

Changes

Silicon seed pruning

Layer / File(s) Summary
Module and helper contracts
offline/packages/trackreco/PHSiliconSeedPruner.h, offline/packages/trackreco/PHSiliconSeedPrunerHelper.h, offline/packages/trackreco/Makefile.am
Adds the SubsysReco module, helper result type, helper entry point, and build entries for the public header, internal header, and source files.
Seed records and ambiguity groups
offline/packages/trackreco/PHSiliconSeedPrunerHelper.cc
Builds seed records, marks complete MVTX triplets, groups seeds that share cluster keys, and handles simple ambiguity groups.
Conflict solving and representative selection
offline/packages/trackreco/PHSiliconSeedPrunerHelper.cc
Collapses duplicate MVTX triplets, builds conflict components, performs budgeted branch-and-bound independent-set searches, and uses randomized heuristic selection when exact search exceeds its budget.
Container pruning workflow
offline/packages/trackreco/PHSiliconSeedPruner.cc
Validates input and output nodes, groups seeds by crossing, calls SelectSeeds, preserves SHRT_MAX crossings, and fills the output container.

Sequence Diagram(s)

sequenceDiagram
  participant PHSiliconSeedPruner
  participant TrackSeedContainer
  participant SelectSeeds
  participant gsl_rng
  PHSiliconSeedPruner->>TrackSeedContainer: read input seeds by crossing
  PHSiliconSeedPruner->>SelectSeeds: pass candidate indices and pruning parameters
  SelectSeeds->>gsl_rng: draw representatives
  SelectSeeds-->>PHSiliconSeedPruner: return selected and uncertified indices
  PHSiliconSeedPruner->>TrackSeedContainer: write selected seeds to output
Loading

Priority: ⬇️ Low


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 43420dc6a83774ebd34a88756ee58a0ee8cf83d0:
Jenkins on fire


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 27d77a0f1232df70e9d45425fde81e0d783a3768:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@hrjheng
hrjheng marked this pull request as ready for review September 21, 2026 15:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: sPHENIX-Collaboration/coresoftware/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 16cc44fa-1308-4d5e-82e2-7bb894e9fa30

📥 Commits

Reviewing files that changed from the base of the PR and between c9e9662 and 27d77a0.

📒 Files selected for processing (5)
  • offline/packages/trackreco/Makefile.am
  • offline/packages/trackreco/PHSiliconSeedPruner.cc
  • offline/packages/trackreco/PHSiliconSeedPruner.h
  • offline/packages/trackreco/PHSiliconSeedPrunerHelper.cc
  • offline/packages/trackreco/PHSiliconSeedPrunerHelper.h

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread offline/packages/trackreco/PHSiliconSeedPruner.h
@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit 140cee686c71cc06ac62443f40a267863402c3ac:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci

Copy link
Copy Markdown

Build & test report

Report for commit bf832539067082bb14b4f2f13c137155da604b13:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@osbornjd
osbornjd merged commit e17a9aa into sPHENIX-Collaboration:master Sep 22, 2026
22 checks passed
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.

2 participants