ATLASRECTS-5489 GSF : Merging simplify the code
Simplify the code and fix https://its.cern.ch/jira/projects/ATLASRECTS/issues/ATLASRECTS-5489
more or less
- https://arxiv.org/pdf/2001.00727.pdf [1] formula 10 or
- https://www.sciencedirect.com/science/article/pii/089812218990103X [2] formula 16
- make it easier to formulate the problem
- rather than the way proposed in https://www.sciencedirect.com/science/article/pii/S0010465596001555 [3] that cites [2] but presents it as a diff (you end up at the same ordering as all distances get -2)
i.e [1],[2] make it easier to be sure you keep it positive .
Beyond that tried to simplify a bit some of the branches to make things a bit easier to follow, actually we do not seem to gain (actually sligthly lose ) in some of my benchmarks by branching to avoid 3-4 multiplications.
Edited by Christos Anastopoulos