File indexing completed on 2026-09-25 09:13:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #define INCLXX_IN_GEANT4_MODE 1
0035
0036 #include "globals.hh"
0037
0038 #ifndef G4INCLGlobals_hh
0039 #define G4INCLGlobals_hh 1
0040
0041 #include <cmath>
0042 #include <string>
0043 #include <vector>
0044 #include "G4INCLParticleType.hh"
0045 #include <iostream>
0046
0047 namespace G4INCL {
0048 class Particle;
0049
0050 namespace PhysicalConstants {
0051
0052 const G4double hc = 197.328;
0053
0054
0055 const G4double hcSquared = hc*hc;
0056
0057
0058 const G4double Pf = 1.37*hc;
0059
0060
0061
0062
0063
0064
0065 const G4double eSquared = 1.439964;
0066 }
0067
0068 namespace Math {
0069 const G4double pi = 3.14159265358979323846264338328;
0070 const G4double twoPi = 2.0 * pi;
0071 const G4double tenPi = 10.0 * pi;
0072 const G4double piOverTwo = 0.5 * pi;
0073 const G4double oneOverSqrtTwo = 1./std::sqrt((G4double)2.);
0074 const G4double oneOverSqrtThree = 1./std::sqrt((G4double)3.);
0075 const G4double oneThird = 1./3.;
0076 const G4double twoThirds = 2./3.;
0077 const G4double sqrtFiveThirds = std::sqrt(5./3.);
0078 const G4double sqrtThreeFifths = std::sqrt(3./5.);
0079
0080 inline G4double toDegrees(G4double radians) {
0081 return radians * (180.0 / pi);
0082 }
0083
0084 inline G4int heaviside(G4int n) {
0085 if(n < 0) return 0;
0086 else return 1;
0087 }
0088
0089 inline G4double pow13(G4double x) {
0090 return std::pow(x, oneThird);
0091 }
0092
0093 inline G4double powMinus13(G4double x) {
0094 return std::pow(x, -oneThird);
0095 }
0096
0097 inline G4double pow23(G4double x) {
0098 return std::pow(x, twoThirds);
0099 }
0100
0101 inline G4double aSinH(G4double x) {
0102 return std::log(x + std::sqrt(x*x+1.));
0103 }
0104
0105
0106
0107
0108 template <typename T> inline G4int sign(const T t) {
0109 return t > 0 ? 1: t < 0 ? -1 : 0;
0110 }
0111
0112
0113 template <typename T> inline T max(const T t1, const T t2) {
0114 return t1 > t2 ? t1 : t2;
0115 }
0116
0117
0118 template <typename T> inline T min(const T t1, const T t2) {
0119 return t1 < t2 ? t1 : t2;
0120 }
0121
0122
0123
0124
0125
0126
0127
0128
0129 G4double gaussianCDF(const G4double x);
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140 G4double gaussianCDF(const G4double x, const G4double x0, const G4double sigma);
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150 G4double inverseGaussianCDF(const G4double x);
0151
0152
0153 G4double arcSin(const G4double x);
0154
0155
0156 G4double arcCos(const G4double x);
0157 }
0158
0159 namespace ParticleConfig {
0160 G4bool isPair(Particle const * const p1, Particle const * const p2, ParticleType t1, ParticleType t2);
0161 }
0162
0163 #ifndef INCLXX_IN_GEANT4_MODE
0164 namespace String {
0165 void wrap(std::string &str, const size_t lineLength=78, const std::string &separators=" \t");
0166 void replaceAll(std::string &str, const std::string &from, const std::string &to, const size_t maxPosition=std::string::npos);
0167 std::vector<std::string> tokenize(std::string const &str, const std::string &delimiters);
0168 G4bool isInteger(std::string const &str);
0169 std::string expandPath(std::string const &path);
0170 }
0171 #endif
0172 }
0173 #endif