35 #include "TGraphErrors.h" 49 #define BIG 1.79768e+308 50 #define BIGINT 2147483647 51 #define BIGSIZE 18446744073709551615 54 #define M_PI 3.14159265358979323846 56 #define NINT(a) ( int(floor((a)+0.5)) ) 57 #define SGN(a) ( (a)<0 ? -1 : ( (a)>0 ? +1 : 0 ) ) 59 inline int SQR(
int b) {
return b*
b;}
60 inline float SQR(
float b) {
return b*
b;}
61 inline double SQR(
double b) {
return b*
b;}
62 inline long double SQR(
long double b) {
return b*
b;}
64 inline int CUBE(
int b) {
return b*b*
b;}
65 inline float CUBE(
float b) {
return b*b*
b;}
66 inline double CUBE(
double b) {
return b*b*
b;}
67 inline long double CUBE(
long double b) {
return b*b*
b;}
69 inline int QUAD(
int b) {
int p = b*
b;
return p*
p;}
70 inline float QUAD(
float b) {
float p = b*
b;
return p*
p;}
71 inline double QUAD(
double b) {
double p = b*
b;
return p*
p;}
72 inline long double QUAD(
long double b) {
long double p = b*
b;
return p*
p;}
77 inline double Qadd(
double const x,
double const y){
80 inline double Qadd(
double const x,
double const y,
double const z){
81 double absX,absY,absZ;
82 absX = fabs(x); absY = fabs(y); absZ = fabs(z);
87 inline double Qsub(
double const x,
double const y) {
88 if (std::fabs(x) < std::fabs(y)) {
89 std::cout <<
"Fatality in Qsub(double,double): Invalid arguments";
93 long double x2 = x*
x;
long double y2 = y*
y;
94 return double(std::sqrt( x2 - y2 ));
100 inline double binerr(
double const passed,
double const tested) {
102 if ((passed<0) || (tested<=0) || (passed>tested)) {
103 std::cout <<
"Fatality in binerr(double,double): Invalid arguments ";
104 std::cout << passed <<
"/" << tested <<
std::endl;
111 }
else if ( passed==0.0 || passed==tested ) {
112 err = 0.421 /
pow(tested,0.94);
114 err = std::sqrt( passed*(tested-passed)/tested );
125 char*
temp =
new char[32];
126 double rat = 1000.0*double(num)/double(den);
127 double err = 1000.0*
binerr(
double(num),
double(den));
129 sprintf(temp,
"%5.2f %c%c %5.2f m%c%c", rat, 0xC2,0xB1, err, 0xC2,0xB0);
138 int retval =
stat(filename.c_str(), &buf);
139 if (retval==0 && !S_ISREG(buf.st_mode)) {
140 cout <<
"filehamna(string) : Not a regular file" <<
endl;
143 return (retval == -1);
183 double const Mpi0 = 0.13497770;
205 if (PDGcode > 1000000000) {
206 int A = (PDGcode -1000000000)/10;
208 return A * (39.948 / 40.0);
267 if (PDGcode > 1000000000)
return true;
double Qsub(double const x, double const y)
double binerr(double const passed, double const tested)
bool chargedPDG(int PDGcode)
double Qadd(double const x, double const y)
bool filehamna(const std::string &filename)
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
char * stringEffErr(int num, int den)
void err(const char *fmt,...)
double massPDG(int PDGcode)
QTextStream & endl(QTextStream &s)