File indexing completed on 2025-01-18 09:58:26
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
0046 namespace G4INCL {
0047 class Particle;
0048
0049 namespace PhysicalConstants {
0050
0051 const G4double hc = 197.328;
0052
0053
0054 const G4double hcSquared = hc*hc;
0055
0056
0057 const G4double Pf = 1.37*hc;
0058
0059
0060
0061
0062
0063
0064 const G4double eSquared = 1.439964;
0065 }
0066
0067 namespace Math {
0068 const G4double pi = 3.14159265358979323846264338328;
0069 const G4double twoPi = 2.0 * pi;
0070 const G4double tenPi = 10.0 * pi;
0071 const G4double piOverTwo = 0.5 * pi;
0072 const G4double oneOverSqrtTwo = 1./std::sqrt((G4double)2.);
0073 const G4double oneOverSqrtThree = 1./std::sqrt((G4double)3.);
0074 const G4double oneThird = 1./3.;
0075 const G4double twoThirds = 2./3.;
0076 const G4double sqrtFiveThirds = std::sqrt(5./3.);
0077 const G4double sqrtThreeFifths = std::sqrt(3./5.);
0078
0079 inline G4double toDegrees(G4double radians) {
0080 return radians * (180.0 / pi);
0081 }
0082
0083 inline G4int heaviside(G4int n) {
0084 if(n < 0) return 0;
0085 else return 1;
0086 }
0087
0088 inline G4double pow13(G4double x) {
0089 return std::pow(x, oneThird);
0090 }
0091
0092 inline G4double powMinus13(G4double x) {
0093 return std::pow(x, -oneThird);
0094 }
0095
0096 inline G4double pow23(G4double x) {
0097 return std::pow(x, twoThirds);
0098 }
0099
0100 inline G4double aSinH(G4double x) {
0101 return std::log(x + std::sqrt(x*x+1.));
0102 }
0103
0104
0105
0106
0107 template <typename T> inline G4int sign(const T t) {
0108 return t > 0 ? 1: t < 0 ? -1 : 0;
0109 }
0110
0111
0112 template <typename T> inline T max(const T t1, const T t2) {
0113 return t1 > t2 ? t1 : t2;
0114 }
0115
0116
0117 template <typename T> inline T min(const T t1, const T t2) {
0118 return t1 < t2 ? t1 : t2;
0119 }
0120
0121
0122
0123
0124
0125
0126
0127
0128 G4double gaussianCDF(const G4double x);
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139 G4double gaussianCDF(const G4double x, const G4double x0, const G4double sigma);
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149 G4double inverseGaussianCDF(const G4double x);
0150
0151
0152 G4double arcSin(const G4double x);
0153
0154
0155 G4double arcCos(const G4double x);
0156 }
0157
0158 namespace ParticleConfig {
0159 G4bool isPair(Particle const * const p1, Particle const * const p2, ParticleType t1, ParticleType t2);
0160 }
0161
0162 #ifndef INCLXX_IN_GEANT4_MODE
0163 namespace String {
0164 void wrap(std::string &str, const size_t lineLength=78, const std::string &separators=" \t");
0165 void replaceAll(std::string &str, const std::string &from, const std::string &to, const size_t maxPosition=std::string::npos);
0166 std::vector<std::string> tokenize(std::string const &str, const std::string &delimiters);
0167 G4bool isInteger(std::string const &str);
0168 std::string expandPath(std::string const &path);
0169 }
0170 #endif
0171 }
0172 #endif