WIP: Performance improvement and cleanup of KalmanVertexUpdator
This MR significantly speeds up the KalmanVertexUpdator
's update
method by replacing a temporarily created and subsequently destroyed xAOD::Vertex
object by a slim struct. This yields a factor of up to 2.5 speed improvement for the Adaptive multi vertex fitter (see https://its.cern.ch/jira/browse/ATLIDTRKCP-245).
As the existing KalmanVertexUpdator::positionUpdate
method returning an xAOD::Vertex
is public and might be used by other clients, in the current version of the MR a new positionUpdateFast
method is added to achieve this.
If we are sure that there are no clients calling this directly, we can consider replacing it by the new signature to reduce code duplication.
In case we are willing to modify signatures of public methods, it should also be considered whether KalmanVertexUpdator::update
really needs to return a pointer, given it returns the address of the vertex passed by reference, which is being modified in-place anyway.
In addition to this performance tuning, some clean-up to the code was performed (removal of commented lines, attempt to clean up indentation to a consistent scheme, uniform use of messaging macros, use of std algorithms where possible, fix of potential memory leak).
The changes were tested to not change the reco output (except for CPU/timings) when running a q221 modified to include the AMVF as vertex finder/fitter.
Adding @sroe and @npetters who are also working on improving the AMVF performance.