JeffersonLab / hps-java

HPS reconstruction and analysis framework in Java
2 stars 10 forks source link

Patches to KF-based Alignment Pipeline #938

Closed tomeichlersmith closed 1 year ago

tomeichlersmith commented 1 year ago

This PR contains a few small but important changes to the KF-based alignment pipeline that are required for it to function properly.

  1. @pbutti implemented the delete method for GblTrajectoryJna which is necessary to avoid a memory leak causing the alignment pipeline to crash on some systems. This crash was more common with KF-based alignment since KF produced more tracks which therefore created more GBL trajectories which therefore leaked more memory.
  2. Since GBL tracker hits consist of two sensors, the "n-hits" cut for GBL is actually half of what it should be for KF. The previous implementation of doubling this cut accidentally doubled the cut on each track which meant the variable holding the cut quickly overflowed and returned to zero, meaning a lot of low-quality KF tracks were being included in the alignment. This patch simply calculates the "actual n hit cut" depending on the type of track on each track, storing the result in a new variable.
  3. Some KF tracks are not refit with a GBL trajectory properly and so we need to check that the resulting GBL trajectory is non-null before proceeding.

To Do