Skip to content

Conversation

@mathieuouillon
Copy link
Collaborator

@mathieuouillon mathieuouillon commented Dec 2, 2025

Changes in the pull request:

  • PreclusterSuperlayer renamed Intercluster; they are now linked to a track with the trackId.
  • Model renamed to ModelTrackFinding for better clarity. It can now predict all tracks at once, improving speed.
  • Use only on preclustering in PreClusterFinder instead of 2 the conventional one and the AI one.
  • Fix a bug in the preclustering when more than 3 wires are one after the other.
  • The Track class now has both the clusters and interclusters that form the track. Also, set the trackId to the clusters and interclusters.
  • Rename Mode to ModeTrackFinding for clarity
  • Create ModelTrackMatching class to predict which sector, layer, and wedge should be hit.
  • AHDCEngine:
    • Add some constants for clarity (TRACK_FINDING_AI_THRESHOLD and MAX_HITS_FOR_AI)
    • Answer a few comments
    • Use the logger instead of print
    • The logic for the engine is: Read the hits -> create preclusters -> track finding, 2 possibilities:
      • AI-based Track Finding: Merge preclusters into interclusters -> Generate all track candidates -> Evaluate each candidate with AI -> Select final tracks -> result: a list of tracks, each with a list of InterClusters
      • Conventional Track Finding (Distance or Hough): Build clusters -> Track finding -> result: list of tracks containing clusters.
    • The track ID for clusters and interclusters is done in the Kalman Filter. If AI is used for track finding, generate clusters; if conventional methods generate interclusters.
    • The track ID of the interclusters is used in the Track Matching algorithm in the ALERT Engine.
  • ALERTEngine: Extract intercluster patterns for each track -> AI model predicts which ATOF wedge the track will hit -> Compare predicted hit to real ATOF hits -> pick the hit closest to the AI prediction (in terms of xyz distance) -> write the ATOF hit id to the new ALERT::ai:prediction bank.

@mathieuouillon
Copy link
Collaborator Author

@mathieuouillon
Copy link
Collaborator Author

@baltzell Hi, I think the unittest fails because it uses cvmfs to get the networks, and it is the wrong commit of the networks repo.

@c-dilks
Copy link
Member

c-dilks commented Dec 10, 2025

unittest fails because it uses cvmfs to get the networks

Makes sense, assuming cvmfs is behind. I pushed a commit to switch the relevant CI jobs to use LFS.

@mathieuouillon
Copy link
Collaborator Author

Thanks Chris

@baltzell
Copy link
Collaborator

Mathieu, can you describe conceptually what these changes amount to?

@mathieuouillon
Copy link
Collaborator Author

Sure, here is a summary. Let me know if you’d like more details:

Changes in the pull request:

  • PreclusterSuperlayer renamed Intercluster; they are now linked to a track with the trackId.
  • Model renamed to ModelTrackFinding for better clarity. It can now predict all tracks at once, improving speed.
  • Use only on preclustering in PreClusterFinder instead of 2 the conventional one and the AI one.
  • Fix a bug in the preclustering when more than 3 wires are one after the other.
  • The Track class now has both the clusters and interclusters that form the track. Also, set the trackId to the clusters and interclusters.
  • Rename Mode to ModeTrackFinding for clarity
  • Create ModelTrackMatching class to predict which sector, layer, and wedge should be hit.
  • AHDCEngine:
    • Add some constants for clarity (TRACK_FINDING_AI_THRESHOLD and MAX_HITS_FOR_AI)
    • Answer a few comments
    • Use the logger instead of print
    • The logic for the engine is: Read the hits -> create preclusters -> track finding, 2 possibilities:
      • AI-based Track Finding: Merge preclusters into interclusters -> Generate all track candidates -> Evaluate each candidate with AI -> Select final tracks -> result: a list of tracks, each with a list of InterClusters
      • Conventional Track Finding (Distance or Hough): Build clusters -> Track finding -> result: list of tracks containing clusters.
    • The track ID for clusters and interclusters is done in the Kalman Filter. If AI is used for track finding, generate clusters; if conventional methods generate interclusters.
    • The track ID of the interclusters is used in the Track Matching algorithm in the ALERT Engine.
  • ALERTEngine: Extract intercluster patterns for each track -> AI model predicts which ATOF wedge the track will hit -> Compare predicted hit to real ATOF hits -> pick the hit closest to the AI prediction (in terms of xyz distance) -> write the ATOF hit id to the new ALERT::ai:prediction bank.

@c-dilks
Copy link
Member

c-dilks commented Dec 10, 2025

Sure, here is a summary. Let me know if you’d like more details:

sorry, could you put this in the PR description up top, please?

@mathieuouillon
Copy link
Collaborator Author

No problem, it's now in the first comment.

@baltzell baltzell force-pushed the alert-track-matching-ai branch 2 times, most recently from 601a7cc to 971d20e Compare December 10, 2025 21:37
mathieuouillon and others added 9 commits December 11, 2025 15:06
…ers and link them to their associated track.

- Introduced new intercluster data structure in alert.json to store track ID and coordinates.
- Add to InterCluster class the track ID.
- Rename TrackConstruction to TrackCandidatesGenerator.
- Updated Track class to manage interclusters and clusters and set track IDs.
- Modified AHDCEngine to have similar interface for AI and conventional track finding.
- Use the AI precluster algorithm for everthings (CV and AI)
@baltzell baltzell force-pushed the alert-track-matching-ai branch from 971d20e to 3f5f733 Compare December 11, 2025 20:06
@baltzell baltzell enabled auto-merge (squash) December 11, 2025 20:06
@baltzell baltzell merged commit e460eaf into development Dec 11, 2025
37 checks passed
tongtongcao pushed a commit that referenced this pull request Dec 31, 2025
* Start an implementation for the track matching for ALERT

* Fix the path for the ALERT AI models

* ALERT: Improve the AI model for track finding

* ALERT: Change name of the model class for the track finding

* ALERT: Rename some variables and class (Mode to ModeTrackFinding)

* ALERT: change superpreclusters to InterCluster

* Move the track matching to the ALERT Engine

* ALERT: change the structure of the AHDCEngine to write the interclusters and link them to their associated track.

- Introduced new intercluster data structure in alert.json to store track ID and coordinates.
- Add to InterCluster class the track ID.
- Rename TrackConstruction to TrackCandidatesGenerator.
- Updated Track class to manage interclusters and clusters and set track IDs.
- Modified AHDCEngine to have similar interface for AI and conventional track finding.
- Use the AI precluster algorithm for everthings (CV and AI)

* Fix the track matching AI and the output bank

* Add the model and fix the constant loader in the ATOF

* Modify HipoDataSync initialization in AHDCEngine

* Update model path for TrackMatchingAI to use the new path for AI models

* Remove the AI networks

* Update model path for ALERT model in ModelTrackFinding

* Update model path for TrackMatchingAI

* fix(ci): use `--lfs` with `--unittests`

---------

Co-authored-by: Christopher Dilks <c-dilks@users.noreply.github.com>
tongtongcao pushed a commit that referenced this pull request Dec 31, 2025
* Start an implementation for the track matching for ALERT

* Fix the path for the ALERT AI models

* ALERT: Improve the AI model for track finding

* ALERT: Change name of the model class for the track finding

* ALERT: Rename some variables and class (Mode to ModeTrackFinding)

* ALERT: change superpreclusters to InterCluster

* Move the track matching to the ALERT Engine

* ALERT: change the structure of the AHDCEngine to write the interclusters and link them to their associated track.

- Introduced new intercluster data structure in alert.json to store track ID and coordinates.
- Add to InterCluster class the track ID.
- Rename TrackConstruction to TrackCandidatesGenerator.
- Updated Track class to manage interclusters and clusters and set track IDs.
- Modified AHDCEngine to have similar interface for AI and conventional track finding.
- Use the AI precluster algorithm for everthings (CV and AI)

* Fix the track matching AI and the output bank

* Add the model and fix the constant loader in the ATOF

* Modify HipoDataSync initialization in AHDCEngine

* Update model path for TrackMatchingAI to use the new path for AI models

* Remove the AI networks

* Update model path for ALERT model in ModelTrackFinding

* Update model path for TrackMatchingAI

* fix(ci): use `--lfs` with `--unittests`

---------

Co-authored-by: Christopher Dilks <c-dilks@users.noreply.github.com>
@baltzell baltzell deleted the alert-track-matching-ai branch January 7, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants