23 double A = pow(x, a1) * pow((1 - x), a2) * (a3 * pow((1 - x), 0) +
24 a4 * pow((1 - x), 1) +
25 a5 * pow((1 - x), 2) +
26 a6 * pow((1 - x), 3) +
27 a7 * pow((1 - x), 4));
28 double B = b1 + b2 * x + (b3 / (x + b4));
29 double C = ( c1 * pow(x, 1) +
36 double F2_fit = A * pow( ( log(Q2 / lambda2) / log(Q02 / lambda2) ), B) * (1 + (C / Q2));
50 R_tmp = 1.509 * pow(x, -0.0458) * pow((1-x), -0.0084) / log((Q2 / 0.04)) - 0.203;
55 R_tmp = 1.509 * pow(x, -0.0458) * pow((1-x), -0.0084) / log((Q2 / 0.04)) - 0.203;
79 double gamma2 = pow(( 2 * M * x ), 2) / Q2;
87 y * ( 2 -
y ) * ( 1 + gamma2 * y / 2. ) - 2 * pow(y, 3) * pow(ml, 2) / Q2
90 pow(y, 2) * ( 1 + gamma2 ) * (1 - 2 * pow(ml, 2) / Q2 )
91 + 2 * (1 - y - gamma2 * pow(y, 2) / 4 ) * (1 + R )
93 double D = D_num / D_denom;
104 double pol_electron = 0.7;
105 double pol_proton = 0.7;
106 double pol_prod = pol_electron * pol_proton;
114 get_g1_value(
double x_val,
double Q2_val,
double y_val,
double mlepton=0.000511 )
130 double A1_Ernst = 0.033;
131 double A_parallel = D * A1_Ernst;
133 double g1_val = 1. / (2 * x_val * (1 +
R)) * F2 * A_parallel / D;
142 get_g1_sigma(
double x_val,
double Q2_val,
double y_val,
double N_val,
double mlepton=0.000511 )
154 double A_parallel_sig = (sqrt(N_val) / N_val) * (1. / pol_prod);
155 double g1_sig = 1. / (2 * x_val * (1 +
R)) * F2 * A_parallel_sig / D;
163 get_A1_sigma(
double x_val,
double Q2_val,
double y_val,
double N_val,
double mlepton=0.000511 )
168 double gamma2 = pow(( 2 * M * x_val ), 2) / Q2_val;
173 double F1 = ( ( 1 + gamma2 ) / ( 2 * x_val * ( 1 + R ) ) ) *
F2;
176 double g1_sig =
get_g1_sigma( x_val, Q2_val, y_val, N_val, mlepton );
177 double A1_sig = g1_sig /
F1;
185 calculate_g1(
double x_val,
double Q2_val,
double y_val,
double N_val,
double mlepton=0.000511 )
187 double g1_val =
get_g1_value(x_val, Q2_val, y_val, mlepton);
188 double g1_sig =
get_g1_sigma(x_val, Q2_val, y_val, N_val, mlepton);
194 cout <<
"-----------------------------------------------------------------------" << endl;
195 cout <<
"x = " << x_val <<
" , Q2 = " << Q2_val <<
" , y = " << y_val <<
" , N = " << N_val << endl;
196 cout <<
"F2 = " << F2 <<
", R = " << R <<
", D = " << D << endl;
197 cout <<
"==> g1 = " << g1_val <<
" +/- " << g1_sig << endl;
198 cout <<
"-----------------------------------------------------------------------" << endl;