Skip to content

PIDCalib sweighting bug fix

Maarten Van Veghel requested to merge mveghel-pidcalibfix into run2-patches

Fixes the loss-in-stat issue for PIDCalib run2 processing (first seen in v9r5, due to running multiple files per job).

Rough explanation of what happened: The ApplySWeights algorithm updates its cache (of mass to sweight map) when there is a condition change, which is triggered by changing files in a job. This algorithm has a vector of LoKi functors for the mass variables which should be size 1 or 2 (for 1D/2D mass fits respectively). The update cache function always appends a LoKi functor to this vector if it is a 2D map, so if this update cache function is called multiple times per job it will append too many and then it doesn't pass the 1/2 vector size if statements to get the weight from the map in the execute function and the weight remains zero. In a later algorithm a cut is done to remove all zero sweight particles. So the loss in statistics is then caused by this after changing to a second file in the stream, and only to decay channels with 2D mass fits.

@ldufour @vlisovsk

Edited by Maarten Van Veghel

Merge request reports