10 #ifndef Pythia8_PythiaStdlib_H
11 #define Pythia8_PythiaStdlib_H
24 #include <unordered_map>
42 #define M_PI 3.1415926535897932385
48 #ifndef __ENABLE_FP_DEBUG__
49 #define __ENABLE_FP_DEBUG__
51 static void __attribute__((constructor)) raisefpe() {
52 feenableexcept (FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
83 using std::unordered_map;
85 using std::priority_queue;
100 using std::stringstream;
101 using std::istringstream;
102 using std::ostringstream;
108 using std::scientific;
112 using std::setprecision;
115 using std::shared_ptr;
117 using std::dynamic_pointer_cast;
118 using std::make_shared;
125 constexpr
double HBARC = 0.19732698;
126 constexpr
double GEV2FMINV = 1. / HBARC;
127 constexpr
double GEVINV2FM = HBARC;
128 constexpr
double FM2GEVINV = 1./HBARC;
129 constexpr
double FMINV2GEV = HBARC;
132 constexpr
double HBARCSQ = 0.38937937;
133 constexpr
double GEVSQ2MBINV = 1. / HBARCSQ;
134 constexpr
double GEVSQINV2MB = HBARCSQ;
135 constexpr
double MB2GEVSQINV = 1. / HBARCSQ;
136 constexpr
double MBINV2GEVSQ = HBARCSQ;
139 constexpr
double FM2MM = 1e-12;
140 constexpr
double MM2FM = 1e12;
143 constexpr
double MB2PB = 1e9;
144 constexpr
double PB2MB = 1e-9;
145 constexpr
double MB2FB = 1e12;
146 constexpr
double FB2MB = 1e-12;
149 constexpr
double FMSQ2MB = 10.;
150 constexpr
double MB2FMSQ = 0.1;
153 constexpr
double pow2(
const double& x) {
return x*x;}
154 constexpr
double pow3(
const double& x) {
return x*x*x;}
155 constexpr
double pow4(
const double& x) {
return x*x*x*x;}
156 constexpr
double pow5(
const double& x) {
return x*x*x*x*x;}
157 constexpr
double pow6(
const double& x) {
return x*x*x*x*x*x;}
158 constexpr
double pow7(
const double& x) {
return x*x*x*x*x*x*x;}
159 constexpr
double pow8(
const double& x) {
return x*x*x*x*x*x*x*x;}
162 inline double sqrtpos(
const double& x) {
return sqrt( max( 0., x));}
165 inline double clamp(
const double& x,
const double& xmin,
const double& xmax) {
166 return (x < xmin) ? xmin : (x > xmax) ? xmax : x; }
170 string toLower(
const string& name,
bool trim =
true);
173 inline void toLowerRep(
string& name,
bool trim =
true) {
174 name = toLower( name, trim);}
178 #endif // Pythia8_PythiaStdlib_H