MathHeader.hh

Go to the documentation of this file.
00001 #ifndef RIVET_Math_MathHeader
00002 #define RIVET_Math_MathHeader
00003 
00004 #include <stdexcept>
00005 #include <string>
00006 #include <ostream>
00007 #include <sstream>
00008 #include <iostream>
00009 #include <limits>
00010 #include <cmath>
00011 #include <map>
00012 #include <vector>
00013 #include <algorithm>
00014 
00015 
00016 // Macro to help with overzealous compiler warnings
00017 #ifdef UNUSED
00018 #elif defined(__GNUC__)
00019 # define UNUSED(x) UNUSED_ ## x __attribute__((unused))
00020 #elif defined(__LCLINT__)
00021 # define UNUSED(x) /*@unused@*/ x
00022 #else
00023 # define UNUSED(x) x
00024 #endif
00025 
00026 
00027 namespace Rivet {
00028 
00029   using std::string;
00030   using std::ostream;
00031   using std::ostringstream;
00032   using std::cout;
00033   using std::endl;
00034   using std::pair;
00035   using std::vector;
00036   using std::transform;
00037   using std::min;
00038   using std::max;
00039   using std::abs;
00040 
00041   const double MAXDOUBLE = std::numeric_limits<double>::max();
00042   const double MAXINT = std::numeric_limits<int>::max();
00043 
00044   /// A pre-defined value of \f$ \pi \f$.
00045   const double PI = M_PI;
00046 
00047   /// A pre-defined value of \f$ 2\pi \f$.
00048   const double TWOPI = 2*M_PI;
00049 
00050   /// A pre-defined value of \f$ \pi/2 \f$.
00051   const double HALFPI = M_PI_2;
00052 
00053   /// Enum for signs of numbers.
00054   enum Sign { MINUS = -1, ZERO = 0, PLUS = 1 };
00055 
00056   /// Enum for rapidity variable to be used in calculating \f$ R \f$, applying rapidity cuts, etc.
00057   enum RapScheme { PSEUDORAPIDITY = 0, ETA = 0, RAPIDITY = 1, YRAP = 1 };
00058 
00059   /// Enum for range of \f$ \phi \f$ to be mapped into
00060   enum PhiMapping { MINUSPI_PLUSPI, ZERO_2PI };
00061 
00062 }
00063 
00064 #endif