|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #ifndef CXXUTILS_PHIHELPER_H
11 #define CXXUTILS_PHIHELPER_H
14 #include <type_traits>
28 constexpr
auto PI =
static_cast<T
>(
M_PI);
30 if (phi < -100 || phi > 100) {
33 while (phi >
PI) phi -= 2 *
PI;
34 while (phi < -
PI) phi += 2 *
PI;
80 T phi = 0.5 * (phiA + phiB);
81 if (phiA > phiB) phi +=
M_PI;
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
T phiMean(T phiA, T phiB)
Calculate average of two angles.
T phiBisect(T phiA, T phiB)
Bisect (average) the angle spanned by phiA and phiB.
std::vector< std::string > remainder(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
list of entries in a vector that are not in another
T deltaPhi(T phiA, T phiB)
Return difference phiA - phiB in range [-pi, pi].