Skip to content

Fix track masking in the scaling

Samuel Van Stroud requested to merge svanstro/fix-scaling-bug into master

Masking previously happened in a few different places, in a few different ways.

  • Checking the first track variable for NaN, and building a mask from this. Using the first variable was unstable, as we are relying on it being float, which is not always the case. This meant the masking broke for the new samples in some cases.
  • Elsewhere, we used a tracks == 0 check, after running np.nan_to_num. This is also broken as there are some possible int vars (e.g. JFVertexIndex, leptonID) for which 0 is a valid value, and the default for padded tracks is -1.

This implements a solution for both problems, using the valid flag (which is designed for this use) where possible, and, if it is not available, defaulting to finding the first float variable and using a NaN check.

@mguth @alfroch

Edited by Samuel Van Stroud

Merge request reports