Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
etaMax.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 , FNAL MathLib Team *
7 * *
8 * *
9 **********************************************************************/
10
11// Header source file for function etaMax
12//
13// Created by: Mark Fischler at Thu Jun 2 2005
14
15#ifndef ROOT_MathX_GenVectorX_etaMax
16#define ROOT_MathX_GenVectorX_etaMax 1
17
19
21
22#include <limits>
23#include <cmath>
24
25// #if !defined(ROOT_MATH_SYCL) && !defined(ROOT_MATH_CUDA)
26// typedef long double d_type;
27// #else
28// typedef d_type double ;
29// #endif
30
31namespace ROOT {
32
33namespace ROOT_MATH_ARCH {
34
35/**
36 The following function could be called to provide the maximum possible
37 value of pseudorapidity for a non-zero rho. This is log ( max/min )
38 where max and min are the extrema of positive values for type
39 long double.
40 */
42{
43 using std::log;
44 return math_log(std::numeric_limits<long double>::max() / 256.0l) -
45 math_log(std::numeric_limits<long double>::denorm_min() * 256.0l) + 16.0 * math_log(2.0);
46 // Actual usage of etaMax() simply returns the number 22756, which is
47 // the answer this would supply, rounded to a higher integer.
48}
49
50/**
51 Function providing the maximum possible value of pseudorapidity for
52 a non-zero rho, in the Scalar type with the largest dynamic range.
53 */
54template <class T>
55inline T etaMax()
56{
57 return static_cast<T>(22756.0);
58}
59
60} // namespace ROOT_MATH_ARCH
61
62} // namespace ROOT
63
64#endif /* ROOT_MathX_GenVectorX_etaMax */
#define __roohost__
Definition AccHeaders.h:36
#define __roodevice__
Definition AccHeaders.h:35
Scalar math_log(Scalar x)
__roohost__ __roodevice__ long double etaMax_impl()
The following function could be called to provide the maximum possible value of pseudorapidity for a ...
Definition etaMax.h:41
T etaMax()
Function providing the maximum possible value of pseudorapidity for a non-zero rho,...
Definition etaMax.h:55