Logo ROOT   6.18/05
Reference Guide
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
12// Header source file for function etaMax
13//
14// Created by: Mark Fischler at Thu Jun 2 2005
15
16
17#ifndef ROOT_Math_GenVector_etaMax
18#define ROOT_Math_GenVector_etaMax 1
19
20
21#include <limits>
22#include <cmath>
23
24
25namespace ROOT {
26
27 namespace Math {
28
29 /**
30 The following function could be called to provide the maximum possible
31 value of pseudorapidity for a non-zero rho. This is log ( max/min )
32 where max and min are the extrema of positive values for type
33 long double.
34 */
35 inline
36 long double etaMax_impl() {
37 return std::log ( std::numeric_limits<long double>::max()/256.0l ) -
38 std::log ( std::numeric_limits<long double>::denorm_min()*256.0l )
39 + 16.0 * std::log(2.0);
40 // Actual usage of etaMax() simply returns the number 22756, which is
41 // the answer this would supply, rounded to a higher integer.
42 }
43
44 /**
45 Function providing the maximum possible value of pseudorapidity for
46 a non-zero rho, in the Scalar type with the largest dynamic range.
47 */
48 template <class T>
49 inline
51 return static_cast<T>(22756.0);
52 }
53
54 } // namespace Math
55
56} // namespace ROOT
57
58
59#endif /* ROOT_Math_GenVector_etaMax */
double log(double)
Namespace for new Math classes and functions.
double T(double x)
Definition: ChebyshevPol.h:34
long double etaMax_impl()
The following function could be called to provide the maximum possible value of pseudorapidity for a ...
Definition: etaMax.h:36
T etaMax()
Function providing the maximum possible value of pseudorapidity for a non-zero rho,...
Definition: etaMax.h:50
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21