1 // PythiaStdlib.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2008 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
6 // Header file for functionality pulled in from Stdlib,
7 // plus a few useful utilities (small powers).
9 #ifndef Pythia8_PythiaStdlib_H
10 #define Pythia8_PythiaStdlib_H
12 // Stdlib header files for mathematics.
16 // Stdlib header files for strings and containers.
21 // Stdlib header file for input and output.
27 // Define pi if not yet done.
29 #define M_PI 3.1415926535897932385
32 // By this declaration you do not need to use std:: qualifier everywhere.
35 // Alternatively you can specify exactly which std:: methods will be used.
38 // Generic utilities and mathematical functions.
43 // Strings and containers.
47 // Input/output streams.
55 using std::istringstream;
56 using std::ostringstream;
57 // Input/output formatting.
60 using std::scientific;
64 using std::setprecision;
65 } // end namespace Pythia8
70 // Powers of small integers - for balance speed/code clarity.
71 inline double pow2(const double& x) {return x*x;}
72 inline double pow3(const double& x) {return x*x*x;}
73 inline double pow4(const double& x) {return x*x*x*x;}
74 inline double pow5(const double& x) {return x*x*x*x*x;}
75 inline double pow6(const double& x) {return x*x*x*x*x*x;}
77 // Avoid problem with negative square root argument (from roundoff).
78 inline double sqrtpos(const double& x) {return sqrt( max( 0., x));}
80 } // end namespace Pythia8
82 #endif // Pythia8_PythiaStdlib_H