8 #include "Pythia8/DireBasics.h"
12 bool checkSIJ(
const Event& e,
double minSIJ) {
14 for (
int i=0; i < e.size(); ++i) {
15 if (!e[i].isFinal() && e[i].mother1() !=1 && e[i].mother1() !=2)
continue;
16 for (
int j=0; j < e.size(); ++j) {
18 if (!e[j].isFinal() && e[j].mother1() !=1 && e[j].mother1() !=2)
20 sijmin=min(sijmin,abs(2.*e[i].p()*e[j].p()));
23 return (sijmin>minSIJ);
28 void printSI(
const Event& e) {
29 for (
int i=0; i < e.size(); ++i) {
30 if (!e[i].isFinal() && e[i].mother1() !=1 && e[i].mother1() !=2)
continue;
31 cout <<
" [" << e[i].isFinal()
33 << e[i].p().m2Calc() <<
"],\n";
39 void printSIJ(
const Event& e) {
40 for (
int i=0; i < e.size(); ++i) {
41 if (!e[i].isFinal() && e[i].mother1() !=1 && e[i].mother1() !=2)
continue;
42 for (
int j=0; j < e.size(); ++j) {
44 if (!e[j].isFinal() && e[j].mother1() !=1 && e[j].mother1() !=2)
46 cout <<
" [" << e[i].isFinal() << e[j].isFinal()
47 <<
" s("<< i <<
"," << j <<
")="
48 << 2.*e[i].p()*e[j].p() <<
"],\n";
57 ulong shash(
const std::string& str) {
59 for (
size_t i = 0; i < str.size(); ++i)
60 hash = 33 * hash + (
unsigned char)str[i];
68 double polev(
double x,
double* coef,
int N ) {
88 double dilog(
double x) {
90 static double cof_A[8] = {
91 4.65128586073990045278E-5,
92 7.31589045238094711071E-3,
93 1.33847639578309018650E-1,
94 8.79691311754530315341E-1,
95 2.71149851196553469920E0,
96 4.25697156008121755724E0,
97 3.29771340985225106936E0,
98 1.00000000000000000126E0,
100 static double cof_B[8] = {
101 6.90990488912553276999E-4,
102 2.54043763932544379113E-2,
103 2.82974860602568089943E-1,
104 1.41172597751831069617E0,
105 3.63800533345137075418E0,
106 5.03278880143316990390E0,
107 3.54771340985225096217E0,
108 9.99999999999999998740E-1,
112 return -dilog(1./x)+M_PI*M_PI/3.-0.5*pow2(log(x));
121 return( M_PI*M_PI/6.0 );
143 y = -w * polev( w, cof_A, 7) / polev( w, cof_B, 7 );
146 y = (M_PI * M_PI)/6.0 - log(x) * log(1.0-x) - y;
150 y = -0.5 * z * z - y;
157 double lABC(
double a,
double b,
double c) {
return pow2(a-b-c) - 4.*b*c;}
158 double bABC(
double a,
double b,
double c) {
160 if ((a-b-c) > 0.) ret = sqrt(lABC(a,b,c));
161 else if ((a-b-c) < 0.) ret =-sqrt(lABC(a,b,c));
164 double gABC(
double a,
double b,
double c) {
return 0.5*(a-b-c+bABC(a,b,c));}