Skip to content

RICH Future : Fix build platform differences.

Christopher Rob Jones requested to merge RichFuture-FixBuildDiffs into master

This MR (starts) to address differences observed between the opt and dbg builds, due to the use of -O3 in the opt build.

The RICH uses ray tracing of photon candidates to determine a number of factor, such as the overall Cherenkov cone acceptance factors, and average per ring PD Q.E. curves for example. This is done by ray tracing a fixed number (96) photons around the track, for each Cherenkov cone, and in effect counting those that get detected. Small differences in floating point calculations mean there will always be photons that binary flip between yes or no in different builds, and this then results in a 1/96, or O(1%) difference in the quantities calculated using these results, which is noticeable.

I was not able to find any way to remove this, using for instance precision truncation, as the code uses SIMD types (Vc) and its not at all clear how to do this in a clean way. So for the moment I force the use of -O3 on the debug build as well.

Note, going forward, this MR is not complete as there are still differences if I compare the results from the various SIMD CPU results. Improving this is going to require more work, and thought, but when done will likely also fix the opt/dbg diffs and thus might mean the -O3 hack can be removed. Until then I think this is the least worse fix.

Merge request reports