17#ifndef ROOT_Math_GenVector_eta
18#define ROOT_Math_GenVector_eta 1
47 template<
typename Scalar>
52 static const Scalar big_z_scaled = pow(std::numeric_limits<Scalar>::epsilon(),
static_cast<Scalar>(-.25));
56 if (std::fabs(z_scaled) < big_z_scaled) {
59 return log(z_scaled + std::sqrt(z_scaled * z_scaled + 1.0));
63 return z > 0 ? log(2.0 * z_scaled + 0.5 / z_scaled) : -log(-2.0 * z_scaled);
71 return z + etaMax<Scalar>();
74 return z - etaMax<Scalar>();
84 template<
typename Scalar>
86 Scalar tanThetaOver2 = tan(theta / 2.);
87 if (tanThetaOver2 == 0) {
88 return r + etaMax<Scalar>();
90 else if (tanThetaOver2 > std::numeric_limits<Scalar>::max()) {
91 return -
r - etaMax<Scalar>();
95 return -log(tanThetaOver2);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Namespace for new Math classes and functions.
Scalar Eta_FromTheta(Scalar theta, Scalar r)
Implementation of eta from -log(tan(theta/2)).
Scalar Eta_FromRhoZ(Scalar rho, Scalar z)
Calculate eta given rho and zeta.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.