-
Notifications
You must be signed in to change notification settings - Fork 32
refactor(alert): move AHDC track-finding from AHDCEngine to ALERTEngine #1242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mathieuouillon
wants to merge
7
commits into
development
Choose a base branch
from
rgl_trackfinding_gnn
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
57072d5
refactor(alert): move AHDC track-finding from AHDCEngine to ALERTEngine
mathieuouillon 6692761
refactor(ahdc): unify track finders behind a TrackFinder strategy int…
mathieuouillon b2b0d24
test(ahdc): AHDCTest should test hits-only AHDCEngine
mathieuouillon 58799b3
feat(track-finding): add GNN track finder
mathieuouillon 36f990b
fix(alert): unify DatabaseConstantProvider usage and improve track ma…
mathieuouillon 28dc412
refactor(alert): split Track into TrackCandidate (finder output) and …
mathieuouillon 76cfe77
refactor(alert): rename AHDC Cluster/ClusterFinder -> AHDCCluster/AHD…
mathieuouillon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
42 changes: 42 additions & 0 deletions
42
reconstruction/alert/src/main/java/org/jlab/rec/ahdc/AI/GNNConstants.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package org.jlab.rec.ahdc.AI; | ||
|
|
||
| /** Normalization and graph-construction constants for the GNN track finder. | ||
| * Mirrors track-finding/gnn/config.py — keep in sync with the training config. | ||
| */ | ||
| final class GNNConstants { | ||
| private GNNConstants() {} | ||
|
|
||
| static final int NODE_FEAT_DIM = 10; | ||
| static final int EDGE_FEAT_DIM = 9; | ||
|
|
||
| // Model architecture parameters (control the minimum graph size at inference). | ||
| // GravNet progressive-k reaches 2*k, topk uses k+1 → N_nodes >= 2*k + 2. | ||
| // The exported model clamps topk(k+1) to N internally (see | ||
| // track-finding/export_torchscript.py::_knn_indices), so any graph with | ||
| // >=3 nodes runs without crashing. Smaller graphs can't form any edge | ||
| // with the MAX_LAYER_GAP rule anyway, so we skip them here. | ||
| static final int MIN_NODES = 3; | ||
|
|
||
| // Graph construction | ||
| static final int MAX_LAYER_GAP = 2; | ||
| static final double MAX_EDGE_DISTANCE = 35.0; // mm | ||
| static final double MAX_EDGE_DIST_SQ = MAX_EDGE_DISTANCE * MAX_EDGE_DISTANCE; | ||
|
|
||
| // Feature normalization | ||
| static final double MAX_R = 100.0; // mm | ||
| static final double DOCA_STD = 10.0; // mm | ||
| static final double Z_HALF_LENGTH = 200.0; // mm | ||
| static final double STEREO_ANGLE_MAX = 0.03; // rad | ||
| static final double STEREO_SCALE = 1.0 / STEREO_ANGLE_MAX; | ||
|
|
||
| // ATOF abs_layer convention from Python's build_graph | ||
| static final int ATOF_BAR_ABS_LAYER = 10; // component == 10 | ||
| static final int ATOF_WEDGE_ABS_LAYER = 11; // all other components | ||
|
|
||
| // Track extraction: connected components at a single score threshold, matching | ||
| // gnn/evaluate.py (extract_tracks(..., method="cc", threshold=0.1)). Drop tracks | ||
| // with fewer than MIN_TRACK_NODES total nodes — same filter evaluate.py applies | ||
| // after the method call. | ||
| static final double TRACK_SCORE_THRESHOLD = 0.1; | ||
| static final int MIN_TRACK_NODES = 3; | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Cluster is an overloaded term. It would be a good idea to rename this class AHDCCluster. Or be explicit with interfaces using clusters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
76cfe77