Helper documentation, static asserts, tests
This MR does some improvements to the helpers in Acts/Utilities/Helpers.hpp
:
- Add tests for all the helper functions (we didn't have any explicit tests for these before)
- Add doc comments for all of them
- Change
phi
,perp
,theta
andeta
. 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 (forphi
andperp
< 2
, fortheta
andeta
<3
) they silently returned0
. 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
intotheta()
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).
- 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
- Make
phi
,perp
,theta
andeta
noexcept
as an extension of point 4.
Edited by Paul Gessinger