Skip to content

Use transverse width for X-bar containment - #289

Merged
jdkio merged 3 commits into
mainfrom
jdkio/266_xbar_transverse_width
Aug 12, 2026
Merged

Use transverse width for X-bar containment#289
jdkio merged 3 commits into
mainfrom
jdkio/266_xbar_transverse_width

Conversation

@jdkio

@jdkio jdkio commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The X bar used the wrong transverse width. This caused the hough transform to get very confused. It would add a bunch of extra hits to the candidate. Then it was up to DB scan to fix the issue by making sure what it found was contiguous.

Note that this is only a problem for pileup or busy events. A single muon event should process about the same. But this would lead to different behavior in X and Y views.

See these diagnostic plots using branch jdkio/266_hough_attempt_diagnostics. In them, we see all hits would be hough seeds (orange circles), rather than only the ones along the line. This would also lead to bad line candidates, which is why the red line is not pointing along the eventual DB scan's hits. The DB scan hits then fix the issue slightly. Those hits are then removed for the next attempt, but I'm not sure that helps much. The Y view wasn't affected, which is how we were able to find the issue.

Before

image

After

image

@jdkio
jdkio requested a review from toi42 July 28, 2026 21:38
@jdkio jdkio added the bug Something isn't working label Jul 28, 2026
@toi42

toi42 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Actually, this pull seems to somehow drop efficiency. While this is being investigated, we should hold off on merging this in.

(EDIT: this is also on a single neutrino file, so something has gone wrong deeper than this fix)

On this pull
muon_ke_tms_enter

Main with the same settings

image

@jdkio

jdkio commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

The hough transform is looking for a very thin slice. Using the bar length instead of bar width accidentally made the effective width much larger (> 50x). That gave us a better reco efficiency in the X view because it was more forgiving. Note that the Y view was still constrained to a single bar width, which probably reduced its reco eff compared to X.

I've exposed parameters ContainmentHalfWidth and ContainmentWidthMultiplier in the config. I've made them 4x larger than they were. That should be enough to retain the effect in X and improve the reco in Y, but I haven't tested it in detail. @toi42, can you make reco eff plots with this version and see?

@toi42

toi42 commented Aug 6, 2026

Copy link
Copy Markdown
Member
muon_ke_tms_enter Same plot, on the most recent commit. Seems it still needs more investigation.

@jdkio

jdkio commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

I think I understand this issue better. The bug fix itself is fine. But it increases the number of X 2d line candidates. The XY matcher doesn't look for global best matches. Instead, it starts with the longest and tries to match it. With the increased number of candidates, we're getting more and more bad matches. Previously, it would only have one X match to match against all possible Y matches. Or something like that.

The solution is a global matcher. So it looks at all possible pairs and finds the best global solution, with the possibility of not matching any.

@jdkio

jdkio commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@toi42, could you check the reco eff again? I think I fixed the issue. Below is a simplified comparison.

Broken version:
image

Fixed version:
image

Comparison to fb51696 (the commit before the branch):
image

@toi42

toi42 commented Aug 11, 2026

Copy link
Copy Markdown
Member

It has improved, but is still lagging behind main. Seems comparable to my test from the first commit.

muon_ke_tms_enter

@jdkio

jdkio commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Okay, it'll lag behind main because main has some improvements on top of it. When we merge, main will retain those improvements so I expect it'll be fine. I'll merge based on this.

@jdkio
jdkio merged commit 78a2a6e into main Aug 12, 2026
1 check passed
@jdkio
jdkio deleted the jdkio/266_xbar_transverse_width branch August 12, 2026 13:46
@toi42

toi42 commented Aug 12, 2026

Copy link
Copy Markdown
Member

These are efficiency plots for the N5p3 sample:
Pre fix

muon_ke_tms_enter Post Fix muon_ke_tms_enter

So about the same, maybe slightly better but hard to distinguish from statistical fluctuations.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants