Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:10

0001 // @(#)root/mathcore:$Id$
0002 // Authors: W. Brown, M. Fischler, L. Moneta    2005
0003 
0004  /**********************************************************************
0005   *                                                                    *
0006   * Copyright (c) 2005 , FNAL MathLib Team                             *
0007   *                                                                    *
0008   *                                                                    *
0009   **********************************************************************/
0010 
0011 
0012 // Header source file for function etaMax
0013 //
0014 // Created by: Mark Fischler  at Thu Jun 2 2005
0015 
0016 
0017 #ifndef ROOT_Math_GenVector_etaMax
0018 #define ROOT_Math_GenVector_etaMax  1
0019 
0020 
0021 #include <limits>
0022 #include <cmath>
0023 
0024 
0025 namespace ROOT {
0026 
0027   namespace Math {
0028 
0029     /**
0030         The following function could be called to provide the maximum possible
0031         value of pseudorapidity for a non-zero rho.  This is log ( max/min )
0032         where max and min are the extrema of positive values for type
0033         long double.
0034      */
0035     inline
0036     long double etaMax_impl() {
0037       using std::log;
0038       return log ( std::numeric_limits<long double>::max()/256.0l ) -
0039              log ( std::numeric_limits<long double>::denorm_min()*256.0l )
0040              + 16.0 * log(2.0);
0041     // Actual usage of etaMax() simply returns the number 22756, which is
0042     // the answer this would supply, rounded to a higher integer.
0043     }
0044 
0045     /**
0046         Function providing the maximum possible value of pseudorapidity for
0047         a non-zero rho, in the Scalar type with the largest dynamic range.
0048      */
0049     template <class T>
0050     inline
0051     T etaMax() {
0052       return static_cast<T>(22756.0);
0053     }
0054 
0055   } // namespace Math
0056 
0057 } // namespace ROOT
0058 
0059 
0060 #endif /* ROOT_Math_GenVector_etaMax  */