Skip to content

Minor updates to PHActsSiliconSeeder, TrackResiduals, PHSimpleVertexFinder#4135

Merged
osbornjd merged 9 commits intosPHENIX-Collaboration:masterfrom
adfrawley:new_tpc_transforms
Jan 30, 2026
Merged

Minor updates to PHActsSiliconSeeder, TrackResiduals, PHSimpleVertexFinder#4135
osbornjd merged 9 commits intosPHENIX-Collaboration:masterfrom
adfrawley:new_tpc_transforms

Conversation

@adfrawley
Copy link
Contributor

@adfrawley adfrawley commented Jan 22, 2026

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, ...)

  1. Modifies PHActsSiliconSeeder to
    a) Calculate cluster phi positions relative to the collision point, instead of (x,y) = (0,0).
    b) Estimate the seed/layer intersection for the MVTX assuming the layers are centered at the actual barrel center.
    c) Changes the strobe matching check to require +/- 1 instead of zero. This produces a small increase in efficiency for fully fitted tracks.
    Notes: The default beam spot is set for Run 3 pp, but should be close enough for seeding in AuAu and Run 2 pp. The default beam spot and MVTX barrel positions are set for data, but I think they should work for simulation, let's see what Jenkins thinks. In any case, the simulations should use values that match data.

  2. Adds the cluster layer to clustertree in TrackResiduals.

  3. Changes the default minimum number of MVTX clusters required for a track to be used for vertexing in PHSimpleVertexFinder to 2, instead of 3.

TODOs (if applicable)

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

Minor Updates to Silicon Track Seeding and Vertex Finding

Motivation / Context

Improve silicon-based seeding and vertexing fidelity by computing cluster azimuths relative to a realistic collision point and MVTX geometry, and recover a small amount of reconstruction efficiency by relaxing timing/hit-count requirements. Defaults are set for Run 3 pp but should be overridden to match specific run/simulation conditions.

Key Changes

  • PHActsSiliconSeeder
    • Compute cluster phi relative to the beam spot via a new getPhiFromBeamSpot() helper (instead of assuming (x,y)=(0,0)).
    • Account for MVTX barrel center offsets when estimating seed/layer intersections and in circle–circle intersection math.
    • Add public setters set_beamSpotXY() and set_mvtxCenterXY() and corresponding member variables; defaults tuned for Run 3 pp.
    • Relax strobe matching: accept |strobeId − strobe| ≤ 1 (previously required exact equality), yielding a small increase in fully fitted track efficiency.
  • TrackResiduals
    • Add cluster layer information to clustertree (new "layer" branch).
  • PHSimpleVertexFinder
    • Lower default minimum MVTX clusters per track required for vertexing from 3 → 2.

Potential Risk Areas

  • Reconstruction behavior: Relaxing the strobe window and lowering the MVTX-cluster threshold can increase fake/semi-fitted tracks or degrade vertex purity—validate with efficiency vs. fake-rate and vertex-resolution studies.
  • Geometry / configuration: Using Run 3 defaults for beam-spot and MVTX center may bias results if not overridden; ensure per-run or dataset-appropriate settings (ideally from alignment/conditions DB).
  • IO / compatibility: Adding a "layer" branch to clustertree is an additive change but downstream tools may need updates to read/use it.
  • Thread-safety & performance: No explicit thread-safety changes noted. Additional per-cluster geometric computations are minor but should be profiled in full-scale reconstruction to confirm negligible impact.

Possible Future Improvements

  • Source beam-spot and MVTX center from run-specific alignment/conditions DB (per-run/per-job configuration).
  • Extend collision-point–relative phi calculations to other subsystems if needed.
  • Add automated regression/QA: efficiency/fake-rate/vertex-resolution plots and unit/regression tests to quantify impact across datasets.

Note: This summary was produced with AI assistance. AI can make mistakes—please verify code diffs, public API changes, and validate reconstruction performance before deploying.

…hi relative to beamspot, circle uses MVTX barrel center and not zero, changes strobe check to +/- 1, reduce MVTX cluster requirement to 2.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Compute cluster phi relative to a configurable beam spot and MVTX center in silicon seeding, widen strobe-consistency checks, expose setters for beam-spot and MVTX center, lower required MVTX vertices from 3 to 2, and add a layer branch to track residual diagnostics.

Changes

Cohort / File(s) Summary
Tracking diagnostics
offline/packages/TrackingDiagnostics/TrackResiduals.cc
Added a layer branch to clustertree sourcing m_scluslayer (m_scluslayer/I).
Silicon seeding — phi & geometry
offline/packages/trackreco/PHActsSiliconSeeding.h, offline/packages/trackreco/PHActsSiliconSeeding.cc
Added public setters set_beamSpotXY(...), set_mvtxCenterXY(...) and getPhiFromBeamSpot(float clusy, float clusx) const. Replaced direct atan2-based phi calculations with beam-spot–relative phi, applied MVTX center offsets in circle-circle intersection logic, propagated new phi through triplet averaging, projection/matching and surface-phi computations, and changed strobe gating to abs(strobeId - strobe) > 1.
Vertex finder requirement
offline/packages/trackreco/PHSimpleVertexFinder.h
Changed default _nmvtx_required from 3 to 2.
✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@sphenix-jenkins-ci
Copy link

Build & test report

Report for commit 9ec298fb7d3b94a243e8056445b7879d11f58659:
Jenkins on fire

Build & test report

Report for commit 18c5a2c56900618bcf9798bb091f064b628994a4:
Jenkins on fire

Build & test report

Report for commit f704495167ff5a179e3b400f49850351b7084714:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
offline/packages/trackreco/PHActsSiliconSeeding.cc (1)

1158-1163: Same avgtripletphi concern as above.
The averaging logic here mirrors the earlier block; please apply the same verification decision.

🧹 Nitpick comments (2)
offline/packages/trackreco/PHSimpleVertexFinder.h (1)

93-95: Confirm the physics impact of lowering the default MVTX requirement.
Line 94 changes the default to 2, which can alter vertexing selection and downstream outputs. Please confirm this is intended for all production modes and update any reconstruction notes/config defaults accordingly.

offline/packages/trackreco/PHActsSiliconSeeding.h (1)

370-377: Verify and document run-specific defaults to avoid silent physics shifts.
The hard-coded Run-3 pp defaults (Lines 370-377) will be applied whenever callers don’t override them. Please confirm that production configs (and simulation) explicitly set these per dataset and document expected analysis impact/reprocessing needs.

Based on learnings, please include explicit analysis-impact and reprocessing guidance when reconstruction defaults change.

@sphenix-jenkins-ci
Copy link

Build & test report

Report for commit c38e2000cb52d9d00fe8eee961b398aff745a349:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

Copy link
Contributor

@osbornjd osbornjd left a comment

Choose a reason for hiding this comment

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

This makes the INTT matching efficiency in the simulation a little worse at high pT, which is confusing given that it should be more correct. I'm not sure I understand why

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Comment on lines +370 to +377
// collision point in sPHENIX coordinates, from vertex finder (pp run 3)
float m_beamSpotx = -0.072; // cm
float m_beamSpoty = 0.141; // cm

// center of MVTX barrel in sPHENIX coordinates - default is for Run 3 pp
float m_mvtx_x0 = 0.6; // cm
float m_mvtx_y0 = -0.1;

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, check the file structure and context around these lines
wc -l offline/packages/trackreco/PHActsSiliconSeeding.h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 131


🏁 Script executed:

# Examine the code around these defaults to understand their purpose and usage
sed -n '350,390p' offline/packages/trackreco/PHActsSiliconSeeding.h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 1473


🏁 Script executed:

# Search for where these member variables are used within the class
rg "m_beamSpot|m_mvtx_" offline/packages/trackreco/PHActsSiliconSeeding.h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 288


🏁 Script executed:

# Check if there's a corresponding .cc file to see how these are used
fd "PHActsSiliconSeeding\.cc" offline/packages/trackreco/

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 128


🏁 Script executed:

# Search for usage of these beam-spot/MVTX variables in the .cc file
rg "m_beamSpot|m_mvtx_" offline/packages/trackreco/PHActsSiliconSeeding.cc -A 3 | head -60

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 409


🏁 Script executed:

# Check the git log to see if these defaults recently changed
git log --oneline -20 -- offline/packages/trackreco/PHActsSiliconSeeding.h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 107


🏁 Script executed:

# Check git diff to see what changed in this PR for these specific lines
git diff HEAD~1 -- offline/packages/trackreco/PHActsSiliconSeeding.h | grep -A 5 -B 5 "beamSpot\|mvtx_"

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 106


🏁 Script executed:

# Check git status to understand the current state
git status

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 143


🏁 Script executed:

# Try to get the full git log with more context
git log --oneline -50 -- offline/packages/trackreco/PHActsSiliconSeeding.h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 107


🏁 Script executed:

# Check if there's a PR description or commit message
git log -1 --format="%B"

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 98


🏁 Script executed:

# Search for any recent changes to these defaults across the repository
git log -p --all -S "m_beamSpotx = -0.072" -- offline/packages/trackreco/PHActsSiliconSeeding.h | head -100

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 60


🏁 Script executed:

# Check if there's more commit history we can access
git log --all --oneline | head -50

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 2908


🏁 Script executed:

# Try to see the current file state and search for when these specific values were set
git log --all -p -- offline/packages/trackreco/PHActsSiliconSeeding.h | grep -B 10 -A 10 "0.6.*cm\|0.141" | head -80

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 164


🏁 Script executed:

# Look for any documentation about these parameters in comments
grep -B 5 -A 5 "Run 3 pp\|beam.spot" offline/packages/trackreco/PHActsSiliconSeeding.h

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 456


🏁 Script executed:

# Check if there are any related pull request files or documentation
find . -name "*README*" -o -name "*CHANGES*" -o -name "*NOTES*" | grep -i silicon | head -10

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 60


🏁 Script executed:

# Check what the current HEAD is and what changed
git show --stat 8bc0f1f7c

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 50391


🏁 Script executed:

# Check if the beam spot/mvtx defaults were changed in this commit
git show 8bc0f1f7c -- offline/packages/trackreco/PHActsSiliconSeeding.h | grep -B 5 -A 5 "beamSpot\|mvtx_"

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 1020


🏁 Script executed:

# Look at the full diff for this file in this commit
git show 8bc0f1f7c -- offline/packages/trackreco/PHActsSiliconSeeding.h | head -150

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 3868


🏁 Script executed:

# Try to find PR-related files or documentation
find . -name "*.md" -o -name "*.txt" | grep -i "pull\|pr\|request" | head -20

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 112


🏁 Script executed:

# Check the commit message more thoroughly
git log -1 8bc0f1f7c --format="%B" | head -50

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 98


🏁 Script executed:

# Look for any PR description files in the repo root
ls -la | grep -i "pull\|pr\|description"

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 60


🏁 Script executed:

# Check the PR template to understand what should be documented
cat ./.github/pull_request_template.md

Repository: sPHENIX-Collaboration/coresoftware

Length of output: 1238


Document reconstruction impact and reprocessing requirements in PR description.

The beam-spot and MVTX center defaults are used directly in reconstruction (fitting calculations and phi angle computations). Changes to these geometry parameters affect track seeding outputs. State the expected analysis impact and whether existing data requires reprocessing.

@sphenix-jenkins-ci
Copy link

Build & test report

Report for commit 8bc0f1f7ceaa9e5342674eca1691d8db28bc0628:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@sphenix-jenkins-ci
Copy link

Build & test report

Report for commit 344e32c717695c8605ac9b1092f62d80f5bfc27b:
Jenkins passed


Automatically generated by sPHENIX Jenkins continuous integration
sPHENIX             jenkins.io

@osbornjd
Copy link
Contributor

Screenshot 2026-01-29 at 9 08 01 AM

The INTT matching efficiency still degrades at high pT, actually it appears in exactly the same way as behavior. So apparently coderabbit wasn't exactly correct (at least, the problem it points out is not directly responsible for the loss in matching efficiency at high pT)

@osbornjd
Copy link
Contributor

Interestingly even after setting the beamspot to 0 (unless I made a mistake or omitted something here), the matching efficiency in the simulation still gets worse at high pT
https://nbviewer.sphenix.bnl.gov/github/sPHENIX-Collaboration/QA-gallery/blob/jenkins-sPHENIX-test-tracking-low-occupancy-qa-8452-test-tracking_Event400_Sum28/QA-tracking.ipynb

It does improve the data reconstruction, so maybe we just merge this and keep trying to understand why the sim matching gets worse?

@adfrawley
Copy link
Contributor Author

adfrawley commented Jan 30, 2026 via email

@osbornjd osbornjd merged commit 9694b18 into sPHENIX-Collaboration:master Jan 30, 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