Reconstruction parameter refactoring#105
Merged
lucabaldini merged 11 commits intomainfrom Apr 23, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors eta-reconstruction parameter naming and propagates reconstruction configuration through ClusteringNN/Cluster instead of storing parameters on ReconEvent, addressing issues #89 and #90.
Changes:
- Renamed eta reconstruction parameters to more descriptive names (e.g.,
eta_3pix_rad_offset,eta_3pix_theta_sigma) and updated CLI/pipeline/task wiring. - Moved position reconstruction dispatch into
Cluster.position()and simplifiedReconEvent.position()to call it. - Updated clustering construction to carry
pos_recon_algorithm+recon_parsthrough the clustering/cluster objects; adjusted display and calibration call sites accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/hexsample/tasks.py | Renames defaults/signature params; passes recon config into ClusteringNN; simplifies ReconEvent creation; updates display wiring. |
| src/hexsample/recon.py | Removes parameter-carrying fields from ReconEvent; delegates position reconstruction to Cluster.position(). |
| src/hexsample/pipeline.py | Updates pipeline arg plumbing to new parameter names and task signature order. |
| src/hexsample/display.py | Switches from recon_defaults to recon_pars; updates clustering construction and eta plotting call. |
| src/hexsample/clustering.py | Adds pos_recon_algorithm + recon_pars to Cluster/ClusteringNN; renames eta() parameters; introduces Cluster.position(). |
| src/hexsample/cli.py | Updates CLI flags/defaults to new eta parameter names; restricts pos_recon_algorithm choices to implemented options. |
| src/hexsample/calibration.py | Adjusts profile() bin edge generation and changes calibrate_dr_3pix() eta-sum definition. |
Comments suppressed due to low confidence (1)
src/hexsample/display.py:241
cluster.eta(**self.recon_pars)will raiseTypeErrorifself.recon_parsisNone, but the code only catchesRuntimeError, so the display can crash when reconstruction parameters aren't provided. Consider guarding withif self.recon_pars is None: ...(skip eta plotting) or also catchingTypeErrorfrom the kwargs expansion.
try:
eta_position = cluster.eta(**self.recon_pars)
# If cluster size is not 2 or 3, eta returns the centroid position, so we only
# plot it if it's different from the centroid.
self.axes.scatter(*eta_position, marker="+", s=100, label=r"$\eta$")
except RuntimeError:
pass
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #89 and #90