Skip to content

Reconstruction parameter refactoring#105

Merged
lucabaldini merged 11 commits intomainfrom
recon_refactoring
Apr 23, 2026
Merged

Reconstruction parameter refactoring#105
lucabaldini merged 11 commits intomainfrom
recon_refactoring

Conversation

@augustocattafesta
Copy link
Copy Markdown
Collaborator

This PR closes #89 and #90

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 simplified ReconEvent.position() to call it.
  • Updated clustering construction to carry pos_recon_algorithm + recon_pars through 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 raise TypeError if self.recon_pars is None, but the code only catches RuntimeError, so the display can crash when reconstruction parameters aren't provided. Consider guarding with if self.recon_pars is None: ... (skip eta plotting) or also catching TypeError from 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.

Comment thread src/hexsample/display.py Outdated
Comment thread src/hexsample/clustering.py
Comment thread src/hexsample/tasks.py Outdated
Comment thread src/hexsample/tasks.py Outdated
Comment thread src/hexsample/calibration.py
Comment thread src/hexsample/calibration.py
@augustocattafesta augustocattafesta marked this pull request as ready for review April 22, 2026 11:33
@lucabaldini lucabaldini merged commit 7057538 into main Apr 23, 2026
2 checks passed
@lucabaldini lucabaldini deleted the recon_refactoring branch April 23, 2026 07:26
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.

Review the mechanism for passing along the reconstruction parameters Review the parameters names for the eta reconstruction

3 participants