Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Rivet/Math/MathConstants.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef RIVET_Math_MathConstants
0002 #define RIVET_Math_MathConstants
0003 
0004 #include "Rivet/Tools/Exceptions.hh"
0005 #include "Rivet/Tools/Utils.hh"
0006 #include <cmath>
0007 
0008 namespace Rivet {
0009 
0010 
0011   /// Pre-defined numeric type limits
0012   /// A pre-defined value of \f$ \pi \f$.
0013   constexpr double PI = M_PI;
0014 
0015   /// A pre-defined value of \f$ 2\pi \f$.
0016   constexpr double TWOPI = 2*M_PI;
0017 
0018   /// A pre-defined value of \f$ \pi/2 \f$.
0019   constexpr double HALFPI = M_PI_2;
0020 
0021   /// A pre-defined value of \f$ \sqrt{2} \f$.
0022   constexpr double SQRT2 = M_SQRT2;
0023 
0024   /// A pre-defined value of \f$ \sqrt{\pi} \f$.
0025   constexpr double SQRTPI = 2 / M_2_SQRTPI;
0026 
0027   // /// A pre-defined value of \f$ \sqrt{2\pi} \f$.
0028   // constexpr double SQRT2PI = SQRT2 * SQRTPI;
0029 
0030   /// @brief Pre-defined values of \f$ \infty \f$.
0031   ///
0032   /// See https://en.cppreference.com/w/cpp/types/numeric_limits/infinity
0033   constexpr double INFF = HUGE_VALF;
0034   constexpr double INF = HUGE_VAL;
0035   constexpr double INFL = HUGE_VALL;
0036 
0037   // Other useful predefined values already exist in C++, e.g.:
0038   // DBL_MAX
0039   // NAN
0040 
0041 
0042   /// Enum for signs of numbers.
0043   enum Sign { MINUS = -1, ZERO = 0, PLUS = 1 };
0044 
0045   /// Enum for rapidity variable to be used in calculating \f$ R \f$, applying rapidity cuts, etc.
0046   enum RapScheme { PSEUDORAPIDITY = 0, ETARAP = 0, RAPIDITY = 1, YRAP = 1 };
0047 
0048   /// Enum for range of \f$ \phi \f$ to be mapped into
0049   enum PhiMapping { MINUSPI_PLUSPI, ZERO_2PI, ZERO_PI };
0050 
0051 }
0052 
0053 #endif