Skip to content

Helper documentation, static asserts, tests

Paul Gessinger-Befurt requested to merge helper-doc-static-assert into master

This MR does some improvements to the helpers in Acts/Utilities/Helpers.hpp:

  1. Add tests for all the helper functions (we didn't have any explicit tests for these before)
  2. Add doc comments for all of them
  3. Change phi, perp, theta and eta. They previously already accepted any input Eigen type, static or dynamic, but always called .rows() to query if the number of rows was sufficient. In case not (for phi and perp < 2, for theta and eta <3) they silently returned 0. After this MR:
    • In case the given Eigen type is statically sized, a compile time assertion on these dimensions is done. That means if you now plug a Vector2D into theta() it won't compile.
    • In case it's dynamically sized, it will not silently return 0, but print an error message to STDERR and then terminate the program execution. The reason for not using exceptions is that I don't want to introduce exception handling into potentially hot code-paths (and who knows where these helpers might be used).
  4. Make phi, perp, theta and eta noexcept as an extension of point 4.
Edited by Paul Gessinger-Befurt

Merge request reports