/**************************************************************************/ /**************************************************************************/ /* */ /* This program calculates the */ /* pion electroproduction cross sections on a nucleon */ /* e + N -> e + pi + N */ /* 1. high s and low t (t-channel Regge exchanges) */ /* 2. high s and low u (u-channel Regge exchanges). */ /* */ /* All dimensional quantities in this program are in units GeV. */ /* */ /**************************************************************************/ /**************************************************************************/ /*************************************************************/ /* */ /* Authors : Marc Vanderhaeghen & Michel Guidal */ /* */ /* First run : 24/04/1997 */ /* */ /* Last update : 03/09/1998 */ /* */ /*************************************************************/ /************************************/ /* GENERAL STRUCTURE OF THE PROGRAM */ /************************************/ /**************************************************************************/ /* */ /* -> main() : all input/output of the program */ /* -> e + N -> e + pi + N : CROSS SECTIONS and ASYMMETRIES */ /* -> e + N -> e + pi + N : RESPONSE FUNCTIONS */ /* -> Regge trajectories */ /* -> Form factors */ /* -> gamma^* + N -> pi + N AMPLITUDES */ /* */ /**************************************************************************/ #include #include #include #include #include #include #include #include #include #include /**************************************************************************/ /**************************************************************************/ double dsigma_dt(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double phi_min, double phi_max, double epsilon, double Q_sqr, double s, double t); double int_dsigma_dt(double phi); double dsigma_dtdphi_av(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double phi, double epsilon, double Q_sqr, double w_min, double w_max, double t); double int_dsigma_dtdphi_av(double w); double dsigma_dtdphi(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double phi, double epsilon, double Q_sqr, double s, double t); double dsigma_dt_anal(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double epsilon, double Q_sqr, double s, double t); double gdh_integral(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double upper_en); double gdh_integral_p(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double upper_en); double gdh_integral_m(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double upper_en); double gdh_integral_l_Tp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double upper_en); double gdh_integral_xy_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double upper_en); double int_gdh_integral(double ga_en_lab); double int_gdh_integral_p(double ga_en_lab); double int_gdh_integral_m(double ga_en_lab); double int_gdh_integral_l_Tp(double ga_en_lab); double int_gdh_integral_xy_TLp(double ga_en_lab); double sigma_tot_pol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_in, double Q_sqr, double s, double tmin, double tmax); double int_sigma_tot_pol(double t); double tot_response_l_Tp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double tmin, double tmax); double tot_response_xy_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double tmin, double tmax); double int_response_l_Tp(double t); double int_response_xy_TLp(double t); double dsigma_dt_pol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_in, double Q_sqr, double s, double t); double matrix_square_unpol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double matrix_square_pol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_in, double Q_sqr, double s, double t); /**************************************************************************/ /**************************************************************************/ double response_R_T(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_L(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_TT(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_TL(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_l_Tp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_perp_T(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_perp_L(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_perp_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); double response_R_par_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t); dcomplex J_hadron(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t, double sp_out, int pol_ph, double sp_in); /**************************************************************************/ /**************************************************************************/ dcomplex pion_regge_trajectory(int deg_pi, double s, double t); dcomplex rho_regge_trajectory(int deg_rho, double s, double t); dcomplex omega_regge_trajectory(double s, double t, double q22); dcomplex A1_regge_trajectory(double s, double t); dcomplex B1_regge_trajectory(double s, double t); dcomplex nucleon_regge_trajectory(double s, double u); dcomplex delta_regge_trajectory(double s, double u); dcomplex d13_regge_trajectory(double s, double u); /* ********************************************************************* */ double pion_emformfactor(int ff_pi, double mt); double rhopigamma_formfactor(int ff_rho, double mt); double ome_ff(double mt); double rho_ff(double mt); double b_ff(double mt); double nucleon_isovf1_formfactor(double mt); double nucleon_isovf2_formfactor(double mt); double nucleon_isos_formfactor(double mt); double nucleon_axialformfactor(double mt); double unucleon_formfactor(double mom_sqr); double udelta_formfactor(double mom_sqr); /* ********************************************************************* */ dcomplex t_vgan_ppim_regge_forward(int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t); /* ********************************************************************* */ dcomplex t_vgap_npip_regge_forward(int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t); dcomplex t_vgap_npip_regge_backward(int mech, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t); /* ********************************************************************* */ dcomplex t_vgap_ppio_regge_forward(int mech, int deg_rho, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t); dcomplex t_vgap_ppio_regge_backward(int mech, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t); /* ********************************************************************* */ /* ********************************************************************* */ FILE *fp, *fp1, *fp2, *fp3, *fp4, *fp5; static int reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, pol_ph_s, photelec; static double el_hel_s, phi_s, epsilon_s, Q_sqr_s, s_s, t_s, pi_msc, rho_msc, ome_msc, b_msc, b_coup; static double Q_sqr_s2, s_s2,t_s2; static int reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2; static double upper_en_s2, sp_in_s; static dcomplex back_s; main() { int reaction; double Q_sqr, phi_min, phi_max, epsilon, w, s, t, u, mt, phi, diff, ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, pi_th, w_min, w_max; /* ********************************************************************* */ /* ********************************************************************* */ /* */ /* Choose the reaction you want to calculate : */ /* 1. (e, e' p pi_minus) */ /* 2. (e, e' pi_plus) */ /* 3. (e, e' p pi_zero) */ /* */ /* ********************************************************************* */ /* ********************************************************************* */ printf("\n\n Choose the reaction you want to calculate :"); printf("\n 1 = (e, e' p pi_minus)"); printf("\n 2 = (e, e' pi_plus)"); printf("\n 3 = (e, e' pi_zero)"); printf("\n 4 = Form factors"); printf("\n"); scanf("%d", &reaction); switch(reaction) { case 1: /* for (e, e' p pi_minus) reaction */ { /* 1. (e, e' p pi_minus) differential cross section : forward */ int pol = 1; switch(pol) { case 1: /* (e, e' p pi_minus) reaction differential cross section : forward */ { int mech, deg_pi, deg_rho, ff_pi, ff_rho, separated; double res_trans, res_long, res_tt, res_tl, res_tlp; char fileb[80]; printf("\n\n Give choice for FORWARD scattering mechanism"); printf("\n 1 = t-channel pion"); printf("\n 2 = rho"); printf("\n 3 = pion gaugeinvariant"); printf("\n 4 = pion gaugeinvariant + rho"); printf("\n"); scanf("%d", &mech); printf("\n\n Give choice for degeneracy of PION trajectory"); printf("\n 1 = non-degenerate trajectory"); printf("\n 2 = degenerate trajectory with rotating phase (default for pi+)"); printf("\n 3 = degenerate trajectory with NON-rotating phase (default for pi-)"); printf("\n 4 = single pole"); printf("\n"); scanf("%d", °_pi); printf("\n\n Give choice for degeneracy of RHO trajectory"); printf("\n 1 = non-degenerate trajectory"); printf("\n 2 = degenerate trajectory with rotating phase (default for pi+)"); printf("\n 3 = degenerate trajectory with NON-rotating phase (default for pi-)"); printf("\n 4 = single pole"); printf("\n"); scanf("%d", °_rho); printf("\n\n Give choice for electromagnetic form factor of PION"); printf("\n 1 = Monopole parametrization of Bebek et al., (cut-off)^2 = 0.462 GeV^2"); printf("\n 2 = Monopole at large Q_sqr, correct charge radius at low Q_sqr"); printf("\n 3 = Monopole parametrization with (cut-off)^2 as free parameter"); printf("\n"); scanf("%d", &ff_pi); if(ff_pi == 2) { printf("\n\n Give the mass scale (< 1.05) in GeV^2 in the pion ff (0.55 from low Q^2 data)"); printf("\n"); scanf("%lf", &pi_msc); } if(ff_pi == 3) { printf("\n\n Give the value for the monopole (cut-off)^2 in the pion ff"); printf("\n"); scanf("%lf", &pi_msc); } printf("\n\n Give choice for RHO-PI-GAMMA transition form factor"); printf("\n 1 = Same as choice 1 for pion electromagnetic form factor"); printf("\n 2 = Same as choice 2 for pion electromagnetic form factor"); printf("\n 3 = Monopole parametrization with (cut-off)^2 as free parameter"); printf("\n 4 = Monopole parametrization with (cut-off)^2 = 2 GeV^2"); printf("\n 5 = ff = 1."); printf("\n"); scanf("%d", &ff_rho); if(ff_rho == 3) { printf("\n\n Give the value for the monopole (cut-off)^2 in the rho-pi-ga ff"); printf("\n"); scanf("%lf", &rho_msc); } printf("\n\n Give choice for OBSERVABLE to calculate"); printf("\n 1 = separated cross section : RESPONSE functions"); printf("\n 2 = unseparated cross section with input files for kinematics of Cornell experiments : Bebek et al."); printf("\n 3 = unseparated cross section without input files"); printf("\n 4 = GDH integral"); printf("\n 5 = TARGET ASYMMETRY as function of t at fixed W"); printf("\n"); scanf("%d", &separated); switch(mech) { case 1 : { break; } case 2 : { char fileout[]="_rho.dat"; strcpy(fileb,fileout); break; } case 3 : { if (deg_pi == 3) { char fileout[]="_pi_regge.dat"; strcpy(fileb,fileout); } if (deg_pi == 4) { char fileout[]="_pi_born.dat"; strcpy(fileb,fileout); } break; } case 4 : { if ((deg_pi == 3) && (deg_rho == 3)) { if ((ff_pi == 1) && (ff_rho == 1)) { char fileout[]="_pirho.dat"; strcpy(fileb,fileout); } else { char fileout[]="_pirho.dat"; strcpy(fileb,fileout); } } if ((deg_pi == 4) && (deg_rho == 4)) { char fileout[]="_pirho_born.dat"; strcpy(fileb,fileout); } break; } } switch(separated) { case 1 : /* separated cross section */ { int kin; printf("\n\n Choose the kinematics of the experiment"); printf("\n 1 : Bebek et al. PRL 37 (1976) 1326 (Cornell)."); printf("\n : W = 2.15 GeV, Q^2 = 1.19 GeV^2"); printf("\n 2 : Mack (JLab)."); printf("\n : W = 1.95 GeV, Q^2 = 0.6 GeV^2"); printf("\n : W = 1.95 GeV, Q^2 = 0.75 GeV^2"); printf("\n : W = 1.95 GeV, Q^2 = 1. GeV^2"); printf("\n : W = 1.95 GeV, Q^2 = 1.6 GeV^2"); printf("\n 3 : User-defined kinematics"); printf("\n"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : /* Cornell experiments (Bebek et al.) : w=2.15, Q2=1.19 */ { char file1t[80]="ep_epipn_w2p15_qsqr1p19"; char file2t[80]; char trans[]="_trans_pirho.dat"; char longi[]="_long_pirho.dat"; char tt[]="_tt_pi_gaugeinv.dat"; char tl[]="_tl_pi_gaugeinv.dat"; char tlp[]="_tlp_pi_gaugeinv.dat"; char file1l[80],file1tt[80],file1tl[80],file1tlp[80]; strcpy(file1l,file1t); strcpy(file1tt,file1t); strcpy(file1tl,file1t); strcpy(file1tlp,file1t); printf("OUTPUT1 : theta_pi_cm(deg), -t(GeV^2), dsig_T/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT2 : theta_pi_cm(deg), -t(GeV^2), dsig_L/dOmega_cm (mubarn/sr) \n"); s = pow(2.15, 2.); Q_sqr = 1.19; if ( (fp1 = fopen("ep_epipn_w2p15_qsqr1p19_trans_pirho.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen("ep_epipn_w2p15_qsqr1p19_long_pirho.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = 0.001; pi_th <= 25.; pi_th += 0.25) { double conv; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 1. / (2. * PI) * 2. * pi_mom_cm * ga_mom_cm; res_trans = conv * response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = conv * response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); break; } case 2 : /* Mack */ { char file1t[80]="en_eppim_w1p95_qsqr0p6_trans"; char file1l[80]="en_eppim_w1p95_qsqr0p6_long"; char file1tt[80]="en_eppim_w1p95_qsqr0p6_tt"; char file1tl[80]="en_eppim_w1p95_qsqr0p6_tl"; char file2t[80]="en_eppim_w1p95_qsqr0p75_trans"; char file2l[80]="en_eppim_w1p95_qsqr0p75_long"; char file2tt[80]="en_eppim_w1p95_qsqr0p75_tt"; char file2tl[80]="en_eppim_w1p95_qsqr0p75_tl"; char file3t[80]="en_eppim_w1p95_qsqr1p0_trans"; char file3l[80]="en_eppim_w1p95_qsqr1p0_long"; char file3tt[80]="en_eppim_w1p95_qsqr1p0_tt"; char file3tl[80]="en_eppim_w1p95_qsqr1p0_tl"; char file4t[80]="en_eppim_w1p95_qsqr1p6_trans"; char file4l[80]="en_eppim_w1p95_qsqr1p6_long"; char file4tt[80]="en_eppim_w1p95_qsqr1p6_tt"; char file4tl[80]="en_eppim_w1p95_qsqr1p6_tl"; s = pow(1.95, 2.); Q_sqr = 0.6; printf("OUTPUT1 : -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n"); if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.03; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); s = pow(1.95, 2.); Q_sqr = 0.75; if ( (fp1 = fopen(strcat(file2t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file2l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file2tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file2tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.044; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); s = pow(1.95, 2.); Q_sqr = 1.; if ( (fp1 = fopen(strcat(file3t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file3l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file3tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file3tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.071; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); s = pow(1.95, 2.); Q_sqr = 1.6; if ( (fp1 = fopen(strcat(file4t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file4l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file4tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file4tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.15; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); break; } case 3 : /* User-defined */ { double a, a_min, a_max, a_step, W_min, W_max, W_step, t_min, t_max, t_step, Q2_min, Q2_max, Q2_step, bidon1, bidon2; double ga_en_in_lab, ga_mom_in_lab, W, tmin_test, mes_mom_lab_test, mes_en_lab, mes_mom_lab; int rep; char file1t[80],file1l[80],file1tt[80],file1tl[80]; printf("\n 1 : Q2 dependence"); printf("\n 2 : t dependence"); printf("\n 3 : W dependence"); printf("\n"); scanf("%d", &rep); if (rep==1) { printf("\n Which W"); printf("\n"); scanf("%lf", &W); printf("\n Which t (t>0) -if t=0, t=t_min-"); printf("\n"); scanf("%lf", &t); s = pow(W,2.); mt=-t; printf("\n Q2_min ?"); printf("\n"); scanf("%lf", &Q2_min); printf("\n Which Q2_max ?"); printf("\n"); scanf("%lf", &Q2_max); printf("\n Which Q2_step ?"); printf("\n"); scanf("%lf", &Q2_step); a_min=Q2_min; a_max=Q2_max; a_step=Q2_step; bidon1=(W-(int) W)*10.; bidon2=(t-(int) t)*10.; sprintf(file1t,"en_eppim_t%dp%d_w%dp%d_trans", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1l,"en_eppim_t%dp%d_w%dp%d_long", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tt,"en_eppim_t%dp%d_w%dp%d_tt", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tl,"en_eppim_t%dp%d_w%dp%d_tl", (int) t, (int) bidon2, (int) W, (int) bidon1); printf("OUTPUT1 : Q2 (GeV2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : Q2 (GeV2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : Q2 (GeV2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : Q2 (GeV2), dsig_TL/dt (mubarn/GeV2) \n"); } if (rep==2) { printf("\n Which W"); printf("\n"); scanf("%lf", &W); printf("\n Which Q2"); printf("\n"); scanf("%lf", &Q_sqr); s = pow(W,2.); printf("\n t_min ?"); printf("\n"); scanf("%lf", &t_min); printf("\n t_max ?"); printf("\n"); scanf("%lf", &t_max); printf("\n t_step ?"); printf("\n"); scanf("%lf", &t_step); a_min=t_min; a_max=t_max; a_step=t_step; if(t_min==0.) { a_min=-(pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.)); a_min=a_min+.001; } bidon1=(Q_sqr-(int) Q_sqr)*10.; bidon2=(W-(int) W)*10.; sprintf(file1t,"en_eppim_q2%dp%d_w%dp%d_trans", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1l,"en_eppim_q2%dp%d_w%dp%d_long", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tt,"en_eppim_q2%dp%d_w%dp%d_tt", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tl,"en_eppim_q2%dp%d_w%dp%d_tl", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); printf("OUTPUT1 : -t (GeV2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t (GeV2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t (GeV2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t (GeV2), dsig_TL/dt (mubarn/GeV2) \n"); } if (rep==3) { printf("\n Which Q2"); printf("\n"); scanf("%lf", &Q_sqr); printf("\n Which t (t>0) -if t=0, t=t_min-"); printf("\n"); scanf("%lf", &t); mt=-t; printf("\n W_min ?"); printf("\n"); scanf("%lf", &W_min); printf("\n W_max ?"); printf("\n"); scanf("%lf", &W_max); printf("\n W_step ?"); printf("\n"); scanf("%lf", &W_step); a_min=W_min; a_max=W_max; a_step=W_step; bidon1=(Q_sqr-(int) Q_sqr)*10.; bidon2=(t-(int) t)*10.; sprintf(file1t,"en_eppim_q2%dp%d_t%dp%d_trans", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1l,"en_eppim_q2%dp%d_t%dp%d_long", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tt,"en_eppim_q2%dp%d_t%dp%d_tt", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tl,"en_eppim_q2%dp%d_t%dp%d_tl", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); printf("OUTPUT1 : W (GeV), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : W (GeV), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : W (GeV), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : W (GeV), dsig_TL/dt (mubarn/GeV2) \n"); } if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(a = a_min; a <= a_max; a += a_step) { if (rep==1) Q_sqr=a; if (rep==2) mt=-a; if (rep==3) s=pow(a,2.); if((t==0)&&(rep!=2)) { mt=pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.); mt=mt-.001; } res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); if (Q_sqr==0.) { res_long=0.; res_tl=0.; } else { res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); } fprintf(fp1, "%f \t %e \n", a, res_trans); fprintf(fp2, "%f \t %e \n", a, res_long); fprintf(fp3, "%f \t %e \n", a, res_tt); fprintf(fp4, "%f \t %e \n", a, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); break; } } break; } case 2 : /* unseparated cross section with input files for kinematics of Cornell experiments : Bebek et al. */ { int i, npoints, kin; char filekin0[80], filekin180[80], filekin90[80], filekin270[80]; char filekin0i[80], filekin180i[80], filekin90i[80], filekin270i[80]; char file0[]="_diff0"; char file180[]="_diff180"; char file90[]="_diff90"; char file270[]="_diff270"; char file0i[]="_diff0.input"; char file180i[]="_diff180.input"; char file90i[]="_diff90.input"; char file270i[]="_diff270.input"; printf("\n\n Choose the kinematics of the Cornell experiments (Bebek et al.)"); printf("\n 1 : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.95"); printf("\n 2 : W = 3.1 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.825"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : { char fileout[80]="en_epimp_ratio_w2p15_qsqr1p2_eps0p95"; char filein[80]="inputfiles/pimpip_ratio_w2p15_qsqr1p2_eps0p95"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 2 : { char fileout[80]="en_epimp_ratio_w3p1_qsqr1p2_eps0p825"; char filein[80]="inputfiles/pimpip_ratio_w3p1_qsqr1p2_eps0p825"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } } strcpy(filekin180,filekin0); strcpy(filekin90,filekin0); strcpy(filekin270,filekin0); strcpy(filekin180i,filekin0i); strcpy(filekin90i,filekin0i); strcpy(filekin270i,filekin0i); if ( (fp1 = fopen(strcat(filekin0i,file0i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin0,file0),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); phi = 0. * PI / 180.; printf("OUTPUT : theta_pi_cm(deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) \n"); for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); if ( (fp1 = fopen(strcat(filekin180i,file180i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin180,file180),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); if ( (fp1 = fopen(strcat(filekin90i,file90i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin90,file90),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); phi = 90. * PI / 180.; for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); /* if ( (fp1 = fopen(strcat(filekin270i,file270i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin270,file270),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); */ break; } case 3 : /* unseparated cross section without input files */ { int kin; double diff_test; char filea[80]; printf("\n\n Choose the kinematics of the experiment"); printf("\n 1 : Brauel et al. PLB 65 (1976) 184 (DESY)."); printf("\n : pi- electroproduction off deuteron"); printf("\n : W = 2.19 GeV, Q^2 = 0.70 GeV^2, epsilon = 0.86"); printf("\n : W = 2.19 GeV, Q^2 = 1.35 GeV^2, epsilon = 0.84"); printf("\n 2 : Cornell experiments (Bebek et al.) with average values"); printf("\n : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.95"); printf("\n : W = 3.1 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.83"); printf("\n : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.45"); printf("\n 3 : Cornell experiments (Bebek et al.) with average values"); printf("\n : W = 2.65 GeV, Q^2 = 2.0 GeV^2, epsilon = 0.35"); printf("\n 4 : pi- photoproduction"); printf("\n : E_gamma = 3.4, 8, 16 GeV"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : /* Brauel et al. (DESY) */ { char fileout1[80]="en_eppim_w2p19_qsqr0p70_eps0p86_ratio"; char fileout2[80]="en_eppim_w2p19_qsqr1p35_eps0p84_ratio"; strcpy(filea,fileout1); s = pow(2.19, 2.); Q_sqr = 0.70; epsilon = 0.86; phi_min = 120. * PI / 180.; /* 120 */ phi_max = 240. * PI / 180.; /* 240 */ if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT : -t(GeV^2), 2PI*dsig/dt (mubarn/GeV2) \n"); for(mt = 0.05; mt <= 1.5; mt += 0.05) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); s = pow(2.19, 2.); Q_sqr = 1.35; epsilon = 0.84; phi_min = 120. * PI / 180.; phi_max = 240. * PI / 180.; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.5; mt += 0.05) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } case 2 : /* Cornell experiments (Bebek et al.) with average values */ { char fileout1[80]="en_epimp_ratio_av_w2p15_qsqr1p2_eps0p95_diff0"; char fileout2[80]="en_epimp_ratio_av_w2p15_qsqr1p2_eps0p95_diff90"; char fileout3[80]="en_epimp_ratio_av_w3p1_qsqr1p2_eps0p83_diff0"; char fileout4[80]="en_epimp_ratio_av_w3p1_qsqr1p2_eps0p83_diff90"; char fileout5[80]="en_epimp_ratio_av_w2p15_qsqr1p2_eps0p95_intphi0"; char fileout6[80]="en_epimp_ratio_av_w2p15_qsqr1p2_eps0p45_diff0"; char fileout7[80]="en_epimp_ratio_av_w2p15_qsqr1p2_eps0p45_diff90"; s = pow(2.15, 2.); Q_sqr = 1.2; epsilon = 0.95; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT : theta_pi_cm (deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) \n"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); /* strcpy(filea,fileout5); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { if (pi_th >= 0.) { phi = 0. * PI / 180.; phi_min = -45. * PI / 180.; phi_max = 45. * PI / 180.; } else { phi = 180. * PI / 180.; phi_min = 135. * PI / 180.; phi_max = 225. * PI / 180.; } ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); */ s = pow(3.1, 2.); Q_sqr = 1.2; epsilon = 0.83; strcpy(filea,fileout3); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout4); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); s = pow(2.15, 2.); Q_sqr = 1.2; epsilon = 0.45; strcpy(filea,fileout6); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout7); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); break; } case 3 : /* Cornell experiments (Bebek et al.) with average values */ { char fileout1[80]="en_epimp_ratio_av_w2p65_qsqr2p0_eps0p35_diff0"; char fileout2[80]="en_epimp_ratio_av_w2p65_qsqr2p0_eps0p35_diff90"; s = pow(2.65, 2.); Q_sqr = 2.0; epsilon = 0.35; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT : theta_pi_cm (deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) \n"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); break; } case 4 : /* pi- photoproduction */ { double ga_en_lab; char fileout1[80]="gan_ppim_diff_3p4gev"; char fileout2[80]="gan_ppim_diff_8gev"; char fileout3[80]="gan_ppim_diff_16gev"; strcpy(filea,fileout1); ga_en_lab = 3.4; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT : -t(GeV^2), dsig/dt (mubarn/GeV2) \n"); for(mt = 0.001; mt <= 1.5; mt += 0.02) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); ga_en_lab = 8.; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 1.5; mt += 0.02) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout3); ga_en_lab = 16.; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 1.5; mt += 0.02) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } } break; } /**/ case 4: /* gdh integral */ { int ieq2, vec_mes, i1, i2; double x2; double upper_en, upper_w, gdh, gdh_p, gdh_m, gdh_l_Tp, gdh_xy_TLp, gdh_norm, sigma_p, sigma_m, ga_en_lab; char filea[80],filehelp[80],filectot1[80],filebtot1[80]; printf("\n As a function of energy or Q2 ?"); printf("\n 1 : Energy"); printf("\n 2 : Q2"); printf("\n"); scanf("%d", &ieq2); switch(ieq2) { case 1 : { printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); i1=(int) Q_sqr; x2=fmod((double) Q_sqr*10,10); i2=(int) x2; sprintf(filebtot1,"gdh_integral_q2%dp%d_pim.dat",i1,i2); if ( (fp4 = fopen(filebtot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : E_gamma_max (GeV), W_max (GeV), gdh_l_Tp, gdh_+, gdh_-, gdh_xy_TLp, gdh_norm \n"); printf("OUTPUT2 : W (GeV), E_gamma (GeV), sigma_+ (mubarn), sigma_- (mubarn) \n"); for (upper_en = 1.7; upper_en <= 10.; upper_en +=.3) { gdh_p = gdh_integral_p(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_m = gdh_integral_m(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_l_Tp = gdh_integral_l_Tp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); if (Q_sqr!=0.) { gdh_xy_TLp = gdh_integral_xy_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); } else { gdh_xy_TLp=0.; } gdh=gdh_m-gdh_p-gdh_xy_TLp; /* gdh_norm=gdh*pow(NU_M,2.)/(8.*pow(PI,2.)*pow(ELEC,2.)/(4. * PI));*/ gdh_norm=gdh; upper_w=sqrt(pow(NU_M,2.)+2.*NU_M*upper_en-Q_sqr); fprintf(fp4, "%f \t %f \t %e \t %e \t %e \t %e \t %e \n", upper_en, upper_w, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); } fclose(fp4); sprintf(filectot1,"sigs_q2%dp%d_pim.dat",i1,i2); if ( (fp1 = fopen(filectot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; for (w = 2.; w <= 5.; w +=.1) { ga_en_lab=(-pow(NU_M,2.)+pow(w,2.)+Q_sqr)/2./NU_M; sigma_p=int_gdh_integral_p(ga_en_lab)*ga_en_lab; sigma_m=int_gdh_integral_m(ga_en_lab)*ga_en_lab; fprintf(fp1, "%f \t %f \t %e \t %e \n", w, ga_en_lab, sigma_p, sigma_m); } fclose(fp1); break; } case 2 : { if ( (fp4 = fopen("gdhvsq2_pim.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); upper_en=5.; printf("OUTPUT1 : Q2 (GeV2), gdh_l_Tp, gdh_+, gdh_-, gdh_xy_TLp, gdh_norm \n"); printf("OUTPUT2 : Q2 (GeV2), sigma_+ (mubarn), sigma_- (mubarn) \n"); for (Q_sqr = 0.; Q_sqr <= 2.; Q_sqr +=.1) { gdh_p = gdh_integral_p(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_m = gdh_integral_m(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_l_Tp = gdh_integral_l_Tp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); if (Q_sqr!=0.) { gdh_xy_TLp = gdh_integral_xy_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); } else { gdh_xy_TLp=0.; } gdh=gdh_p-gdh_m-gdh_xy_TLp; /* gdh_norm=-gdh*pow(NU_M,2.)/(8.*pow(PI,2.)*pow(ELEC,2.)/(4. * PI));*/ gdh_norm=-gdh; fprintf(fp4, "%f \t %e \t %e \t %e \t %e \t %e \n", Q_sqr, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); printf("\n%f \t %e \t %e \t %e \t %e \t %e", Q_sqr, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); } fclose(fp4); break; } } break; } /**/ case 5 : /* target spin asymmetry at fixed t as function of x_B */ { int i1,i2; char filebtot1[80]; double tortho, lortho, res_trans, res_long, epsilon, asymm_lam, W, tmin; printf("\n\n Give the value of W"); printf("\n"); scanf("%lf", &W); printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); if (Q_sqr!=0.) { printf("\n Which epsilon ?"); printf("\n"); scanf("%lf", &epsilon); } i1=(int) Q_sqr; i2=(int) W; sprintf(filebtot1,"target_asym_q2%_w%_pim.dat",i1,i2); s=pow(W,2.); tmin=pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.); printf("OUTPUT : -t (GeV2), dsig_T_perp/dt (mubarn/GeV2), dsig_T/dt (mubarn/GeV2), dsig_L_perp/dt (mubarn/GeV2), dsig_L/dt (mubarn/GeV2), Target_asym \n"); for(mt = -tmin; mt <= 1.; mt += .05) { if ( (fp1 = fopen(filebtot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); t = -mt; tortho = response_R_perp_T(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_trans = response_R_T(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); lortho = response_R_perp_L(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = response_R_L(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); if (Q_sqr==0.) { asymm_lam = tortho/res_trans; } else { asymm_lam = (tortho+epsilon*lortho) / (res_trans+epsilon*res_long); } printf("%f \t %e \t %e \t %e \t %e \t %e \n", mt, tortho, res_trans, lortho, res_long, asymm_lam); /* fprintf(fp1,"%f \t %e \t %e\n", mt, result1, result2);*/ fclose(fp1); } break; } } break; } case 2: /* */ { break; } } break; } /* ********************************************************************* */ /* ********************************************************************* */ case 2: /* for (e, e' n pi_plus) reaction */ { /* 1. unpolarized forward differential cross section */ /* 2. unpolarized backward differential cross section */ int pol = 1; switch(pol) { case 1: /* unpolarized (e, e' n pi_plus) differential cross section : forward */ { int mech, deg_pi, deg_rho, ff_pi, ff_rho, separated; double res_trans, res_long, res_tt, res_tl, res_tlp; char fileb[80]; printf("\n\n Give choice for FORWARD scattering mechanism"); printf("\n 1 = t-channel pion"); printf("\n 2 = rho"); printf("\n 3 = pion gaugeinvariant"); printf("\n 4 = pion gaugeinvariant + rho"); /* printf("\n 5 = pion gaugeinvariant (+ magnetic s-channel N) + rho"); */ printf("\n"); scanf("%d", &mech); printf("\n\n Give choice for degeneracy of PION trajectory"); printf("\n 1 = non-degenerate trajectory"); printf("\n 2 = degenerate trajectory with rotating phase (default for pi+)"); printf("\n 3 = degenerate trajectory with NON-rotating phase (default for pi-)"); printf("\n 4 = single pole"); printf("\n"); scanf("%d", °_pi); printf("\n\n Give choice for degeneracy of RHO trajectory"); printf("\n 1 = non-degenerate trajectory"); printf("\n 2 = degenerate trajectory with rotating phase (default for pi+)"); printf("\n 3 = degenerate trajectory with NON-rotating phase (default for pi-)"); printf("\n 4 = single pole"); printf("\n"); scanf("%d", °_rho); printf("\n\n Give choice for electromagnetic form factor of PION"); printf("\n 1 = Monopole parametrization of Bebek et al., (cut-off)^2 = 0.462 GeV^2"); printf("\n 2 = Monopole at large Q_sqr, correct charge radius at low Q_sqr"); printf("\n 3 = Monopole parametrization with (cut-off)^2 as free parameter"); printf("\n"); scanf("%d", &ff_pi); if(ff_pi == 2) { printf("\n\n Give the mass scale (< 1.05) in GeV^2 in the pion ff (0.55 from low Q^2 data)"); printf("\n"); scanf("%lf", &pi_msc); } if(ff_pi == 3) { printf("\n\n Give the value for the monopole (cut-off)^2 in the pion ff (e.g. 0.65)"); printf("\n"); scanf("%lf", &pi_msc); } printf("\n\n Give choice for RHO-PI-GAMMA transition form factor"); printf("\n 1 = Same as choice 1 for pion electromagnetic form factor"); printf("\n 2 = Same as choice 2 for pion electromagnetic form factor"); printf("\n 3 = Monopole parametrization with (cut-off)^2 as free parameter"); printf("\n 4 = Monopole parametrization with (cut-off)^2 = 2 GeV^2"); printf("\n 5 = ff = 1."); printf("\n"); scanf("%d", &ff_rho); if(ff_rho == 3) { printf("\n\n Give the value for the (cut-off)^2 in the rho-pi-ga ff (e.g. 0.6)"); printf("\n"); scanf("%lf", &rho_msc); } printf("\n\n Give the BACKGROUND constant value for the L part"); printf("\n (The constant is COMPLEX and sign matters)"); printf("\n (The constant is added only to the -G.I. or not- pion pole)"); printf("\n (Also, at this point, it only applies to the pi+ channel)"); printf("\n Enter real part :"); printf("\n"); scanf("%lf", &back_s.re); printf("\n Enter imaginary part :"); printf("\n"); scanf("%lf", &back_s.im); printf("\n\n Give choice for OBSERVABLE to calculate"); printf("\n 1 = separated cross section : RESPONSE functions"); printf("\n 2 = unseparated cross section with input files for kinematics of Cornell experiments : Bebek et al."); printf("\n 3 = unseparated cross section without input files"); printf("\n 4 = unseparated cross section for simulations"); printf("\n 5 = gdh integral"); printf("\n 6 = TARGET ASYMMETRY as function of t at fixed W"); printf("\n"); scanf("%d", &separated); switch(mech) { case 1 : { break; } case 2 : { char fileout[]="_rho.dat"; strcpy(fileb,fileout); break; } case 3 : { if (deg_pi == 2) { char fileout[]="_pi_regge.dat"; strcpy(fileb,fileout); } if (deg_pi == 4) { char fileout[]="_pi_born.dat"; strcpy(fileb,fileout); } break; } case 4 : { if ((deg_pi == 2) && (deg_rho == 2)) { if ((ff_pi == 1) && (ff_rho == 1)) { char fileout[]="_pirho.dat"; strcpy(fileb,fileout); } else { char fileout[]="_pirho.dat"; strcpy(fileb,fileout); } } if ((deg_pi == 4) && (deg_rho == 4)) { char fileout[]="_pirho_born.dat"; strcpy(fileb,fileout); } if (deg_pi != deg_rho) { char fileout[]="_pirho_test.dat"; strcpy(fileb,fileout); } break; } case 5 : { char fileout[]="_pirho_test.dat"; strcpy(fileb,fileout); break; } case 6 : { char fileout[]="_pirho_test.dat"; strcpy(fileb,fileout); break; } } switch(separated) { case 1 : /* separated cross section */ { int kin; printf("\n\n Choose the kinematics of the experiment"); printf("\n 1 : L/T separation"); printf("\n : W = 2.0 GeV, Q^2 = 1, 3, 6 GeV^2"); printf("\n"); printf("\n 2 : Ackermann et al. NPB 137 (1978) 294 (DESY)."); printf("\n : W = 2.1 GeV, Q^2 = 0.35 GeV^2"); printf("\n"); printf("\n 3 : Bebek et al. PRL 37 (1976) 1326 (Cornell)."); printf("\n : W = 2.15 GeV, Q^2 = 1.19 GeV^2"); printf("\n : W = 2.65 GeV, Q^2 = 2.0 GeV^2"); printf("\n : W = 2.65 GeV, Q^2 = 3.3 GeV^2"); printf("\n"); printf("\n 4 : Brauel et al. PLB 65 (1976) 184 (DESY)."); printf("\n : W = 2.19 GeV, Q^2 = 0.70 GeV^2"); printf("\n"); printf("\n 5 : Driver et al. NPB 30 (1971) 245 (DESY)."); printf("\n : W = 2.2 GeV, Q^2 = 0.26 GeV^2"); printf("\n : W = 2.2 GeV, Q^2 = 0.55 GeV^2"); printf("\n : W = 2.2 GeV, Q^2 = 0.75 GeV^2"); printf("\n"); printf("\n 6 : Mack (JLab)."); printf("\n : W = 1.95 GeV, Q^2 = 0.6 GeV^2"); printf("\n : W = 1.95 GeV, Q^2 = 0.75 GeV^2"); printf("\n : W = 1.95 GeV, Q^2 = 1. GeV^2"); printf("\n : W = 1.95 GeV, Q^2 = 1.6 GeV^2"); printf("\n"); printf("\n 7 : Bogdan (JLab) -dsig/dt(t=tmin).vs.Q2-"); printf("\n : W = 2. GeV, E_e= 4. GeV, t = t_min"); printf("\n"); printf("\n 8 : User-defined kinematics"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : /* Bebek et al. */ { char file1t[80]="ep_enpip_w2p0_qsqr1p0_trans"; char file1l[80]="ep_enpip_w2p0_qsqr1p0_long"; char file2t[80]="ep_enpip_w2p0_qsqr3p0_trans"; char file2l[80]="ep_enpip_w2p0_qsqr3p0_long"; char file3t[80]="ep_enpip_w2p0_qsqr6p0_trans"; char file3l[80]="ep_enpip_w2p0_qsqr6p0_long"; s = pow(2.0, 2.); Q_sqr = 1.0; if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : theta_pi_cm(deg), -t(GeV^2), dsig_T/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT2 : theta_pi_cm(deg), -t(GeV^2), dsig_L/dOmega_cm (mubarn/sr) \n"); for(pi_th = 0.001; pi_th <= 90.; pi_th += 0.25) { ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); s = pow(2.0, 2.); Q_sqr = 3.0; if ( (fp1 = fopen(strcat(file2t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file2l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = 0.001; pi_th <= 60.; pi_th += 0.25) { ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); s = pow(2.0, 2.); Q_sqr = 6.0; if ( (fp1 = fopen(strcat(file3t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file3l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = 0.001; pi_th <= 45.; pi_th += 0.25) { ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); break; } case 2 : /* Ackermann et al. */ { char file1t[80]="ep_enpip_w2p1_qsqr0p35_trans"; char file1l[80]="ep_enpip_w2p1_qsqr0p35_long"; char file1tt[80]="ep_enpip_w2p1_qsqr0p35_tt"; char file1tl[80]="ep_enpip_w2p1_qsqr0p35_tl"; char file1tlp[80]="ep_enpip_w2p1_qsqr0p35_tlp"; s = pow(2.1, 2.); Q_sqr = 0.35; printf("OUTPUT1 : -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n"); printf("OUTPUT5 : -t(GeV^2), dsig_TLp/dt (mubarn/GeV2) \n"); if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.0001; mt <= 0.1001; mt += 0.001) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); } for(mt = 0.1001; mt <= 1.; mt += 0.01) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); } fclose(fp1); fclose(fp2); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file1tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.0001; mt <= 0.1001; mt += 0.001) { res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); fprintf(fp5, "%f \t %e \n", mt, res_tlp); } for(mt = 0.1001; mt <= 1.; mt += 0.01) { res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); fprintf(fp5, "%f \t %e \n", mt, res_tlp); } fclose(fp3); fclose(fp4); fclose(fp5); break; } case 3 : /* Bebek et al. */ { char file1t[80]="ep_enpip_w2p15_qsqr1p19_trans"; char file1l[80]="ep_enpip_w2p15_qsqr1p19_long"; char file2t[80]="ep_enpip_w2p65_qsqr2p0_trans"; char file2l[80]="ep_enpip_w2p65_qsqr2p0_long"; char file3t[80]="ep_enpip_w2p65_qsqr3p3_trans"; char file3l[80]="ep_enpip_w2p65_qsqr3p3_long"; s = pow(2.15, 2.); Q_sqr = 1.19; if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : theta_pi_cm (deg), -t(GeV^2), dsig_T/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT2 : theta_pi_cm (deg), -t(GeV^2), dsig_L/dOmega_cm (mubarn/sr) \n"); for(pi_th = 0.001; pi_th <= 25.; pi_th += 0.25) { double conv; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 1. / (2. * PI) * 2. * pi_mom_cm * ga_mom_cm; res_trans = conv * response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = conv * response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); s = pow(2.65, 2.); Q_sqr = 2.0; if ( (fp1 = fopen(strcat(file2t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file2l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = 0.001; pi_th <= 25.; pi_th += 0.25) { double conv; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 1. / (2. * PI) * 2. * pi_mom_cm * ga_mom_cm; res_trans = conv * response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = conv * response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); s = pow(2.65, 2.); Q_sqr = 3.3; if ( (fp1 = fopen(strcat(file3t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file3l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = 0.001; pi_th <= 25.; pi_th += 0.25) { double conv; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 1. / (2. * PI) * 2. * pi_mom_cm * ga_mom_cm; res_trans = conv * response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = conv * response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, - t, res_trans); fprintf(fp2, "%f \t %f \t %e \n", pi_th, - t, res_long); } fclose(fp1); fclose(fp2); break; } case 4 : /* Brauel et al. */ { char file1t[80]="ep_enpip_w2p19_qsqr0p70_trans"; char file1l[80]="ep_enpip_w2p19_qsqr0p70_long"; char file1tt[80]="ep_enpip_w2p19_qsqr0p70_tt"; char file1tl[80]="ep_enpip_w2p19_qsqr0p70_tl"; char file1tlp[80]="ep_enpip_w2p19_qsqr0p70_tlp"; s = pow(2.19, 2.); Q_sqr = 0.70; printf("OUTPUT1 : -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n"); printf("OUTPUT5 : -t(GeV^2), dsig_TLp/dt (mubarn/GeV2) \n"); if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.01; mt <= 0.5; mt += 0.01) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); } fclose(fp1); fclose(fp2); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file1tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.01; mt <= 0.5; mt += 0.01) { res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); fprintf(fp5, "%f \t %e \n", mt, res_tlp); } fclose(fp3); fclose(fp4); fclose(fp5); break; } case 5 : /* Driver et al. */ { char file1t[80]="ep_enpip_w2p2_qsqr0p26_trans"; char file1l[80]="ep_enpip_w2p2_qsqr0p26_long"; char file1tt[80]="ep_enpip_w2p2_qsqr0p26_tt"; char file1tl[80]="ep_enpip_w2p2_qsqr0p26_tl"; char file1tlp[80]="ep_enpip_w2p2_qsqr0p26_tlp"; char file2t[80]="ep_enpip_w2p2_qsqr0p55_trans"; char file2l[80]="ep_enpip_w2p2_qsqr0p55_long"; char file2tt[80]="ep_enpip_w2p2_qsqr0p55_tt"; char file2tl[80]="ep_enpip_w2p2_qsqr0p55_tl"; char file2tlp[80]="ep_enpip_w2p2_qsqr0p55_tlp"; char file3t[80]="ep_enpip_w2p2_qsqr0p75_trans"; char file3l[80]="ep_enpip_w2p2_qsqr0p75_long"; char file3tt[80]="ep_enpip_w2p2_qsqr0p75_tt"; char file3tl[80]="ep_enpip_w2p2_qsqr0p75_tl"; char file3tlp[80]="ep_enpip_w2p2_qsqr0p75_tlp"; s = pow(2.2, 2.); Q_sqr = 0.26; if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n"); printf("OUTPUT5 : -t(GeV^2), dsig_TLp/dt (mubarn/GeV2) \n"); for(mt = 0.004; mt <= 0.15; mt += 0.001) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); } fclose(fp1); fclose(fp2); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file1tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.004; mt <= 0.15; mt += 0.001) { res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); fprintf(fp5, "%f \t %e \n", mt, res_tlp); } fclose(fp3); fclose(fp4); fclose(fp5); s = pow(2.2, 2.); Q_sqr = 0.55; if ( (fp1 = fopen(strcat(file2t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file2l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.015; mt <= 0.15; mt += 0.001) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); } fclose(fp1); fclose(fp2); if ( (fp3 = fopen(strcat(file2tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file2tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file2tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.015; mt <= 0.15; mt += 0.001) { res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); fprintf(fp5, "%f \t %e \n", mt, res_tlp); } fclose(fp3); fclose(fp4); fclose(fp5); s = pow(2.2, 2.); Q_sqr = 0.75; if ( (fp1 = fopen(strcat(file3t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file3l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 0.15; mt += 0.001) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); } fclose(fp1); fclose(fp2); if ( (fp3 = fopen(strcat(file3tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file3tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file3tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 0.15; mt += 0.001) { res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); fprintf(fp5, "%f \t %e \n", mt, res_tlp); } fclose(fp3); fclose(fp4); fclose(fp5); break; } case 6 : /* Mack */ { char file1t[80]="ep_enpip_w1p95_qsqr0p6_trans"; char file1l[80]="ep_enpip_w1p95_qsqr0p6_long"; char file1tt[80]="ep_enpip_w1p95_qsqr0p6_tt"; char file1tl[80]="ep_enpip_w1p95_qsqr0p6_tl"; char file2t[80]="ep_enpip_w1p95_qsqr0p75_trans"; char file2l[80]="ep_enpip_w1p95_qsqr0p75_long"; char file2tt[80]="ep_enpip_w1p95_qsqr0p75_tt"; char file2tl[80]="ep_enpip_w1p95_qsqr0p75_tl"; char file3t[80]="ep_enpip_w1p95_qsqr1p0_trans"; char file3l[80]="ep_enpip_w1p95_qsqr1p0_long"; char file3tt[80]="ep_enpip_w1p95_qsqr1p0_tt"; char file3tl[80]="ep_enpip_w1p95_qsqr1p0_tl"; char file4t[80]="ep_enpip_w1p95_qsqr1p6_trans"; char file4l[80]="ep_enpip_w1p95_qsqr1p6_long"; char file4tt[80]="ep_enpip_w1p95_qsqr1p6_tt"; char file4tl[80]="ep_enpip_w1p95_qsqr1p6_tl"; s = pow(1.95, 2.); Q_sqr = 0.6; if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n"); for(mt = 0.03; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); s = pow(1.95, 2.); Q_sqr = 0.75; if ( (fp1 = fopen(strcat(file2t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file2l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file2tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file2tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.044; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); s = pow(1.95, 2.); Q_sqr = 1.; if ( (fp1 = fopen(strcat(file3t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file3l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file3tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file3tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.071; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); s = pow(1.95, 2.); Q_sqr = 1.6; if ( (fp1 = fopen(strcat(file4t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file4l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file4tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file4tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.15; mt <= 1.; mt += 0.005) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (res_trans > 0.) fprintf(fp1, "%f \t %e \n", mt, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %e \n", mt, res_long); fprintf(fp3, "%f \t %e \n", mt, res_tt); fprintf(fp4, "%f \t %e \n", mt, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); break; } case 7 : /* Bogdan */ { double amin, bmin, cmin, ga_en_in_lab, ga_mom_in_lab, W, tmin_test, mes_mom_lab_test, mes_en_lab, mes_mom_lab; char file1t[80]="ep_enpip_w2_tmin_trans"; char file1l[80]="ep_enpip_w2_tmin_long"; char file1tt[80]="ep_enpip_w2_tmin_tt"; char file1tl[80]="ep_enpip_w2_tmin_tl"; char file1tlp[80]="ep_enpip_w2_tmin_tlp"; W = 2.; s = pow(W,2.); if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file1tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : Q2 (geV2), -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : Q2 (geV2), -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : Q2 (geV2), -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : Q2 (geV2), -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n"); printf("OUTPUT5 : Q2 (geV2), -t(GeV^2), dsig_TLp/dt (mubarn/GeV2) \n"); for(Q_sqr = .5; Q_sqr <= 6.; Q_sqr += .1) { ga_en_in_lab=(pow(W,2.)+Q_sqr-pow(NU_M,2.))/(2.*NU_M); ga_mom_in_lab = sqrt(Q_sqr + pow(ga_en_in_lab,2.)); amin = pow(NU_M +ga_en_in_lab,2.) - pow(ga_mom_in_lab,2.); bmin = 0.5 * (s - pow(NU_M,2.) + pow(PI_M, 2.)) * ga_mom_in_lab; cmin = pow(0.5 * (s - pow(NU_M,2.) + pow(PI_M, 2.)), 2.) - pow(PI_M * (NU_M + ga_en_in_lab), 2.); mes_mom_lab_test = .5 * (s - pow(NU_M,2.)) / (ga_en_in_lab + NU_M - ga_mom_in_lab); tmin_test = - 2.*NU_M * (ga_en_in_lab - mes_mom_lab_test); if ((bmin*bmin + amin*cmin) > 0) { mes_mom_lab = 1./amin * ( bmin + sqrt(pow(bmin,2.) + amin * cmin)); mes_en_lab = sqrt(pow(mes_mom_lab,2.) + pow(PI_M,2.)); t = - 2. * NU_M * (ga_en_in_lab - mes_en_lab); } /* t=t-.15;*/ res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); if (res_trans > 0.) fprintf(fp1, "%f \t %f \t %e \n", Q_sqr, -t, res_trans); if (res_long > 0.) fprintf(fp2, "%f \t %f \t %e \n", Q_sqr, -t, res_long); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp3, "%f \t %f \t %e \n", Q_sqr, -t, res_tt); fprintf(fp4, "%f \t %f \t %e \n", Q_sqr, -t, res_tl); fprintf(fp5, "%f \t %f \t %e \n", Q_sqr, -t, res_tlp); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); fclose(fp5); break; } case 8 : /* User-defined */ { double a, a_min, a_max, a_step, W_min, W_max, W_step, t_min, t_max, t_step, Q2_min, Q2_max, Q2_step, bidon1, bidon2; double ga_en_in_lab, ga_mom_in_lab, W, tmin_test, mes_mom_lab_test, mes_en_lab, mes_mom_lab; int rep; char file1t[80],file1l[80],file1tt[80],file1tl[80],file1tlp[80]; printf("\n 1 : Q2 dependence"); printf("\n 2 : t dependence"); printf("\n 3 : W dependence"); printf("\n"); scanf("%d", &rep); if (rep==1) { printf("\n Which W"); printf("\n"); scanf("%lf", &W); printf("\n Which t (t>0) -if t=0, t=t_min-"); printf("\n"); scanf("%lf", &t); s = pow(W,2.); mt=-t; printf("\n Q2_min ?"); printf("\n"); scanf("%lf", &Q2_min); printf("\n Which Q2_max ?"); printf("\n"); scanf("%lf", &Q2_max); printf("\n Which Q2_step ?"); printf("\n"); scanf("%lf", &Q2_step); a_min=Q2_min; a_max=Q2_max; a_step=Q2_step; bidon1=(W-(int) W)*10.; bidon2=(t-(int) t)*10.; sprintf(file1t,"ep_enpip_t%dp%d_w%dp%d_trans", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1l,"ep_enpip_t%dp%d_w%dp%d_long", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tt,"ep_enpip_t%dp%d_w%dp%d_tt", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tl,"ep_enpip_t%dp%d_w%dp%d_tl", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tlp,"ep_enpip_t%dp%d_w%dp%d_tlp", (int) t, (int) bidon2, (int) W, (int) bidon1); printf("OUTPUT1 : Q2 (GeV2), dsig_T/dt (mubarn/GeV2), dsig_T/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT2 : Q2 (GeV2), dsig_L/dt (mubarn/GeV2), dsig_L/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT3 : Q2 (GeV2), dsig_TT/dt (mubarn/GeV2), dsig_TT/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT4 : Q2 (GeV2), dsig_TL/dt (mubarn/GeV2), dsig_TL/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT5 : Q2 (GeV2), dsig_TLp/dt (mubarn/GeV2), dsig_TLp/dOmega_cm (mubarn/sr) \n"); } if (rep==2) { printf("\n Which W"); printf("\n"); scanf("%lf", &W); printf("\n Which Q2"); printf("\n"); scanf("%lf", &Q_sqr); s = pow(W,2.); printf("\n t_min ?"); printf("\n"); scanf("%lf", &t_min); printf("\n t_max ?"); printf("\n"); scanf("%lf", &t_max); printf("\n t_step ?"); printf("\n"); scanf("%lf", &t_step); a_min=t_min; a_max=t_max; a_step=t_step; if(t_min==0.) { a_min=-(pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.)); } /*a_min=-(pow((-Q_sqr-pow(PI_M,2.)-pow(.939,2.)+pow(.939,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(.939,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(.939,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.)); }*/ bidon1=(Q_sqr-(int) Q_sqr)*10.; bidon2=(W-(int) W)*10.; sprintf(file1t,"ep_enpip_q2%dp%d_w%dp%d_trans", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1l,"ep_enpip_q2%dp%d_w%dp%d_long", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tt,"ep_enpip_q2%dp%d_w%dp%d_tt", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tl,"ep_enpip_q2%dp%d_w%dp%d_tl", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tlp,"ep_enpip_q2%dp%d_w%dp%d_tlp", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); printf("OUTPUT1 : -t (GeV2), dsig_T/dt (mubarn/GeV2), dsig_T/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT2 : -t (GeV2), dsig_L/dt (mubarn/GeV2), dsig_L/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT3 : -t (GeV2), dsig_TT/dt (mubarn/GeV2), dsig_TT/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT4 : -t (GeV2), dsig_TL/dt, (mubarn/GeV2),dsig_TL/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT5 : -t (GeV2), dsig_TLp/dt, (mubarn/GeV2),dsig_TLp/dOmega_cm (mubarn/sr) \n"); } if (rep==3) { printf("\n Which Q2"); printf("\n"); scanf("%lf", &Q_sqr); printf("\n Which t (t>0) -if t=0, t=t_min-"); printf("\n"); scanf("%lf", &t); mt=-t; printf("\n W_min ?"); printf("\n"); scanf("%lf", &W_min); printf("\n W_max ?"); printf("\n"); scanf("%lf", &W_max); printf("\n W_step ?"); printf("\n"); scanf("%lf", &W_step); a_min=W_min; a_max=W_max; a_step=W_step; bidon1=(Q_sqr-(int) Q_sqr)*10.; bidon2=(t-(int) t)*10.; sprintf(file1t,"ep_enpip_q2%dp%d_t%dp%d_trans", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1l,"ep_enpip_q2%dp%d_t%dp%d_long", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tt,"ep_enpip_q2%dp%d_t%dp%d_tt", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tl,"ep_enpip_q2%dp%d_t%dp%d_tl", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tlp,"ep_enpip_q2%dp%d_t%dp%d_tlp", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); printf("OUTPUT1 : W (GeV), dsig_T/dt (mubarn/GeV2), dsig_T/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT2 : W (GeV), dsig_L/dt (mubarn/GeV2)dsig_L/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT3 : W (GeV), dsig_TT/dt (mubarn/GeV2)dsig_TT/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT4 : W (GeV), dsig_TL/dt (mubarn/GeV2)dsig_TL/dOmega_cm (mubarn/sr) \n"); printf("OUTPUT5 : W (GeV), dsig_TLp/dt (mubarn/GeV2)dsig_TLp/dOmega_cm (mubarn/sr) \n"); } if ( (fp1 = fopen(strcat(file1t,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file1tt,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp5 = fopen(strcat(file1tlp,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(a = a_min; a <= a_max; a += a_step) { double conv; if (rep==1) Q_sqr=a; if (rep==2) mt=-a; if (rep==3) s=pow(a,2.); if((t==0)&&(rep!=2)) { mt=pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.); } ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); conv = 1. / (2. * PI) * 2. * pi_mom_cm * ga_mom_cm; res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); res_tt = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); if (Q_sqr==0.) { res_long=0.; res_tl=0.; } else { res_long = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); res_tl = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); res_tlp = response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, mt); } fprintf(fp1, "%f \t %e \t %e \n", a, res_trans, res_trans*conv); fprintf(fp2, "%f \t %e \t %e \n", a, res_long, res_long*conv); fprintf(fp3, "%f \t %e \t %e \n", a, res_tt, res_tt*conv); fprintf(fp4, "%f \t %e \t %e \n", a, res_tl, res_tl*conv); fprintf(fp5, "%f \t %e \t %e \n", a, res_tlp, res_tlp*conv); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); fclose(fp5); break; } } break; } case 2 : /* unseparated cross section with input files for kinematics of Cornell experiments : Bebek et al. */ { int i, npoints, kin, target; char filekin0[80], filekin180[80], filekin90[80], filekin270[80]; char filekin0i[80], filekin180i[80], filekin90i[80], filekin270i[80]; char file0[]="_diff0"; char file180[]="_diff180"; char file90[]="_diff90"; char file270[]="_diff270"; char file0i[]="_diff0.input"; char file180i[]="_diff180.input"; char file90i[]="_diff90.input"; char file270i[]="_diff270.input"; printf("\n\n Choose 1 or 2 to calculate pi+ production "); printf("\n 1 = off proton"); printf("\n 2 = off deuteron"); printf("\n"); scanf("%d", &target); switch(target) { case 1 : /* off proton */ { printf("\n\n Choose the kinematics of the Cornell experiments (Bebek et al.)"); printf("\n 1 : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.95"); printf("\n 2 : W = 3.1 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.825"); printf("\n 3 : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.45"); printf("\n 4 : W = 2.15 GeV, Q^2 = 2.0 GeV^2, epsilon = 0.95"); printf("\n 5 : W = 2.65 GeV, Q^2 = 2.0 GeV^2, epsilon = 0.35"); printf("\n 6 : W = 2.65 GeV, Q^2 = 3.3 GeV^2, epsilon = 0.4"); printf("\n 7 : W = 2.65 GeV, Q^2 = 6.2 GeV^2, epsilon = 0.4"); printf("\n 8 : W = 2.65 GeV, Q^2 = 10.0 GeV^2, epsilon = 0.4"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : { char fileout[80]="ep_epipn_w2p15_qsqr1p2_eps0p95"; char filein[80]="inputfiles/ep_epipn_w2p15_qsqr1p2_eps0p95"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 2 : { char fileout[80]="ep_epipn_w3p1_qsqr1p2_eps0p825"; char filein[80]="inputfiles/ep_epipn_w3p1_qsqr1p2_eps0p825"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 3 : { char fileout[80]="ep_epipn_w2p15_qsqr1p2_eps0p45"; char filein[80]="inputfiles/ep_epipn_w2p15_qsqr1p2_eps0p45"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 4 : { char fileout[80]="ep_epipn_w2p15_qsqr2p0_eps0p95"; char filein[80]="inputfiles/ep_epipn_w2p15_qsqr2p0_eps0p95"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 5 : { char fileout[80]="ep_epipn_w2p65_qsqr2p0_eps0p35"; char filein[80]="inputfiles/ep_epipn_w2p65_qsqr2p0_eps0p35"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 6 : { char fileout[80]="ep_epipn_w2p65_qsqr3p3_eps0p4"; char filein[80]="inputfiles/ep_epipn_w2p65_qsqr3p3_eps0p4"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 7 : { char fileout[80]="ep_epipn_w2p65_qsqr6p2_eps0p4"; char filein[80]="inputfiles/ep_epipn_w2p65_qsqr6p2_eps0p4"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 8 : { char fileout[80]="ep_epipn_w2p65_qsqr10p0_eps0p4"; char filein[80]="inputfiles/ep_epipn_w2p65_qsqr10p0_eps0p4"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } } break; } case 2 : /* off deuteron */ { printf("\n\n Choose the kinematics of the Cornell experiments (Bebek et al.)"); printf("\n 1 : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.95"); printf("\n 2 : W = 3.1 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.825"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : { char fileout[80]="ep_epipn_ratio_w2p15_qsqr1p2_eps0p95"; char filein[80]="inputfiles/pimpip_ratio_w2p15_qsqr1p2_eps0p95"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } case 2 : { char fileout[80]="en_epipn_ratio_w3p1_qsqr1p2_eps0p825"; char filein[80]="inputfiles/pimpip_ratio_w3p1_qsqr1p2_eps0p825"; strcpy(filekin0,fileout); strcpy(filekin0i,filein); break; } } break; } } strcpy(filekin180,filekin0); strcpy(filekin90,filekin0); strcpy(filekin270,filekin0); strcpy(filekin180i,filekin0i); strcpy(filekin90i,filekin0i); strcpy(filekin270i,filekin0i); if ( (fp1 = fopen(strcat(filekin0i,file0i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin0,file0),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); phi = 0. * PI / 180.; printf("OUTPUT : theta_pi_cm(deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) \n"); for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; conv=2*PI; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); if ( (fp1 = fopen(strcat(filekin180i,file180i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin180,file180),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); if ( (fp1 = fopen(strcat(filekin90i,file90i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin90,file90),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); phi = 90. * PI / 180.; for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); if (target == 1) { if ( (fp1 = fopen(strcat(filekin270i,file270i),"r")) == NULL) fprintf(stderr,"\nUnable to open file"); fscanf(fp1,"%d\n", &npoints); if ( (fp2 = fopen(strcat(strcat(filekin270,file270),fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(i = 1; i <= npoints; i++) { double conv; fscanf(fp1,"%lf %lf %lf %lf\n", &pi_th, &w, &Q_sqr, &epsilon); if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; s = pow(w, 2.); ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp2, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); fclose(fp2); } break; } case 3 : /* unseparated cross section without input files */ { int kin; double diff_test; char filea[80]; char trans[80]="ep_epipn_w2p65_qsqr2p0_trans"; char longi[80]="ep_epipn_w2p65_qsqr2p0_long"; printf("\n\n Choose the kinematics of the experiment"); printf("\n 1 : Brauel et al. PLB 65 (1976) 184 (DESY)."); printf("\n : pi+ electroproduction off deuteron"); printf("\n : W = 2.19 GeV, Q^2 = 0.70 GeV^2, epsilon = 0.86"); printf("\n : W = 2.19 GeV, Q^2 = 1.35 GeV^2, epsilon = 0.84"); printf("\n 2 : Brauel et al. PLB 65 (1976) 181 (DESY)."); printf("\n : pi+ electroproduction off proton"); printf("\n : W = 2.19 GeV, Q^2 = 0.06 GeV^2, epsilon = 0.44, different values of Phi."); printf("\n 3 : Brauel et al. PLB 65 (1976) 181 (DESY)."); printf("\n : pi+ electroproduction off proton"); printf("\n : W = 2.19 GeV, Q^2 = 0.28 GeV^2, epsilon = 0.76, different values of Phi."); printf("\n 4 : Brauel et al. PLB 65 (1976) 181 (DESY)."); printf("\n : pi+ electroproduction off proton"); printf("\n : W = 2.19 GeV, Q^2 = 0.70 GeV^2, epsilon = 0.86, different values of Phi."); printf("\n 5 : Brauel et al. PLB 65 (1976) 181 (DESY)."); printf("\n : pi+ electroproduction off proton"); printf("\n : W = 2.19 GeV, Q^2 = 1.35 GeV^2, epsilon = 0.84, different values of Phi."); printf("\n 6 : Cornell experiments (Bebek et al.) with average values"); printf("\n : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.95"); printf("\n : W = 3.1 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.83"); printf("\n : W = 2.15 GeV, Q^2 = 1.2 GeV^2, epsilon = 0.45"); printf("\n 7 : Cornell experiments (Bebek et al.) with average values"); printf("\n : W = 2.65 GeV, Q^2 = 2.0 GeV^2, epsilon = 0.35"); printf("\n 8 : pi+ photoproduction"); printf("\n : E_gamma = 3.4, 5, 8, 11, 16 GeV"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : { char fileout1[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_ratio"; char fileout2[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_ratio"; strcpy(filea,fileout1); s = pow(2.19, 2.); Q_sqr = 0.70; epsilon = 0.86; phi_min = 120. * PI / 180.; /* 120. */ phi_max = 240. * PI / 180.; /* 240. */ if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT : -t(GeV^2), 2PI*dsig/dt (mubarn/GeV2) \n"); for(mt = 0.05; mt <= 1.5; mt += 0.05) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); s = pow(2.19, 2.); Q_sqr = 1.35; epsilon = 0.84; phi_min = 120. * PI / 180.; phi_max = 240. * PI / 180.; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.5; mt += 0.05) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } case 2 : { char fileout1[80]="ep_enpip_w2p19_qsqr0p06_eps0p44"; char fileout2[80]="ep_enpip_w2p19_qsqr0p06_eps0p44_phi135"; char fileout3[80]="ep_enpip_w2p19_qsqr0p06_eps0p44_phi195"; /* char fileout4[80]="ep_enpip_w2p19_qsqr0p06_trans"; char fileout5[80]="ep_enpip_w2p19_qsqr0p06_long"; char fileout6[80]="ep_enpip_w2p19_qsqr0p06_tt"; char fileout7[80]="ep_enpip_w2p19_qsqr0p06_tl"; */ s = pow(2.19, 2.); Q_sqr = 0.06; epsilon = 0.44; phi_min = 105. * PI / 180.; phi_max = 225. * PI / 180.; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : -t(GeV^2), 2PI*dsig/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=135 deg.- \n"); printf("OUTPUT3 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=195 deg.- \n"); /* printf("OUTPUT4 : -t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT5 : -t(GeV^2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT6 : -t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT7 : -t(GeV^2), dsig_TL/dt (mubarn/GeV2) \n");*/ for(mt = 0.025; mt <= 1.; mt += 0.025) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 135. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout3); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 195. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); /* strcpy(filea,fileout4); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { res_trans = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, res_trans); } fclose(fp1); strcpy(filea,fileout5); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { res_trans = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, res_trans); } fclose(fp1); strcpy(filea,fileout6); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { res_trans = response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, res_trans); } fclose(fp1); strcpy(filea,fileout7); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { res_trans = response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, res_trans); } fclose(fp1); */ break; } case 3 : { char fileout1[80]="ep_enpip_w2p19_qsqr0p28_eps0p76"; char fileout2[80]="ep_enpip_w2p19_qsqr0p28_eps0p76_phi165"; char fileout3[80]="ep_enpip_w2p19_qsqr0p28_eps0p76_phi195"; s = pow(2.19, 2.); Q_sqr = 0.28; epsilon = 0.76; phi_min = 150. * PI / 180.; phi_max = 210. * PI / 180.; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : -t(GeV^2), 2PI*dsig/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=165 deg.- \n"); printf("OUTPUT3 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=195 deg.- \n"); for(mt = 0.025; mt <= 1.; mt += 0.025) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 165. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout3); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 195. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } case 4 : { char fileout1[80]="ep_enpip_w2p19_qsqr0p70_eps0p86"; char fileout2[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi15"; char fileout3[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi45"; char fileout4[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi75"; char fileout5[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi105"; char fileout6[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi135"; char fileout7[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi165"; char fileout8[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi195"; char fileout9[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi225"; char fileout10[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi255"; char fileout11[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi285"; char fileout12[80]="ep_enpip_w2p19_qsqr0p70_eps0p86_phi315"; s = pow(2.19, 2.); Q_sqr = 0.70; epsilon = 0.86; phi_min = 150. * PI / 180.; phi_max = 210. * PI / 180.; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : -t(GeV^2), 2PI*dsig/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=15 deg.- \n"); printf("OUTPUT3 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=45 deg.- \n"); printf("OUTPUT4 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=75 deg.- \n"); printf("OUTPUT5 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=105 deg.- \n"); printf("OUTPUT6 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=135 deg.- \n"); printf("OUTPUT7 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=165 deg.- \n"); printf("OUTPUT8 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=195 deg.- \n"); printf("OUTPUT9 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=225 deg.- \n"); printf("OUTPUT10 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=255 deg.- \n"); printf("OUTPUT11 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=285 deg.- \n"); printf("OUTPUT12 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=315 deg.- \n"); for(mt = 0.05; mt <= 1.; mt += 0.025) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 15. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout3); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 45. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout4); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 75. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout5); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 105. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout6); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 135. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout7); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 165. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout8); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 195. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout9); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 225. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout10); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 255. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout11); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 285. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout12); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.025; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 315. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } case 5 : { char fileout0[80]="ep_enpip_wbin_qsqr1p35_eps0p84_phi15"; char fileout1[80]="ep_enpip_w2p19_qsqr1p35_eps0p84"; char fileout2[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi15"; char fileout3[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi45"; char fileout4[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi75"; char fileout5[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi105"; char fileout6[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi135"; char fileout7[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi165"; char fileout8[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi195"; char fileout9[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi225"; char fileout10[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi255"; char fileout11[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi285"; char fileout12[80]="ep_enpip_w2p19_qsqr1p35_eps0p84_phi315"; printf("OUTPUT1 : -t(GeV^2), 2PI*dsig/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=15 deg.- \n"); printf("OUTPUT3 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=45 deg.- \n"); printf("OUTPUT4 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=75 deg.- \n"); printf("OUTPUT5 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=105 deg.- \n"); printf("OUTPUT6 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=135 deg.- \n"); printf("OUTPUT7 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=165 deg.- \n"); printf("OUTPUT8 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=195 deg.- \n"); printf("OUTPUT9 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=225 deg.- \n"); printf("OUTPUT10 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=255 deg.- \n"); printf("OUTPUT11 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=285 deg.- \n"); printf("OUTPUT12 : -t(GeV^2), 2PI*dsig/dtdPhi (mubarn/GeV2) -Phi=315 deg.- \n"); Q_sqr = 1.35; epsilon = 0.84; w_min = 1.9; w_max = 2.5; phi = 15. * PI / 180.; strcpy(filea,fileout0); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.; mt += 0.05) { diff = 2. * PI * dsigma_dtdphi_av(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, w_min, w_max, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); s = pow(2.19, 2.); Q_sqr = 1.35; epsilon = 0.84; phi_min = 190. * PI / 180.; phi_max = 200. * PI / 180.; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.; mt += 0.05) { diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, - mt); diff_test = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., PI, epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 15. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout3); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 45. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout4); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 75. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout5); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 105. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout6); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 135. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout7); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 165. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout8); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 195. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout9); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 225. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout10); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 255. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout11); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 285. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout12); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.075; mt <= 1.2; mt += 0.025) { diff = 2. * PI * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., 315. * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } case 6 : /* Cornell experiments (Bebek et al.) with average values */ { char fileout1[80]="ep_epipn_ratio_av_w2p15_qsqr1p2_eps0p95_diff0"; char fileout2[80]="ep_epipn_ratio_av_w2p15_qsqr1p2_eps0p95_diff90"; char fileout3[80]="ep_epipn_ratio_av_w3p1_qsqr1p2_eps0p83_diff0"; char fileout4[80]="ep_epipn_ratio_av_w3p1_qsqr1p2_eps0p83_diff90"; char fileout5[80]="ep_epipn_ratio_av_w2p15_qsqr1p2_eps0p95_intphi0"; char fileout6[80]="ep_epipn_ratio_av_w2p15_qsqr1p2_eps0p45_diff0"; char fileout7[80]="ep_epipn_ratio_av_w2p15_qsqr1p2_eps0p45_diff90"; s = pow(2.15, 2.); Q_sqr = 1.2; epsilon = 0.95; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : theta_pi_cm (deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) -Phi=0. deg- \n"); printf("OUTPUT2 : theta_pi_cm (deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) -Phi=90. deg- \n"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); /* strcpy(filea,fileout5); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { if (pi_th >= 0.) { phi = 0. * PI / 180.; phi_min = -45. * PI / 180.; phi_max = 45. * PI / 180.; } else { phi = 180. * PI / 180.; phi_min = 135. * PI / 180.; phi_max = 225. * PI / 180.; } ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); diff = 2. * PI * dsigma_dt(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi_min, phi_max, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); */ s = pow(3.1, 2.); Q_sqr = 1.2; epsilon = 0.83; strcpy(filea,fileout3); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout4); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); s = pow(2.15, 2.); Q_sqr = 1.2; epsilon = 0.45; strcpy(filea,fileout6); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout7); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); break; } case 7 : /* Cornell experiments (Bebek et al.) with average values */ { char fileout1[80]="ep_epipn_ratio_av_w2p65_qsqr2p0_eps0p35_diff0"; char fileout2[80]="ep_epipn_ratio_av_w2p65_qsqr2p0_eps0p35_diff90"; s = pow(2.65, 2.); Q_sqr = 2.0; epsilon = 0.35; strcpy(filea,fileout1); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : theta_pi_cm (deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) -Phi=0. deg- \n"); printf("OUTPUT2 : theta_pi_cm (deg), -t(GeV^2), dsig/dOmega_cm (mubarn/sr) -Phi=90. deg- \n"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 0. * PI / 180.; else phi = 180. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); strcpy(filea,fileout2); if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(pi_th = -40.; pi_th <= 40.; pi_th += 2.5) { double conv; if (pi_th >= 0.) phi = 90. * PI / 180.; else phi = 270. * PI / 180.; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); t = - Q_sqr + pow(PI_M,2.) - 2. * ga_en_cm * pi_en + 2. * ga_mom_cm * pi_mom_cm * cos(pi_th * PI / 180.); conv = 2. * pi_mom_cm * ga_mom_cm; diff = conv * dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi, epsilon, Q_sqr, s, t); fprintf(fp1, "%f \t %f \t %e \n", pi_th, -t, diff); } fclose(fp1); break; } case 8 : /* pi+ photoproduction */ { double ga_en_lab, mtstep=.05; char fileout1[80]="gap_npip_diff_3p4gev"; char fileout2[80]="gap_npip_diff_8gev"; char fileout3[80]="gap_npip_diff_16gev"; char fileout4[80]="gap_npip_diff_5gev"; char fileout5[80]="gap_npip_diff_11gev"; strcpy(filea,fileout1); ga_en_lab = 3.4; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT : -t(GeV^2), dsig/dt (mubarn/GeV2) \n"); for(mt = 0.001; mt <= 2.5; mt += mtstep) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout2); ga_en_lab = 8.; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 2.5; mt += mtstep) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout3); ga_en_lab = 16.; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 2.5; mt += mtstep) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout4); ga_en_lab = 5.; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 2.5; mt += mtstep) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); strcpy(filea,fileout5); ga_en_lab = 11.; s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); Q_sqr = 0.0; if ( (fp1 = fopen(strcat(filea,fileb),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 2.5; mt += mtstep) { diff = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); fprintf(fp1, "%f \t %e \n", mt, diff); } fclose(fp1); break; } } break; } case 4 : /* unseparated cross section for simulations */ { int idis; printf("\n Which distribution ?"); printf("\n 1 : t distribution"); printf("\n 2 : Phi distribution"); printf("\n 3 : Q2 scaling"); printf("\n 4 : dsdt(t=tmin) vs. epsilon"); printf("\n"); scanf("%d", &idis); switch(idis) { case 1 : /* t distribution */ { int integre,iepsbeam,iobsdiff,ixw; double result1,result2,result3,result4,result5; double ebeam,x_b,k_out_mom_lab,k_out_th_lab,ga_mom_in_cm, ga_mom_in_lab,conv,virtual_photon_flux,mes_mom_out_cm, virtual_photon_flux2,xnu; double ga_mom_in_cm1,mes_mom_out_cm1; printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); printf("\n W or x_B fixed ?"); printf("\n 1 : W"); printf("\n 2 : x_B"); printf("\n"); scanf("%d", &ixw); if (ixw==1) { printf("\n Which W ?"); printf("\n"); scanf("%lf", &w); s=pow(w,2.); } if (ixw==2) { printf("\n Which x_B ?"); printf("\n"); scanf("%lf", &x_b); s = pow(NU_M,2.) + Q_sqr * (1-x_b)/x_b ; w=sqrt(s); } printf("\n Define epsilon or ebeam ?"); printf("\n 1 : epsilon"); printf("\n 2 : ebeam"); printf("\n"); scanf("%d", &iepsbeam); if (iepsbeam==1) { printf("\n Which epsilon ?"); printf("\n"); scanf("%lf", &epsilon); } if (iepsbeam==2) { printf("\n Which beam energy ?"); printf("\n"); scanf("%lf", &ebeam); x_b = Q_sqr / (s + Q_sqr - pow(NU_M,2.)); k_out_mom_lab = ebeam - Q_sqr / (2. * NU_M * x_b); k_out_th_lab = 2. * asin(sqrt(Q_sqr / (4. * ebeam * k_out_mom_lab))); ga_mom_in_lab = sqrt(pow(ebeam, 2.) + pow(k_out_mom_lab, 2.) - 2. * ebeam * k_out_mom_lab * cos(k_out_th_lab) ); epsilon = 1. / (1. + 2. * pow(ga_mom_in_lab, 2.) / Q_sqr * pow(tan(0.5 * k_out_th_lab), 2.) ); } printf("\n Which differential observable to calculate?"); printf("\n 1 : dsig/dt"); printf("\n 2 : dsig/dk_e/d_omega^_e/domega_M^CM"); printf("\n 3 : dsig/dQ2/d_nu/domega_M^CM"); printf("\n 4 : dsig/dQ2/d_nu/dt"); printf("\n 5 : dsig/dQ2/d_xB/dt"); printf("\n"); scanf("%d", &iobsdiff); if (iobsdiff==1) { conv=1.; } if ((iobsdiff==2)||(iobsdiff==3)||(iobsdiff==4)||(iobsdiff==5)) { virtual_photon_flux = pow(ELEC,2.)/(4. * PI) * 1./(2. * pow(PI,2.)) * k_out_mom_lab / ebeam * (s - pow(NU_M,2.))/(2. * NU_M) * 1./Q_sqr * 1./(1. - epsilon); /* Bogdan's, Marcel's, JML'S FLUX */ /* virtual_photon_flux2 = pow(ELEC,2.)/(4. * PI) * 1./(2. * pow(PI,2.)) * k_out_mom_lab / ebeam * sqrt(Q_sqr+pow(ebeam-k_out_mom_lab,2.)) * 1./Q_sqr * 1./(1. - epsilon);*/ /* printf("\n hello %lf %lf",virtual_photon_flux,virtual_photon_flux2);*/ if (iobsdiff==3) { virtual_photon_flux=virtual_photon_flux*2.*PI/(2.*ebeam*k_out_mom_lab); ga_mom_in_cm = NU_M/sqrt(s) * ga_mom_in_lab; mes_mom_out_cm = (s - pow(NU_M,2.))/(2. * sqrt(s)); /* ga_mom_in_cm1 = sqrt((pow(s-pow(NU_M,2.)+Q_sqr,2.)+ 4.*pow(NU_M,2.)*Q_sqr)/4./s); mes_mom_out_cm1 = sqrt((pow(s-pow(NU_M,2.)-pow(.140,2.),2.) -4.*pow(NU_M,2.)*pow(.140,2.))/4./s);*/ conv = virtual_photon_flux * 2. * ga_mom_in_cm * mes_mom_out_cm /(2. * PI); /* printf("\n hello %lf %lf %lf %lf %lf %lf ", 2. * ga_mom_in_cm * mes_mom_out_cm /(2. * PI),ga_mom_in_cm,ga_mom_in_cm1, mes_mom_out_cm,mes_mom_out_cm1,2. * ga_mom_in_cm1 * mes_mom_out_cm1 /(2. * PI));*/ break; } if (iobsdiff==4) { conv=virtual_photon_flux*2.*PI/(2.*ebeam*k_out_mom_lab); } if (iobsdiff==5) { xnu=Q_sqr / (2. * NU_M * x_b); conv=virtual_photon_flux*2.*PI/(2.*ebeam*k_out_mom_lab)*xnu/x_b; } } /* printf("\n %d %d",iepsbeam,iobsdiff); printf("\n %lf %lf",epsilon,conv);*/ printf("\n Integrated over Phi or Not ?"); printf("\n 1 : Yes"); printf("\n 2 : No"); printf("\n"); scanf("%d", &integre); if (integre==2) { printf("\n Which Phi ?"); printf("\n"); scanf("%lf", &phi); } /* s = pow(2.15, 2.); Q_sqr = 1.2; epsilon = 0.95;*/ if ( (fp1 = fopen("simut.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(mt = 0.001; mt <= 1.5; mt += 0.02) { result1 = conv*response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); result2 = conv*response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); result3 = conv*response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); result4 = conv*response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, - mt); if (integre==2) { result5=result1+epsilon*result2-epsilon*cos(2.*phi) *result3+sqrt(2.*epsilon*(1.+epsilon))*cos(phi)*result4; } if (integre==1) { result5=result1+epsilon*result2; } fprintf(fp1, "%e \t %e \t %e \t %e \t %e \t %e \n", mt,result1,result2,result3,result4,result5); } fclose(fp1); break; } case 2 : /* Phi distribution */ { double result; printf("\n Which W ?"); printf("\n"); scanf("%lf", &w); s=pow(w,2.); printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); printf("\n Which epsilon ?"); printf("\n"); scanf("%lf", &epsilon); printf("\n Which t (t>0) ?"); printf("\n"); scanf("%lf", &mt); if ( (fp1 = fopen("simuphi.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(phi = 0.; phi <= 360; phi += 2.) { result=dsigma_dtdphi(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, 0., phi * PI / 180., epsilon, Q_sqr, s, - mt); fprintf(fp1, "%f \t %f \n",phi,result); } fclose(fp1); break; } case 3 : /* Q2 scaling */ { double result1,result2,x_b,ga_en_in_lab,ga_mom_in_lab, mes_mom_lab_test,tmin_test,mes_mom_lab,mes_en_lab; double amin,bmin,cmin,Q_sqr_min,Q_sqr_max,Q_sqr_step; int ixw; printf("\n x_B or W ?"); printf("\n 1 : x_B"); printf("\n 2 : W"); printf("\n"); scanf("%d", &ixw); if (ixw==1) { printf("\n Which x_B ?"); printf("\n"); scanf("%lf", &x_b); } if (ixw==2) { printf("\n Which W ?"); printf("\n"); scanf("%lf", &w); s=pow(w,2.); } printf("\n Which t (t>0) ? (if 0. then t = t_min)"); printf("\n"); scanf("%lf", &mt); Q_sqr_min=1.5; Q_sqr_max=5.; Q_sqr_step=.2; if ( (fp1 = fopen("scal.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(Q_sqr = Q_sqr_min; Q_sqr <= Q_sqr_max; Q_sqr += Q_sqr_step) { if (ixw==2) x_b=Q_sqr/(s+Q_sqr-pow(NU_M,2.)); ga_en_in_lab = Q_sqr / (2. * NU_M * x_b); ga_mom_in_lab = sqrt(Q_sqr + pow(ga_en_in_lab,2.)); s = pow(NU_M,2.) + Q_sqr * (1. - x_b)/x_b; if (mt==0.) { amin = pow(NU_M +ga_en_in_lab,2.) - pow(ga_mom_in_lab,2.); bmin = 0.5 * (s - pow(NU_M,2.) + pow(PI_M, 2.)) * ga_mom_in_lab; cmin = pow(0.5 * (s - pow(NU_M,2.) + pow(PI_M, 2.)), 2.) - pow(PI_M * (NU_M + ga_en_in_lab), 2.); mes_mom_lab_test = .5 * (s - pow(NU_M,2.)) / (ga_en_in_lab + NU_M - ga_mom_in_lab); tmin_test = - 2.*NU_M * (ga_en_in_lab - mes_mom_lab_test); if ((bmin*bmin + amin*cmin) > 0) { mes_mom_lab = 1./amin * ( bmin + sqrt(pow(bmin,2.) + amin * cmin)); mes_en_lab = sqrt(pow(mes_mom_lab,2.) + pow(PI_M,2.)); t = - 2. * NU_M * (ga_en_in_lab - mes_en_lab); } } else { t=-mt; } result1 = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); result2 = response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1,"%f \t %f \t %f \t %f\n", Q_sqr, -t, result1, result2); } fclose(fp1); break; } case 4 : /* dsdt(t=tmin) vs. epsilon */ { double result,x_b,ga_en_in_lab,ga_mom_in_lab,mes_mom_lab_test, tmin_test,mes_mom_lab,mes_en_lab; double amin,bmin,cmin,eps,eps_min,eps_max,eps_step; int ixw; printf("\n x_B or W ?"); printf("\n 1 : x_B"); printf("\n 2 : W"); printf("\n"); scanf("%d", &ixw); if (ixw==1) { printf("\n Which x_B ?"); printf("\n"); scanf("%lf", &x_b); } if (ixw==2) { printf("\n Which W ?"); printf("\n"); scanf("%lf", &w); s=pow(w,2.); } printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); printf("\n Which t (t>0) ? (if 0. then t = t_min)"); printf("\n"); scanf("%lf", &mt); eps_min=0.; eps_max=1.; eps_step=.1; if ( (fp1 = fopen("eps.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(eps = eps_min; eps <= eps_max; eps += eps_step) { if (ixw==2) x_b=Q_sqr/(s+Q_sqr-pow(NU_M,2.)); ga_en_in_lab = Q_sqr / (2. * NU_M * x_b); ga_mom_in_lab = sqrt(Q_sqr + pow(ga_en_in_lab,2.)); s = pow(NU_M,2.) + Q_sqr * (1. - x_b)/x_b; if (mt==0.) { amin = pow(NU_M +ga_en_in_lab,2.) - pow(ga_mom_in_lab,2.); bmin = 0.5 * (s - pow(NU_M,2.) + pow(PI_M, 2.)) * ga_mom_in_lab; cmin = pow(0.5 * (s - pow(NU_M,2.) + pow(PI_M, 2.)), 2.) - pow(PI_M * (NU_M + ga_en_in_lab), 2.); mes_mom_lab_test = .5 * (s - pow(NU_M,2.)) / (ga_en_in_lab + NU_M - ga_mom_in_lab); tmin_test = - 2.*NU_M * (ga_en_in_lab - mes_mom_lab_test); if ((bmin*bmin + amin*cmin) > 0) { mes_mom_lab = 1./amin * ( bmin + sqrt(pow(bmin,2.) + amin * cmin)); mes_en_lab = sqrt(pow(mes_mom_lab,2.) + pow(PI_M,2.)); t = - 2. * NU_M * (ga_en_in_lab - mes_en_lab); } } else { t=-mt; } result = response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) +eps*response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); fprintf(fp1,"%f \t %f \t %f \t %f\n", eps, -t, result, pow(Q_sqr,3.) * result); } fclose(fp1); break; } } break; } case 5: /* gdh integral */ { int ieq2, vec_mes, i1, i2; double x2; double upper_en, upper_w, gdh, gdh_l_Tp, gdh_xy_TLp, gdh_p, gdh_m, gdh_norm, sigma_p, sigma_m, ga_en_lab; char filea[80],filehelp[80],filectot1[80],filebtot1[80]; printf("\n As a function of energy or Q2 ?"); printf("\n 1 : Energy"); printf("\n 2 : Q2"); printf("\n"); scanf("%d", &ieq2); switch(ieq2) { case 1 : { printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); i1=(int) Q_sqr; x2=fmod((double) Q_sqr*10,10); i2=(int) x2; sprintf(filebtot1,"gdh_integral_q2%dp%d_pip.dat",i1,i2); if ( (fp4 = fopen(filebtot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : E_gamma_max (GeV), W_max (GeV), gdh_l_Tp, gdh_+, gdh_-, gdh_xy_TLp, gdh_norm \n"); printf("OUTPUT2 : W (GeV), E_gamma (GeV), sigma_+ (mubarn), sigma_- (mubarn) \n"); for (upper_en = 1.7; upper_en <= 10.; upper_en +=.3) { gdh_p = gdh_integral_p(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_m = gdh_integral_m(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_l_Tp = gdh_integral_l_Tp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); if (Q_sqr!=0.) { gdh_xy_TLp = gdh_integral_xy_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); } else { gdh_xy_TLp=0.; } gdh=gdh_m-gdh_p-gdh_xy_TLp; /* gdh_norm=gdh*pow(NU_M,2.)/(8.*pow(PI,2.)*pow(ELEC,2.)/(4. * PI));*/ gdh_norm=gdh; upper_w=sqrt(pow(NU_M,2.)+2.*NU_M*upper_en-Q_sqr); fprintf(fp4, "%f \t %f \t %e \t %e \t %e \t %e \t %e \n", upper_en, upper_w, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); } fclose(fp4); sprintf(filectot1,"sigs_q2%dp%d_pip.dat",i1,i2); if ( (fp1 = fopen(filectot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; for (w = 2.; w <= 5.; w +=.1) { ga_en_lab=(-pow(NU_M,2.)+pow(w,2.)+Q_sqr)/2./NU_M; sigma_p=int_gdh_integral_p(ga_en_lab)*ga_en_lab; sigma_m=int_gdh_integral_m(ga_en_lab)*ga_en_lab; fprintf(fp1, "%f \t %f \t %e \t %e \n", w, ga_en_lab, sigma_p, sigma_m); } fclose(fp1); break; } case 2 : { if ( (fp4 = fopen("gdhvsq2_pip.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); upper_en=5.; printf("OUTPUT1 : Q2 (GeV2), gdh_l_Tp, gdh_+, gdh_-, gdh_xy_TLp, gdh_norm \n"); printf("OUTPUT2 : Q2 (GeV2), sigma_+ (mubarn), sigma_- (mubarn) \n"); for (Q_sqr = 0.; Q_sqr <= 2.; Q_sqr +=.1) { gdh_p = gdh_integral_p(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_m = gdh_integral_m(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); gdh_l_Tp = gdh_integral_l_Tp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); if (Q_sqr!=0.) { gdh_xy_TLp = gdh_integral_xy_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, upper_en); } else { gdh_xy_TLp=0.; } gdh=gdh_p-gdh_m-gdh_xy_TLp; /* gdh_norm=-gdh*pow(NU_M,2.)/(8.*pow(PI,2.)*pow(ELEC,2.)/(4. * PI));*/ gdh_norm=-gdh; fprintf(fp4, "%f \t %e \t %e \t %e \t %e \t %e \n", Q_sqr, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); printf("\n%f \t %e \t %e \t %e \t %e \t %e", Q_sqr, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); } fclose(fp4); break; } } break; } case 6 : /* target spin asymmetry at fixed t as function of x_B */ { int i1,i2; char filebtot1[80]; double tortho, lortho, res_trans, res_long, epsilon, asymm_lam, W, tmin; printf("\n\n Give the value of W"); printf("\n"); scanf("%lf", &W); printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); if (Q_sqr!=0.) { printf("\n Which epsilon ?"); printf("\n"); scanf("%lf", &epsilon); } i1=(int) Q_sqr; i2=(int) W; sprintf(filebtot1,"target_asym_q2%_w%_pip.dat",i1,i2); s=pow(W,2.); tmin=pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.); printf("OUTPUT : -t (GeV2), dsig_T_perp/dt (mubarn/GeV2), dsig_T/dt (mubarn/GeV2), dsig_L_perp/dt (mubarn/GeV2), dsig_L/dt (mubarn/GeV2), Target_asym \n"); for(mt = -tmin; mt <= 1.; mt += .05) { if ( (fp1 = fopen(filebtot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); t = -mt; tortho = response_R_perp_T(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_trans = response_R_T(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); lortho = response_R_perp_L(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); res_long = response_R_L(reaction,mech,deg_pi,deg_rho, ff_pi, ff_rho, Q_sqr, s, t); if (Q_sqr==0.) { asymm_lam = tortho/res_trans; } else { asymm_lam = (tortho+epsilon*lortho) / (res_trans+epsilon*res_long); } printf("%f \t %e \t %e \t %e \t %e \t %e \n", mt, tortho, res_trans, lortho, res_long, asymm_lam); /* fprintf(fp1,"%f \t %e \t %e\n", mt, result1, result2);*/ fclose(fp1); } break; } } break; } case 2: /* unpolarized (e, e' n pi_plus) differential cross section : backward */ { int mech; double nu_th; /* mech = choice for BACKWARD scattering */ /* 1 : nucleon */ /* 2 : delta */ /* 3 : nucleon + delta */ /* 4 : nucleon + d13 */ /* 5 : nucleon + delta + d13 */ break; } } break; } /* ********************************************************************* */ /* ********************************************************************* */ case 3: /* for (e, e' p pi_zero) reaction */ { /* 1. unpolarized forward differential cross section */ /* 2. unpolarized backward differential cross section */ int pol = 1; switch(pol) { case 1: /* UNPOLARIZED differential cross section for the (e, e' p pi_zero) reaction : forward scattering */ { int mech, deg_rho; char filea[80],filec[80],fileaa[80]; /* mech = choice for FORWARD scattering */ /* 1 : omega */ /* 2 : rho */ /* 3 : omega + rho */ printf("\n\n Give choice for FORWARD scattering mechanism"); printf("\n 1 = omega exchange only"); printf("\n 2 = rho exchange only"); printf("\n 3 = rho+omega exchanges"); printf("\n 4 = B exchange only"); printf("\n 5 = rho+omega+B exchanges"); printf("\n"); scanf("%d", &mech); /* mech = 3;*/ switch(mech) { case 1 : { char fileout[]="_ome.dat"; strcpy(filec,fileout); break; } case 2 : { char fileout[]="_rho.dat"; strcpy(filec,fileout); break; } case 3 : { char fileout[]="_omerho.dat"; strcpy(filec,fileout); break; } case 4 : { char fileout[]="_b1.dat"; strcpy(filec,fileout); break; } case 5 : { char fileout[]="_omerhob1.dat"; strcpy(filec,fileout); break; } } if ((mech==2)||(mech==3)||(mech==5)) { printf("\n\n Give choice for degeneracy of RHO trajectory"); printf("\n 1 = non-degenerate trajectory"); printf("\n 2 = degenerate trajectory with rotating phase"); printf("\n 3 = degenerate trajectory with NON-rotating phase"); /* printf("\n 4 = single pole");*/ printf("\n"); scanf("%d", °_rho); } /* deg_rho = 2;*/ printf("\n\n Photo or Electro ?"); printf("\n 1 = Photo"); printf("\n 2 = Electro"); printf("\n 3 = GDH integral"); printf("\n"); scanf("%d", &photelec); switch(photelec) { case 1 : /* Photoproduction */ { int i; double ga_en_lab; double res_trans, res_tt; if ((mech==4)||(mech==5)) { /* 1.7 gives best fit */ printf("\n\n Give B coupling constant (1.7)"); printf("\n"); scanf("%f", &b_coup); } for(i = 1; i <= 4; i += 1) { if (i==1) { char fileb[]="ga_6"; char filebb[]="gaas_6"; ga_en_lab = 6.; strcpy(filea,fileb); strcpy(fileaa,filebb); } if (i==2) { char fileb[]="ga_9"; ga_en_lab = 9.; strcpy(filea,fileb); } if (i==3) { char fileb[]="ga_12"; ga_en_lab = 12.; strcpy(filea,fileb); } if (i==4) { char fileb[]="ga_15"; ga_en_lab = 15.; strcpy(filea,fileb); } s = 2. * NU_M * ga_en_lab + pow(NU_M, 2.); strcat(filea,filec); if (i==1) strcat(fileaa,filec); if ( (fp1 = fopen(filea,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if (i==1) { if ( (fp2 = fopen(fileaa,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); } printf("OUTPUT1 : t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); /* for(t = 0.001; t <= 2.; t += 0.1)*/ for(t = 0.01; t <= 2.; t += 0.1) { double conv; /* ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) , 2.) ) / (4. * s) ); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); conv = 1. / (2. * PI) * 2. * pi_mom_cm * ga_mom_cm; */ res_trans = response_R_T(reaction, mech, 0, deg_rho, 1, 1, 0., s, -t); res_tt = response_R_TT(reaction, mech, 0, deg_rho, 1, 1, 0., s, -t); fprintf(fp1, "%f \t %e \n", t, res_trans); if (i==1) fprintf(fp2, "%f \t %e \n", t, res_tt/res_trans); } fclose(fp1); if (i==1) fclose(fp2); } break; } case 2 : /* Electroproduction */ { int i, kin; double res_trans, res_long, res_tt, res_tl, res_tot; double nu2,ql2; if ((mech==1)||(mech==2)||(mech==3)||(mech==5)) { printf("\n\n Give form factor mass scale of OMEGA"); printf("\n"); scanf("%lf", &ome_msc); } if ((mech==2)||(mech==3)||(mech==5)) { printf("\n\n Give form factor mass scale of RHO"); printf("\n"); scanf("%lf", &rho_msc); } if ((mech==4)||(mech==5)) { printf("\n\n Give form factor mass scale of B"); printf("\n"); scanf("%f", &b_msc); printf("\n\n Give B coupling constant (1.7)"); printf("\n"); scanf("%lf", &b_coup); } printf("\n\n Choose the kinematics of the experiment"); printf("\n 1 : t-dependence"); printf("\n : W = 2.55 GeV, Q^2 = 0.06 GeV^2"); printf("\n : W = 2.55 GeV, Q^2 = 0.22 GeV^2"); printf("\n : W = 2.55 GeV, Q^2 = .55 GeV^2"); printf("\n : W = 2.55 GeV, Q^2 = .85 GeV^2"); printf("\n 2 : User-defined kinematics"); printf("\n"); printf("\n"); scanf("%d", &kin); switch(kin) { case 1 : /* t-dependence : W=2.55 */ { for(i = 1; i <= 4; i += 1) { char filetot[80]="tot_"; char filetrans[80]="trans_"; char filett[80]="tt_"; if (i==1) { char fileb[]="eppi0_w2p55_p06"; Q_sqr = 0.06; strcpy(filea,fileb); } if (i==2) { char fileb[]="eppi0_w2p55_p22"; Q_sqr = .22; /* Q_sqr = .005;*/ strcpy(filea,fileb); } if (i==3) { char fileb[]="eppi0_w2p55_p55"; Q_sqr = .55; /* Q_sqr = .01;*/ strcpy(filea,fileb); } if (i==4) { char fileb[]="eppi0_w2p55_p85"; Q_sqr = .85; /* Q_sqr = .015;*/ strcpy(filea,fileb); } s = pow(2.55, 2.); nu2=(s+Q_sqr-pow(NU_M, 2.))/(2.*NU_M); ql2=Q_sqr+nu2; epsilon= 1./(1.+2.*ql2/Q_sqr*pow(tan(10.3*PI/180.),2.)); strcat(filea,filec); if ( (fp1 = fopen(strcat(filetot,filea),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(filetrans,filea),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(filett,filea),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : t(GeV^2), dsig_T/dt+epsilon*dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : t(GeV^2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : t(GeV^2), dsig_TT/dt (mubarn/GeV2) \n"); for(t = 0.001; t <= 2.1; t += 0.1) { res_trans = response_R_T(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, -t); res_long = response_R_L(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, -t); res_tt = response_R_TT(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, -t); /* res_tot= 2./(1.+epsilon)*(res_trans+epsilon*(res_long+res_tt));*/ res_tot= res_trans+epsilon*res_long; if (res_tot > 0.) { /* fprintf(fp1, "%f \t %e \n", t, res_tot); fprintf(fp2, "%f \t %e \n", t, 2./(1.+epsilon)*res_trans); fprintf(fp3, "%f \t %e \n", t, 2./(1.+epsilon)*epsilon*res_tt);*/ fprintf(fp1, "%f \t %e \n", t, res_tot); fprintf(fp2, "%f \t %e \n", t, res_trans); fprintf(fp3, "%f \t %e \n", t, res_tt); } } fclose(fp1); fclose(fp2); fclose(fp3); } break; } case 2 : /* User-defined kinematics */ { double a, a_min, a_max, a_step, W_min, W_max, W_step, t_min, t_max, t_step, Q2_min, Q2_max, Q2_step, bidon1, bidon2; double ga_en_in_lab, ga_mom_in_lab, W, tmin_test, mes_mom_lab_test, mes_en_lab, mes_mom_lab; int rep; char file1t[80],file1l[80],file1tt[80],file1tl[80]; printf("\n 1 : Q2 dependence"); printf("\n 2 : t dependence"); printf("\n 3 : W dependence"); printf("\n"); scanf("%d", &rep); if (rep==1) { printf("\n Which W"); printf("\n"); scanf("%lf", &W); printf("\n Which t (t>0) -if t=0, t=t_min-"); printf("\n"); scanf("%lf", &t); s = pow(W,2.); mt=-t; printf("\n Q2_min ?"); printf("\n"); scanf("%lf", &Q2_min); printf("\n Which Q2_max ?"); printf("\n"); scanf("%lf", &Q2_max); printf("\n Which Q2_step ?"); printf("\n"); scanf("%lf", &Q2_step); a_min=Q2_min; a_max=Q2_max; a_step=Q2_step; bidon1=(W-(int) W)*10.; bidon2=(t-(int) t)*10.; sprintf(file1t,"ep_eppi0_t%dp%d_w%dp%d_trans", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1l,"ep_eppi0_t%dp%d_w%dp%d_long", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tt,"ep_eppi0_t%dp%d_w%dp%d_tt", (int) t, (int) bidon2, (int) W, (int) bidon1); sprintf(file1tl,"ep_eppi0_t%dp%d_w%dp%d_tl", (int) t, (int) bidon2, (int) W, (int) bidon1); printf("OUTPUT1 : Q2 (GeV2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : Q2 (GeV2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : Q2 (GeV2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : Q2 (GeV2), dsig_TL/dt (mubarn/GeV2) \n"); } if (rep==2) { printf("\n Which W"); printf("\n"); scanf("%lf", &W); printf("\n Which Q2"); printf("\n"); scanf("%lf", &Q_sqr); s = pow(W,2.); printf("\n t_min ?"); printf("\n"); scanf("%lf", &t_min); printf("\n t_max ?"); printf("\n"); scanf("%lf", &t_max); printf("\n t_step ?"); printf("\n"); scanf("%lf", &t_step); a_min=t_min; a_max=t_max; a_step=t_step; if(t_min==0.) { a_min=-(pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.)); a_min=a_min+.001; } bidon1=(Q_sqr-(int) Q_sqr)*10.; bidon2=(W-(int) W)*10.; sprintf(file1t,"ep_eppi0_q2%dp%d_w%dp%d_trans", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1l,"ep_eppi0_q2%dp%d_w%dp%d_long", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tt,"ep_eppi0_q2%dp%d_w%dp%d_tt", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); sprintf(file1tl,"ep_eppi0_q2%dp%d_w%dp%d_tl", (int) Q_sqr, (int) bidon1, (int) W, (int) bidon2); printf("OUTPUT1 : -t (GeV2), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : -t (GeV2), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : -t (GeV2), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : -t (GeV2), dsig_TL/dt (mubarn/GeV2) \n"); } if (rep==3) { printf("\n Which Q2"); printf("\n"); scanf("%lf", &Q_sqr); printf("\n Which t (t>0) -if t=0, t=t_min-"); printf("\n"); scanf("%lf", &t); mt=-t; printf("\n W_min ?"); printf("\n"); scanf("%lf", &W_min); printf("\n W_max ?"); printf("\n"); scanf("%lf", &W_max); printf("\n W_step ?"); printf("\n"); scanf("%lf", &W_step); a_min=W_min; a_max=W_max; a_step=W_step; bidon1=(Q_sqr-(int) Q_sqr)*10.; bidon2=(t-(int) t)*10.; sprintf(file1t,"ep_eppi0_q2%dp%d_t%dp%d_trans", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1l,"ep_eppi0_q2%dp%d_t%dp%d_long", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tt,"ep_eppi0_q2%dp%d_t%dp%d_tt", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); sprintf(file1tl,"ep_eppi0_q2%dp%d_t%dp%d_tl", (int) Q_sqr, (int) bidon1, (int) t, (int) bidon2); printf("OUTPUT1 : W (GeV), dsig_T/dt (mubarn/GeV2) \n"); printf("OUTPUT2 : W (GeV), dsig_L/dt (mubarn/GeV2) \n"); printf("OUTPUT3 : W (GeV), dsig_TT/dt (mubarn/GeV2) \n"); printf("OUTPUT4 : W (GeV), dsig_TL/dt (mubarn/GeV2) \n"); } if ( (fp1 = fopen(strcat(file1t,filec),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen(strcat(file1l,filec),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp3 = fopen(strcat(file1tt,filec),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp4 = fopen(strcat(file1tl,filec),"w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(a = a_min; a <= a_max; a += a_step) { if (rep==1) Q_sqr=a; if (rep==2) mt=-a; if (rep==3) s=pow(a,2.); if((t==0)&&(rep!=2)) { mt=pow((-Q_sqr-pow(PI_M,2.)-pow(NU_M,2.)+pow(NU_M,2.))/2./sqrt(s),2.) -pow(sqrt(pow((s-Q_sqr-pow(NU_M,2.))/2./sqrt(s),2.)+Q_sqr) -sqrt(pow((s+pow(PI_M,2.)-pow(NU_M,2.))/2./sqrt(s),2.)-pow(PI_M,2.)),2.); mt=mt-.001; } res_trans = response_R_T(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, mt); res_tt = response_R_TT(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, mt); if (Q_sqr==0.) { res_long=0.; res_tl=0.; } else { res_long = response_R_L(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, mt); res_tl = response_R_TL(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, s, mt); } fprintf(fp1, "%f \t %e \n", a, res_trans); fprintf(fp2, "%f \t %e \n", a, res_long); fprintf(fp3, "%f \t %e \n", a, res_tt); fprintf(fp4, "%f \t %e \n", a, res_tl); } fclose(fp1); fclose(fp2); fclose(fp3); fclose(fp4); break; } } break; } /**/ case 3: /* gdh integral */ { int ieq2, vec_mes, i1, i2; double x2; double upper_en, upper_w, gdh, gdh_l_Tp, gdh_xy_TLp, gdh_p, gdh_m, gdh_norm, sigma_p, sigma_m, ga_en_lab; char filea[80],filehelp[80],filectot1[80],filebtot1[80]; if ((mech==4)||(mech==5)) { printf("\n\n Give B coupling constant (1.7)"); printf("\n"); scanf("%lf", &b_coup); } printf("\n GDH as a function of energy or Q2 ?"); printf("\n 1 : Energy"); printf("\n 2 : Q2"); printf("\n"); scanf("%d", &ieq2); switch(ieq2) { case 1 : { printf("\n Which Q2 ?"); printf("\n"); scanf("%lf", &Q_sqr); if (Q_sqr==0.) { photelec=1; } else { if ((mech==1)||(mech==2)||(mech==3)||(mech==5)) { printf("\n\n Give form factor mass scale of OMEGA"); printf("\n"); scanf("%lf", &ome_msc); } if ((mech==2)||(mech==3)||(mech==5)) { printf("\n\n Give form factor mass scale of RHO"); printf("\n"); scanf("%lf", &rho_msc); } if ((mech==4)||(mech==5)) { printf("\n\n Give form factor mass scale of B"); printf("\n"); scanf("%f", &b_msc); printf("\n\n Give B coupling constant (1.7)"); printf("\n"); scanf("%lf", &b_coup); } photelec=2; } i1=(int) Q_sqr; x2=fmod((double) Q_sqr*10,10); i2=(int) x2; sprintf(filebtot1,"gdh_integral_q2%dp%d_pi0.dat",i1,i2); if ( (fp4 = fopen(filebtot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); printf("OUTPUT1 : E_gamma_max (GeV), W_max (GeV), gdh_l_Tp, gdh_+, gdh_-, gdh_xy_TLp, gdh_norm \n"); printf("OUTPUT2 : W (GeV), E_gamma (GeV), sigma_+ (mubarn), sigma_- (mubarn) \n"); for (upper_en = 1.7; upper_en <= 10.; upper_en +=.3) { gdh_p = gdh_integral_p(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); gdh_m = gdh_integral_m(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); gdh_l_Tp = gdh_integral_l_Tp(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); /* if (Q_sqr!=0.) { gdh_xy_TLp = gdh_integral_xy_TLp(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); } else { gdh_xy_TLp=0.; } gdh=gdh_m-gdh_p-gdh_xy_TLp; /* gdh_norm=gdh*pow(NU_M,2.)/(8.*pow(PI,2.)*pow(ELEC,2.)/(4. * PI));*/ gdh_norm=gdh; upper_w=sqrt(pow(NU_M,2.)+2.*NU_M*upper_en-Q_sqr); fprintf(fp4, "%f \t %f \t %e \t %e \t %e \t %e \t %e \n", upper_en, upper_w, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); } fclose(fp4); sprintf(filectot1,"sigs_q2%dp%d_pi0.dat",i1,i2); if ( (fp1 = fopen(filectot1,"w")) == NULL) fprintf(stderr,"\nUnable to open file"); reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = 0; deg_rho_s2 = deg_rho; ff_pi_s2 = 1; ff_rho_s2 = 1; Q_sqr_s2 = Q_sqr; for (w = 2.; w <= 5.; w +=.1) { ga_en_lab=(-pow(NU_M,2.)+pow(w,2.)+Q_sqr)/2./NU_M; sigma_p=int_gdh_integral_p(ga_en_lab)*ga_en_lab; sigma_m=int_gdh_integral_m(ga_en_lab)*ga_en_lab; fprintf(fp1, "%f \t %f \t %e \t %e \n", w, ga_en_lab, sigma_p, sigma_m); } fclose(fp1); break; } case 2 : { if ( (fp4 = fopen("gdhvsq2_pi0.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); upper_en=5.; printf("OUTPUT1 : Q_sqr (GeV2), W_max (GeV), gdh_l_Tp, gdh_+, gdh_-, gdh_xy_TLp, gdh_norm \n"); for (Q_sqr = 0.; Q_sqr <= 2.; Q_sqr +=.1) { gdh_p = gdh_integral_p(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); gdh_m = gdh_integral_m(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); gdh_l_Tp = gdh_integral_l_Tp(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); if (Q_sqr!=0.) { gdh_xy_TLp = gdh_integral_xy_TLp(reaction, mech, 0, deg_rho, 1, 1, Q_sqr, upper_en); } else { gdh_xy_TLp=0.; } gdh=gdh_m-gdh_p-gdh_xy_TLp; gdh_norm=gdh; upper_w=sqrt(pow(NU_M,2.)+2.*NU_M*upper_en-Q_sqr); fprintf(fp4, "%f \t %f \t %e \t %e \t %e \t %e \t %e \n", Q_sqr, upper_w, gdh_l_Tp, gdh_p, gdh_m, gdh_xy_TLp, gdh_norm); } fclose(fp4); break; } } break; } /**/ } break; } case 2: /* UNPOLARIZED differential cross section for the (e, e' p pi_zero) reaction : scattering */ { int mech; /* mech = choice for BACKWARD scattering */ /* 1 : nucleon */ /* 2 : delta */ /* 3 : nucleon + delta */ /* 4 : nucleon + d13 */ /* 5 : nucleon + delta + d13 */ mech = 3; break; } } break; } /* ********************************************************************* */ /* ********************************************************************* */ case 4: /* Form factors */ { printf("\n\n Give the mass scale (< 1.05) in GeV^2 in the pion ff (e.g. 0.55) "); printf("\n"); scanf("%lf", &pi_msc); if ( (fp1 = fopen("pi_emff_monopole0p462.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); if ( (fp2 = fopen("pi_emff_rmsparam.dat","w")) == NULL) fprintf(stderr,"\nUnable to open file"); for(Q_sqr = 0.0; Q_sqr <= 10.; Q_sqr += 0.01) { fprintf(fp1, "\n%f \t %e", Q_sqr, pion_emformfactor(1,Q_sqr)); fprintf(fp2, "\n%f \t %e", Q_sqr, pion_emformfactor(2,Q_sqr)); } fclose(fp1); fclose(fp2); break; } } } /*************************************************************************/ /*************************************************************************/ /* */ /* e + N -> e + pi + N : CROSS SECTIONS and ASYMMETRIES */ /* */ /*************************************************************************/ /*************************************************************************/ /* The function dsigma_dt() gives the e + N -> e + pi + N differential cross section dsigma/dt integrated over Phi as function of electron helicity : el_hel, epsilon, Q_sqr, s and t. The units of the cross section are (microbarns / GeV^2). */ double dsigma_dt(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double phi_min, double phi_max, double epsilon, double Q_sqr, double s, double t) { reaction_s = reaction; mech_s = mech; deg_pi_s = deg_pi; deg_rho_s = deg_rho; ff_pi_s = ff_pi; ff_rho_s = ff_rho; el_hel_s = el_hel; epsilon_s = epsilon; Q_sqr_s = Q_sqr; s_s = s; t_s = t; return int1d(int_dsigma_dt, phi_min, phi_max, 4); } double int_dsigma_dt(double phi) { return dsigma_dtdphi(reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, el_hel_s, phi, epsilon_s, Q_sqr_s, s_s, t_s); } /* The function dsigma_dtdphi_av() gives the e + N -> e + pi + N differential cross section dsigma/dt dPhi averaged over energy as function of electron helicity : el_hel, phi, epsilon, Q_sqr, w_min, w_max and t. The units of the cross section are (microbarns / GeV^2). */ double dsigma_dtdphi_av(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double phi, double epsilon, double Q_sqr, double w_min, double w_max, double t) { reaction_s = reaction; mech_s = mech; deg_pi_s = deg_pi; deg_rho_s = deg_rho; ff_pi_s = ff_pi; ff_rho_s = ff_rho; el_hel_s = el_hel; phi_s = phi; epsilon_s = epsilon; Q_sqr_s = Q_sqr; t_s = t; return 1./ (w_max - w_min) * int1d(int_dsigma_dtdphi_av, w_min, w_max, 4); } double int_dsigma_dtdphi_av(double w) { double w_sqr; w_sqr = pow(w, 2.); return dsigma_dtdphi(reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, el_hel_s, phi_s, epsilon_s, Q_sqr_s, w_sqr, t_s); } /* The function dsigma_dtdphi() gives the e + N -> e + pi + N differential cross section dsigma/dt dPhi as function of electron helicity : el_hel, out-of-plane angle Phi, epsilon, Q_sqr, s and t. The units of the cross section are (microbarns / GeV^2). */ double dsigma_dtdphi(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double phi, double epsilon, double Q_sqr, double s, double t) { double unit_conv; unit_conv = 1. / (2. * PI); return unit_conv * ( response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) + epsilon * response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) - epsilon * cos(2. * phi) * response_R_TT(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) + sqrt(2. * epsilon * (1. + epsilon)) * cos(phi) * response_R_TL(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) + el_hel * sqrt(2. * epsilon * (1. - epsilon)) * sin(phi) * response_R_TLp(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) ); } /* The function dsigma_dt_anal() gives the e + N -> e + pi + N differential cross section dsigma/dt as function of electron helicity : el_hel, epsilon, Q_sqr, s and t. The units of the cross section are (microbarns / GeV^2). */ double dsigma_dt_anal(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double el_hel, double epsilon, double Q_sqr, double s, double t) { return response_R_T(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t) + epsilon * response_R_L(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t); } double gdh_integral(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr,double upper_en) { double e_thr; reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; upper_en_s2 = upper_en; /*GDH calculated starting from W=2 GeV*/ e_thr=(pow(2.,2)-pow(NU_M, 2.)+Q_sqr)/2./NU_M; return int_gauss2(int_gdh_integral, e_thr, upper_en, 20); } double gdh_integral_p(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr,double upper_en) { double e_thr; reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; upper_en_s2 = upper_en; /*GDH calculated starting from W=2 GeV*/ e_thr=(pow(2.,2)-pow(NU_M, 2.)+Q_sqr)/2./NU_M; return int_gauss2(int_gdh_integral_p, e_thr, upper_en, 20); } double gdh_integral_m(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr,double upper_en) { double e_thr; reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; upper_en_s2 = upper_en; /*GDH calculated starting from W=2 GeV*/ e_thr=(pow(2.,2)-pow(NU_M, 2.)+Q_sqr)/2./NU_M; return int_gauss2(int_gdh_integral_m, e_thr, upper_en, 20); } double gdh_integral_l_Tp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr,double upper_en) { double e_thr; reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; upper_en_s2 = upper_en; /*GDH calculated starting from W=2 GeV*/ e_thr=(pow(2.,2)-pow(NU_M, 2.)+Q_sqr)/2./NU_M; return int_gauss2(int_gdh_integral_l_Tp, e_thr, upper_en, 20); } double gdh_integral_xy_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr,double upper_en) { double e_thr; reaction_s2 = reaction; mech_s2 = mech; deg_pi_s2 = deg_pi; deg_rho_s2 = deg_rho; ff_pi_s2 = ff_pi; ff_rho_s2 = ff_rho; Q_sqr_s2 = Q_sqr; upper_en_s2 = upper_en; /*GDH calculated starting from W=2 GeV*/ e_thr=(pow(2.,2)-pow(NU_M, 2.)+Q_sqr)/2./NU_M; return int_gauss2(int_gdh_integral_xy_TLp, e_thr, upper_en, 20); } double int_gdh_integral(double ga_en_lab) { double s, ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, tmin, tmax, sigmap, sigmam, x, gama, rtlp; s=2.*NU_M*ga_en_lab+pow(NU_M,2.)- Q_sqr_s2; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr_s2, 2.) + pow(2. * NU_M, 2.) * Q_sqr_s2 ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm=sqrt((pow(s,2.)-2.*s*(pow(NU_M,2.)+pow(PI_M,2.))+ pow(pow(PI_M,2.)-pow(NU_M,2.),2.))/(4.*s)); if ((reaction_s2==1)||(reaction_s2==2)) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; } if (reaction_s2==3) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI0_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; } tmax=tmin-2.; sigmap = sigma_tot_pol(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2,1, .5, Q_sqr_s2, s, tmin, tmax); sigmam = sigma_tot_pol(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2,1, -.5, Q_sqr_s2, s, tmin, tmax); if (Q_sqr_s2==0.) { rtlp = 0.; } else { rtlp = tot_response_l_Tp(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2, Q_sqr_s2, s, tmin, tmax); } x=Q_sqr_s2/(2.*NU_M*ga_en_lab); gama=sqrt(Q_sqr_s2)/ga_en_lab; return (- sigmap + sigmam - 2. * gama * rtlp)/ga_en_lab*(1.-x)/(1.+pow(gama,2.)); } double int_gdh_integral_p(double ga_en_lab) { double s, ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, tmin, tmax, sigmap, x, gama; s=2.*NU_M*ga_en_lab+pow(NU_M,2.)- Q_sqr_s2; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr_s2, 2.) + pow(2. * NU_M, 2.) * Q_sqr_s2 ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm=sqrt((pow(s,2.)-2.*s*(pow(NU_M,2.)+pow(PI_M,2.))+ pow(pow(PI_M,2.)-pow(NU_M,2.),2.))/(4.*s)); if ((reaction_s2==1)||(reaction_s2==2)) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; } if (reaction_s2==3) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI0_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; } tmax=tmin-2.; sigmap = sigma_tot_pol(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2,1, .5, Q_sqr_s2, s, tmin, tmax); x=Q_sqr_s2/(2.*NU_M*ga_en_lab); gama=sqrt(Q_sqr_s2)/ga_en_lab; return sigmap/ga_en_lab*(1.-x)/(1+pow(gama,2.)); } double int_gdh_integral_m(double ga_en_lab) { double s, ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, tmin, tmax, sigmam, x, gama; s=2.*NU_M*ga_en_lab+pow(NU_M,2.)- Q_sqr_s2; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr_s2, 2.) + pow(2. * NU_M, 2.) * Q_sqr_s2 ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm=sqrt((pow(s,2.)-2.*s*(pow(NU_M,2.)+pow(PI_M,2.))+ pow(pow(PI_M,2.)-pow(NU_M,2.),2.))/(4.*s)); if ((reaction_s2==1)||(reaction_s2==2)) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; } if (reaction_s2==3) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI0_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; } tmax=tmin-2.; sigmam = sigma_tot_pol(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2,1,-.5, Q_sqr_s2, s, tmin, tmax); x=Q_sqr_s2/(2.*NU_M*ga_en_lab); gama=sqrt(Q_sqr_s2)/ga_en_lab; return sigmam/ga_en_lab*(1.-x)/(1+pow(gama,2.)); } double int_gdh_integral_l_Tp(double ga_en_lab) { double s, ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, tmin, tmax, sigmap, sigmam, x, gama, rtlp; s=2.*NU_M*ga_en_lab+pow(NU_M,2.)- Q_sqr_s2; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr_s2, 2.) + pow(2. * NU_M, 2.) * Q_sqr_s2 ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm=sqrt((pow(s,2.)-2.*s*(pow(NU_M,2.)+pow(PI_M,2.))+ pow(pow(PI_M,2.)-pow(NU_M,2.),2.))/(4.*s)); if ((reaction_s2==1)||(reaction_s2==2)) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; } if (reaction_s2==3) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI0_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; } tmax=tmin-2.; rtlp = tot_response_l_Tp(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2, Q_sqr_s2, s, tmin, tmax); x=Q_sqr_s2/(2.*NU_M*ga_en_lab); gama=sqrt(Q_sqr_s2)/ga_en_lab; return rtlp/ga_en_lab*(1.-x)/(1+pow(gama,2.)); } double int_gdh_integral_xy_TLp(double ga_en_lab) { double s, ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, tmin, tmax, sigmap, sigmam, x, gama, rxytlp; s=2.*NU_M*ga_en_lab+pow(NU_M,2.)- Q_sqr_s2; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr_s2, 2.) + pow(2. * NU_M, 2.) * Q_sqr_s2 ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); pi_mom_cm=sqrt((pow(s,2.)-2.*s*(pow(NU_M,2.)+pow(PI_M,2.))+ pow(pow(PI_M,2.)-pow(NU_M,2.),2.))/(4.*s)); if ((reaction_s2==1)||(reaction_s2==2)) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI_M,2.) - 2. * ga_en_cm * pi_en; } if (reaction_s2==3) { pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI0_M, 2.) ); tmin=2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; tmax=-2. * ga_mom_cm * pi_mom_cm - Q_sqr_s2 + pow(PI0_M,2.) - 2. * ga_en_cm * pi_en; } tmax=tmin-2.; rxytlp = tot_response_xy_TLp(reaction_s2, mech_s2, deg_pi_s2, deg_rho_s2, ff_pi_s2, ff_rho_s2, Q_sqr_s2, s, tmin, tmax); x=Q_sqr_s2/(2.*NU_M*ga_en_lab); gama=sqrt(Q_sqr_s2)/ga_en_lab; return 2. * gama * rxytlp/ga_en_lab*(1.-x)/(1.+pow(gama,2.)); } double sigma_tot_pol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_in, double Q_sqr, double s, double tmin, double tmax) { reaction_s = reaction; mech_s = mech; deg_pi_s = deg_pi; deg_rho_s = deg_rho; ff_pi_s = ff_pi; ff_rho_s = ff_rho; pol_ph_s = pol_ph; sp_in_s = sp_in; Q_sqr_s = Q_sqr; s_s = s; return int_gauss(int_sigma_tot_pol, tmax, tmin, 30); } double int_sigma_tot_pol(double t) { return dsigma_dt_pol(reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, pol_ph_s, sp_in_s, Q_sqr_s, s_s, t); } double dsigma_dt_pol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_in, double Q_sqr, double s, double t) { double phase, unit_conv, m2, result; unit_conv = pow(0.197,2.) * pow(10.,4.); phase = 1./(16.*PI*pow(s-pow(NU_M,2.),2.)); m2=matrix_square_pol(reaction,mech,deg_pi,deg_rho,ff_pi,ff_rho, pol_ph,sp_in,Q_sqr,s,t); result = unit_conv * phase * m2; return result; } double matrix_square_unpol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int pol_ph; double sp_out, sp_in, result=0.; dcomplex contrib; for (pol_ph=-1 ; pol_ph<=1 ; pol_ph += 2) { for (sp_out=-.5 ; sp_out<=.5 ; sp_out += 1.) { for (sp_in=-0.5 ; sp_in<=0.5 ; sp_in += 1.) { contrib = J_hadron(reaction,mech,deg_pi,deg_rho,ff_pi,ff_rho, Q_sqr,s,t,sp_out,pol_ph,sp_in); result += pow(Cabs(contrib),2.); } } } return 0.25*result; } double matrix_square_pol(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph,double sp_in, double Q_sqr, double s, double t) { double sp_out, result=0.; dcomplex contrib; for (sp_out=-.5 ; sp_out<=.5 ; sp_out += 1.) { contrib = J_hadron(reaction,mech,deg_pi,deg_rho,ff_pi,ff_rho, Q_sqr,s,t,sp_out,pol_ph,sp_in); result += pow(Cabs(contrib),2.); } return result; } double tot_response_l_Tp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double tmin, double tmax) { reaction_s = reaction; mech_s = mech; deg_pi_s = deg_pi; deg_rho_s = deg_rho; ff_pi_s = ff_pi; ff_rho_s = ff_rho; Q_sqr_s = Q_sqr; s_s = s; return int_gauss(int_response_l_Tp, tmax, tmin, 30); } double tot_response_xy_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double tmin, double tmax) { reaction_s = reaction; mech_s = mech; deg_pi_s = deg_pi; deg_rho_s = deg_rho; ff_pi_s = ff_pi; ff_rho_s = ff_rho; Q_sqr_s = Q_sqr; s_s = s; return int_gauss(int_response_xy_TLp, tmax, tmin, 30); } double int_response_l_Tp(double t) { return response_R_l_Tp(reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, Q_sqr_s, s_s, t); } double int_response_xy_TLp(double t) { return (response_R_par_TLp(reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, Q_sqr_s, s_s, t)- response_R_perp_TLp(reaction_s, mech_s, deg_pi_s, deg_rho_s, ff_pi_s, ff_rho_s, Q_sqr_s, s_s, t)); } /*************************************************************************/ /*************************************************************************/ /* */ /* e + N -> e + pi + N : RESPONSE FUNCTIONS */ /* */ /*************************************************************************/ /*************************************************************************/ /* The function response_R_T() gives the response function R_T for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_T(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result_plus = 0., result_minus = 0., unit_conv, cross, Lambda; dcomplex contr_plus, contr_minus; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { for(sp_in = -0.5; sp_in <= 0.5; sp_in += 1.0) { contr_plus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, sp_in); contr_minus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, sp_in); result_plus += pow(Cabs(contr_plus),2.); result_minus += pow(Cabs(contr_minus),2.); } } choice = 2; /* default = 2 to compare to data */ switch(choice) { case 1 : /* for the T cross section in units (microbarns / GeV^2) */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.25 * (result_plus + result_minus); break; } case 2 : /* for the T cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); /* printf("\n%e \t %e", Q_sqr, (s - pow(NU_M,2.))/Lambda ); */ unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.25 * (result_plus + result_minus); break; } case 3 : /* for the R_T response function */ { return 0.25 * (result_plus + result_minus); break; } } } /* The function response_R_L() gives the response function R_L for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_L(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result_zero = 0., unit_conv, cross, Lambda; dcomplex contr_zero; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { for(sp_in = -0.5; sp_in <= 0.5; sp_in += 1.0) { contr_zero = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, sp_in); result_zero += pow(Cabs(contr_zero),2.); } } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the L cross section in units (microbarns / GeV^2) */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result_zero; break; } case 2 : /* for the L cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result_zero; break; } case 3 : /* for the R_L response function */ { return 0.5 * result_zero; break; } } } /* The function response_R_TT() gives the response function R_TT for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_TT(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result = 0., unit_conv, cross, Lambda; dcomplex contr; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { for(sp_in = -0.5; sp_in <= 0.5; sp_in += 1.0) { contr = Cmul(J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, sp_in), Conjg(J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, sp_in) ) ); result += contr.re; } } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the TT cross section in units (microbarns / GeV^2). */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result; break; } case 2 : /* for the TT cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result; break; } case 3 : /* for the R_TT response function */ { return 0.5 * result; break; } } } /* The function response_R_TL() gives the response function R_TL for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_TL(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result = 0., unit_conv, cross, Lambda; dcomplex contr_plus, contr_minus, contr_zero; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { for(sp_in = -0.5; sp_in <= 0.5; sp_in += 1.0) { contr_plus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, sp_in); contr_minus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, sp_in); contr_zero = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, sp_in); result += Cmul(Csub(contr_plus, contr_minus), Conjg(contr_zero) ).re; } } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the TL cross section in units (microbarns / GeV^2). */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 / sqrt(2.) * result; break; } case 2 : /* for the TL cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 / sqrt(2.) * result; break; } case 3 : /* for the R_TL response function */ { return 0.5 / sqrt(2.) * result; break; } } } /* The function response_R_TLp() gives the response function R_TL' for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result = 0., unit_conv, cross, Lambda; dcomplex contr_plus, contr_minus, contr_zero; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { for(sp_in = -0.5; sp_in <= 0.5; sp_in += 1.0) { contr_plus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, sp_in); contr_minus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, sp_in); contr_zero = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, sp_in); result += Cmul(Csub(contr_plus, contr_minus), Conjg(contr_zero) ).im; } } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the TL' cross section in units (microbarns / GeV^2). */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 / sqrt(2.) * result; break; } case 2 : /* for the TL' cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 / sqrt(2.) * result; break; } case 3 : /* for the R_TL' response function */ { return 0.5 / sqrt(2.) * result; break; } } } /* The function response_R_l_Tp() gives the response function R_l_Tp for the e + p -> e + p + V process as function of the vector meson vec_mes (1 = rho, 2 = omega, 3 = phi, 4 = J/Psi) and the kinematic variables s, t and Q_sqr. */ double response_R_l_Tp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result_plus = 0., result_minus = 0., unit_conv, cross, Lambda; dcomplex contr_plus, contr_minus; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { contr_plus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, .5); contr_minus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, .5); result_plus += pow(Cabs(contr_plus),2.); result_minus += pow(Cabs(contr_minus),2.); } choice = 2; /* default = 2 to compare to data */ switch(choice) { case 1 : /* for the l_Tp cross section in units (microbarns / GeV^2) */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * (result_plus - result_minus); break; } case 2 : /* for the l_Tp cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * (result_plus - result_minus); break; } case 3 : /* for the R_l_Tp response function */ { return 0.5 * (result_plus - result_minus); break; } } } /* The function response_R_perp_T() gives the response function R_perp_T for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_perp_T(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, result = 0., unit_conv, cross, Lambda; dcomplex contr; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { contr = Cmul(J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, 0.5), Conjg(J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, -0.5))); result += 2.*contr.im; } choice = 2; /* default = 2 to compare to data */ switch(choice) { case 1 : /* for the perp_T cross section in units (microbarns / GeV^2) */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result; break; } case 2 : /* for the perp_T cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result; break; } case 3 : /* for the R_perp_T response function */ { return 0.5 * result; break; } } } /* The function response_R_perp_L() gives the response function R_perp_L for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_perp_L(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, result = 0., unit_conv, cross, Lambda; dcomplex contr; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { contr = Cmul(J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, 0.5), Conjg(J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, -0.5))); result += 2.*contr.im; } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the perp_L cross section in units (microbarns / GeV^2) */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result; break; } case 2 : /* for the perp_L cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return unit_conv * 0.5 * result; break; } case 3 : /* for the R_perp_L response function */ { return 0.5 * result; break; } } } /* The function response_R_perp_TLp() gives the response function R_perp_TL' for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_perp_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result = 0., unit_conv, cross, Lambda; dcomplex contr_plus, contr_minus, contr_zero; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { contr_plus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, .5); contr_minus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, .5); contr_zero = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, -.5); result += Cmul(Csub(contr_plus, contr_minus), Conjg(contr_zero) ).re; } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the perp_TL' cross section in units (microbarns / GeV^2). */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return -2. * unit_conv * 0.5 / sqrt(2.) * result; break; } case 2 : /* for the perp_TL' cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return -2. *unit_conv * 0.5 / sqrt(2.) * result; break; } case 3 : /* for the perp_R_TL' response function */ { return -2. * 0.5 / sqrt(2.) * result; break; } } } /* The function response_R_par_TLp() gives the response function R_par_TL'' for the virtual photon + N -> pi + N process for pion (1 = pi^+ n, 2 = pi^- p, 3 = pi^0 p) and the kinematic variables Q_sqr, s, and t. */ double response_R_par_TLp(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t) { int choice; double sp_out, sp_in, result = 0., unit_conv, cross, Lambda; dcomplex contr_plus, contr_minus, contr_zero; for(sp_out = -0.5; sp_out <= 0.5; sp_out += 1.0) { contr_plus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, +1, .5); contr_minus = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, -1, .5); contr_zero = J_hadron(reaction, mech, deg_pi, deg_rho, ff_pi, ff_rho, Q_sqr, s, t, sp_out, 0, -.5); result += Cmul(Cadd(contr_plus, contr_minus), Conjg(contr_zero) ).re; } choice = 2; /* default = 2 */ switch(choice) { case 1 : /* for the par_TL' cross section in units (microbarns / GeV^2). */ { unit_conv = 1. / (16. * PI * pow(s - pow(NU_M, 2.),2.)) * pow(0.197, 2.) * pow(10., 4.); return 2. * unit_conv * 0.5 / sqrt(2.) * result; break; } case 2 : /* for the par_TL' cross section in units (microbarns / GeV^2) (remark choice of virtual photon flux factor to compare to experimentally extracted reduced cross sections) */ { Lambda = sqrt( pow(s,2.) + pow(Q_sqr,2.) + pow(NU_M,4.) + 2. * s * Q_sqr - 2. * s * pow(NU_M,2.) + 2. * pow(NU_M,2.) * Q_sqr ); unit_conv = 1. / (16. * PI) * 1./(s - pow(NU_M, 2.)) * 1./Lambda * pow(0.197, 2.) * pow(10., 4.); return 2. *unit_conv * 0.5 / sqrt(2.) * result; break; } case 3 : /* for the R_par_TL' response function */ { return 2. * 0.5 / sqrt(2.) * result; break; } } } /*************************************************************************/ /*************************************************************************/ /* The relativistic hadronic current operator considered is given by J_hadron(). */ dcomplex J_hadron(int reaction, int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, double Q_sqr, double s, double t, double sp_out, int pol_ph, double sp_in) { switch(reaction) { case 1: { return t_vgan_ppim_regge_forward(mech, deg_pi, deg_rho, ff_pi, ff_rho, pol_ph, sp_out, sp_in, Q_sqr, s, t); break; } case 2: { return t_vgap_npip_regge_forward(mech, deg_pi, deg_rho, ff_pi, ff_rho, pol_ph, sp_out, sp_in, Q_sqr, s, t); break; } case 3: { return t_vgap_ppio_regge_forward(mech, deg_rho, pol_ph, sp_out, sp_in, Q_sqr, s, t); break; } } } /*************************************************************************/ /*************************************************************************/ /* */ /* The following functions define the hadron REGGE TRAJECTORIES. */ /* */ /*************************************************************************/ /*************************************************************************/ dcomplex pion_regge_trajectory(int deg_pi, double s, double t) { int choice_alpha; double alpha_lin, alpha, alpha_sat; dcomplex traj; choice_alpha = 1; switch(choice_alpha) { case 1: /* linear trajectory */ { alpha = ALPHAp_PI * (t - pow(PIM_M, 2.)); /* alpha = .7 * (t - pow(PIM_M, 2.)); */ break; } case 2: /* trajectory with saturation at SAT_PI */ { alpha_lin = ALPHAp_PI * (t - pow(PIM_M, 2.)); alpha_sat = SAT_PI; /* if ( alpha_lin > alpha_sat) alpha = alpha_lin; else alpha = alpha_sat; */ alpha = alpha_sat; break; } case 3: /* interpolating pion trajectory of Sergeenko, Z.Phys.C64 (1994) 315 */ { double mass_q, V_o, kappa, alpha_s, np, lam, c1, c2, c3, pt, qt, Qt, beta; mass_q = 0.231; V_o = - 0.5 / (4. * mass_q); kappa = 0.17; alpha_s = 4./3. * 0.892; np = 0.; lam = (4. * mass_q * (mass_q + V_o) - t) / (8. * kappa); c1 = 4. * np + 3.5 - alpha_s + lam; c2 = pow(np + 1., 2.) + 2. * (np + 1.) * (2. * np + 1.5 - alpha_s + lam); c3 = pow(np + 1., 2.) * (2. * np + 1.5 - alpha_s + lam) - pow(alpha_s * mass_q, 2.) / (8. * kappa); pt = - 1./3. * pow(c1, 2.) + c2; qt = 2./27. * pow(c1, 3.) - 1./3. * c1 * c2 + c3; Qt = 1./27. * pow(pt,3.) + 1./4. * pow(qt,2.); beta = acos(- qt / (2. * sqrt(- pow(pt,3.)/27.)) ); if (Qt <= 0.) alpha = 2. * sqrt(- pt/3.) * cos(beta/3.) - c1/3.; if (Qt > 0.) alpha = pow(- 0.5 * qt + sqrt(Qt), 1./3.) + pow(- 0.5 * qt - sqrt(Qt), 1./3.) - c1/3.; break; } } switch(deg_pi) /* 2 for pi+, 3 for pi- */ { case 1: /* non-degenerate trajectory */ { traj = CRmul(pow(s,alpha) / gamma_function(alpha + 1.) * PI * ALPHAp_PI / sin(PI * alpha), CRmul(0.5, Complex(1. + cos(PI * alpha),- sin(PI * alpha)) ) ); break; } case 2: /* degenerate trajectory : rotating phase */ { traj = CRmul(pow(s,alpha) / gamma_function(alpha + 1.) * PI * ALPHAp_PI / sin(PI * alpha), Complex(cos(PI * alpha), - sin(PI * alpha)) ); break; } case 3: /* degenerate trajectory : non-rotating phase */ { traj = CRmul(pow(s,alpha) / gamma_function(alpha + 1.) * PI * ALPHAp_PI / sin(PI * alpha), Complex(1., 0.) ); break; } case 4: /* single pole propagator */ { traj = Complex(1./(t - pow(PI_M, 2.) ), 0.); break; } case 5: /* degenerate trajectory : rotating phase, s - u */ { double u, Q_sqr; Q_sqr = 0.70; u = - s - t + 2. * pow(NU_M, 2.) - Q_sqr + pow(PIM_M, 2.); traj = CRmul(pow(0.5 * (s - u),alpha) / gamma_function(alpha + 1.) * PI * ALPHAp_PI / sin(PI * alpha), Complex(cos(PI * alpha), - sin(PI * alpha)) ); break; } } return traj; } dcomplex rho_regge_trajectory(int deg_rho, double s, double t) { int choice_alpha; double alpha_lin, alpha_sat, alpha; dcomplex traj; choice_alpha = 2; switch(choice_alpha) { case 1: /* linear trajectory which passes exactly through rho pole */ { alpha = 1. + ALPHAp_RHO * (t - pow(RHO_M, 2.)); break; } case 2: /* linear trajectory */ { alpha = ALPHAo_RHO + ALPHAp_RHO * t; break; } case 3: /* experimentally determined rho traj : Barnes et al., PRL37 (1976) 76 */ { alpha = 0.481 + 0.928 * t + 0.205 * pow(t, 2.); break; } case 4: /* interpolating rho trajectory of Sergeenko, Z.Phys.C64 (1994) 315 */ { double mass_q, V_o, kappa, alpha_s, np, lam, c1, c2, c3, pt, qt, Qt, beta; mass_q = 0.33; V_o = - 1.35 / (4. * mass_q); kappa = 0.145; alpha_s = 4./3. * 0.91; np = 0.; lam = (4. * mass_q * (mass_q + V_o) - t) / (8. * kappa); c1 = 4. * np + 3.5 - alpha_s + lam; c2 = pow(np + 1., 2.) + 2. * (np + 1.) * (2. * np + 1.5 - alpha_s + lam); c3 = pow(np + 1., 2.) * (2. * np + 1.5 - alpha_s + lam) - pow(alpha_s * mass_q, 2.) / (8. * kappa); pt = - 1./3. * pow(c1, 2.) + c2; qt = 2./27. * pow(c1, 3.) - 1./3. * c1 * c2 + c3; Qt = 1./27. * pow(pt,3.) + 1./4. * pow(qt,2.); beta = acos(- qt / (2. * sqrt(- pow(pt,3.)/27.)) ); if (Qt <= 0.) alpha = 2. * sqrt(- pt/3.) * cos(beta/3.) - c1/3.; if (Qt > 0.) alpha = pow(- 0.5 * qt + sqrt(Qt), 1./3.) + pow(- 0.5 * qt - sqrt(Qt), 1./3.) - c1/3.; break; } case 5: /* trajectory with saturation at SAT_RHO */ { alpha_lin = 1. + ALPHAp_RHO * (t - pow(RHO_M, 2.)); alpha_sat = SAT_RHO; /* if ( alpha_lin > alpha_sat) alpha = alpha_lin; else alpha = alpha_sat; */ alpha = alpha_sat; break; } } switch(deg_rho) /* 2 for pi+, 3 for pi- */ { case 1: /* non-degenerate trajectory */ { traj = CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_RHO / sin(PI * alpha), Complex(-1. + cos(PI * alpha), - sin(PI * alpha)) ); break; } case 2: /* degenerate trajectory : rotating phase */ { traj = CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * PI * ALPHAp_RHO / sin(PI * alpha), Complex(cos(PI * alpha), - sin(PI * alpha)) ); break; } case 3: /* degenerate trajectory : non-rotating phase */ { traj = CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * PI * ALPHAp_RHO / sin(PI * alpha), Complex(- 1., 0.) ); break; } case 4: /* single pole propagator */ { traj = Complex(1./(t - pow(RHO_M, 2.) ), 0.); break; } } return traj; } dcomplex omega_regge_trajectory(double s, double t, double q22) { int choice_alpha, deg; double alpha; choice_alpha = 2; switch(choice_alpha) { case 1: /* linear trajectory which passes exactly through omega pole */ { alpha = 1. + ALPHAp_OMEGA * (t - pow(OMEGA_M, 2.)); break; } case 2: /* linear trajectory */ { alpha = ALPHAo_OMEGA + ALPHAp_OMEGA * t; break; } case 3: /* interpolating omega trajectory of Sergeenko, Z.Phys.C64 (1994) 315 */ { double mass_q, V_o, kappa, alpha_s, np, lam, c1, c2, c3, pt, qt, Qt, beta; mass_q = 0.33; V_o = - 1.1 / (4. * mass_q); kappa = 0.13; alpha_s = 4./3. * 0.91; np = 0.; lam = (4. * mass_q * (mass_q + V_o) - t) / (8. * kappa); c1 = 4. * np + 3.5 - alpha_s + lam; c2 = pow(np + 1., 2.) + 2. * (np + 1.) * (2. * np + 1.5 - alpha_s + lam); c3 = pow(np + 1., 2.) * (2. * np + 1.5 - alpha_s + lam) - pow(alpha_s * mass_q, 2.) / (8. * kappa); pt = - 1./3. * pow(c1, 2.) + c2; qt = 2./27. * pow(c1, 3.) - 1./3. * c1 * c2 + c3; Qt = 1./27. * pow(pt,3.) + 1./4. * pow(qt,2.); beta = acos(- qt / (2. * sqrt(- pow(pt,3.)/27.)) ); if (Qt <= 0.) alpha = 2. * sqrt(- pt/3.) * cos(beta/3.) - c1/3.; if (Qt > 0.) alpha = pow(- 0.5 * qt + sqrt(Qt), 1./3.) + pow(- 0.5 * qt - sqrt(Qt), 1./3.) - c1/3.; break; } } deg = 1; switch(deg) { case 1: /* non-degenerate trajectory !!! */ { /* return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_OMEGA / sin(PI * alpha), Complex(-1. + cos(PI * alpha), - sin(PI * alpha)) );*/ /* return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_OMEGA / sin(PI * alpha), Complex(-1. + (1. + q22/.55)*cos(PI * alpha), - (1. + q22/.55)*sin(PI * alpha)) );*/ /* return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_OMEGA / sin(PI * alpha), Complex(-1.+cos(PI*alpha)/(1.+q22/.5), sin(PI*alpha)/(1.+q22/.5)) );*/ /* return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_OMEGA / sin(PI * alpha), Complex(-1.+cos(PI*(alpha-.8*q22)), sin(PI*(alpha-.8*q22))) );*/ return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_OMEGA / sin(PI * alpha), Complex(-1./(1. + q22/.5) + cos(PI * alpha), sin(PI * alpha)) ); break; } case 2: /* degenerate trajectory */ { return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * PI * ALPHAp_OMEGA / sin(PI * alpha), Complex(cos(PI * alpha), - sin(PI * alpha)) ); break; } } } dcomplex A1_regge_trajectory(double s, double t) { int deg = 2; double alpha; alpha = 1. + ALPHAp_A1 * (t - pow(A1_M, 2.)); switch(deg) { case 1: /* non-degenerate trajectory */ { return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_A1 / sin(PI * alpha), Complex(- 1. + cos(PI * alpha), - sin(PI * alpha)) ); break; } case 2: /* degenerate trajectory */ { return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * PI * ALPHAp_A1 / sin(PI * alpha), Complex(cos(PI * alpha), - sin(PI * alpha)) ); break; } } } dcomplex B1_regge_trajectory(double s, double t) { int deg = 2; double alpha; /* alpha = 1. + ALPHAp_B1 * (t - pow(B1_M, 2.));*/ /* same trajectory as pion : */ alpha = ALPHAp_PI * (t - pow(PI0_M, 2.)); switch(deg) { case 1: /* non-degenerate trajectory */ { return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * 0.5 * PI * ALPHAp_PI / sin(PI * alpha), Complex(- 1. + cos(PI * alpha), - sin(PI * alpha)) ); break; } case 2: /* degenerate trajectory */ { return CRmul(pow(s,alpha - 1.) / gamma_function(alpha) * PI * ALPHAp_PI / sin(PI * alpha), Complex(cos(PI * alpha), - sin(PI * alpha)) ); break; } } } /*************************************************************************/ dcomplex nucleon_regge_trajectory(double s, double u) { int deg = 3; double alpha; /* alpha = 0.5 + ALPHAp_N * (u - pow(NU_M, 2.)); */ alpha = -0.35 + 0.97 * u; switch(deg) { case 1: /* degenerate trajectory */ { return CRmul(pow(s,alpha - 0.5) / gamma_function(alpha + 0.5) * PI * ALPHAp_N / sin(PI * (alpha + 0.5)), Complex(cos(PI * (alpha + 0.5)), - sin(PI * (alpha + 0.5)) ) ); break; } case 2: /* degenerate trajectory : test possibility */ { return CRmul(pow(2. * s + u - 2. * pow(NU_M,2.) - pow(PI_M,2.), alpha - 0.5) * 1. / gamma_function(alpha + 0.5) * PI * ALPHAp_N / sin(PI * (alpha + 0.5)), Complex(cos(PI * (alpha + 0.5)), - sin(PI * (alpha + 0.5)) ) ); break; } case 3: /* non-degenerate trajectory */ { return CRmul(pow(s,alpha - 0.5) / gamma_function(alpha + 0.5) * 0.5 * PI * ALPHAp_N / sin(PI * (alpha - 0.5)), Complex(1. + cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } } } dcomplex delta_regge_trajectory(double s, double u) { int deg = 1; double alpha; /* alpha = 1.5 + ALPHAp_DEL * (u - pow(DEL_M, 2.)); */ alpha = 0.1 + 0.93 * u; switch(deg) { case 1: /* degenerate trajectory */ { return CRmul(pow(s,alpha - 1.5) / gamma_function(alpha + 0.5) * PI * ALPHAp_DEL / sin(PI * (alpha - 0.5)), Complex(cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } case 2: /* degenerate trajectory : test possibility */ { return CRmul(pow(s,alpha - 1.5) / gamma_function(alpha - 0.5) * PI * ALPHAp_DEL / sin(PI * (alpha - 0.5)), Complex(cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } case 3: /* non-degenerate trajectory */ { return CRmul(pow(s,alpha - 1.5) / gamma_function(alpha + 0.5) * 0.5 * PI * ALPHAp_DEL / sin(PI * (alpha - .5)), Complex(- 1. + cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } case 4: /* non-degenerate trajectory : second possibility */ { return CRmul(pow(s,alpha - 1.5) / gamma_function(alpha - 0.5) * 0.5 * PI * ALPHAp_DEL / sin(PI * (alpha - .5)), Complex(- 1. + cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } } } dcomplex d13_regge_trajectory(double s, double u) { int deg = 2; double alpha; /* alpha = 1.5 + ALPHAp_d13 * (u - pow(M_d13, 2.)); */ alpha = -0.5 + 0.87 * u; switch(deg) { case 1: /* degenerate trajectory */ { return CRmul(pow(s,alpha - 1.5) / gamma_function(alpha + 0.5) * PI * ALPHAp_d13 / sin(PI * (alpha - 0.5)), Complex(cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } case 2: /* non-degenerate trajectory */ { return CRmul(pow(s,alpha - 1.5) / gamma_function(alpha + 0.5) * 0.5 * PI * ALPHAp_d13 / sin(PI * (alpha - .5)), Complex(- 1. + cos(PI * (alpha - 0.5)), - sin(PI * (alpha - 0.5)) ) ); break; } } } /*************************************************************************/ /*************************************************************************/ /* */ /* The following functions define the FORM FACTORS that are needed. */ /* */ /*************************************************************************/ /*************************************************************************/ double pion_emformfactor(int ff_pi, double mt) { switch(ff_pi) { case 1 : /* parametrization of bebek et al., PRD17 (1978) 1693. */ { return 1./(1. + mt/0.462); break; } case 2 : /* monopole at large Q_sqr, correct charge radius */ { double a; a = 2./pi_msc - 1.885; return (1. + a * mt) / pow(1. + mt/pi_msc, 2.); break; } case 3 : /* monopole with mass scale as input */ { return 1./(1. + mt/pi_msc); break; } } } double rhopigamma_formfactor(int ff_rho, double mt) { switch(ff_rho) { case 1 : { return pion_emformfactor(1, mt); break; } case 2 : { return pion_emformfactor(2, mt); break; } case 3 : /* monopole with mass scale as input */ { return 1./(1. + mt/rho_msc); break; } case 4 : { return 1./(1. + mt/2.); break; } case 5 : { return 1.; break; } } } double ome_ff(double mt) { return 1./(1. + mt/ome_msc); } double rho_ff(double mt) { return 1./(1. + mt/rho_msc); } double b_ff(double mt) { return 1./(1. + mt/b_msc); } double nucleon_isovf1_formfactor(double mt) { double M_vec, f1, ge, gm, ffh1, ffh2, cut_off, ff_interpol; M_vec = 0.843; ge = 1. / pow(1. + mt / pow(M_vec, 2.), 2.); gm = (1. + 3.70) * ge; f1 = ( mt / pow(2. * NU_M, 2.) * gm + ge ) / ( 1. + mt / pow(2. * NU_M, 2.) ); cut_off = 1.5; ffh1 = pow( pow(cut_off,2.) / (pow(cut_off,2.) + mt), 2.); ffh2 = pow(cut_off,4.) / (pow(cut_off,4.) + pow(mt,2.)); ff_interpol = (1. + 0.5 * 5. * mt)/(1. + 5. * mt + 5. * pow(mt,3.)); return f1; } double nucleon_isovf2_formfactor(double mt) { double M_vec, f2, ge, gm, ffh1, ffh2, cut_off, ff_interpol; M_vec = 0.843; ge = 1. / pow(1. + mt / pow(M_vec, 2.), 2.); gm = (1. + 3.70) * ge; f2 = ( gm - ge ) / ( 1. + mt / pow(2. * NU_M, 2.) ); cut_off = 1.5; ffh1 = pow( pow(cut_off,2.) / (pow(cut_off,2.) + mt), 2.); ffh2 = pow(cut_off,4.) / (pow(cut_off,4.) + pow(mt,2.)); ff_interpol = (1. + 0.5 * 5. * mt)/(1. + 5. * mt + 5. * pow(mt,3.)); return f2; } double nucleon_isos_formfactor(double mt) { double M_vec, f1, ge, gm, ffh1, ffh2, cut_off, ff_interpol; M_vec = 0.843; ge = 1. / pow(1. + mt / pow(M_vec, 2.), 2.); gm = (1. - 0.12) * ge; f1 = ( mt / pow(2. * NU_M, 2.) * gm + ge ) / ( 1. + mt / pow(2. * NU_M, 2.) ); cut_off = 1.5; ffh1 = pow( pow(cut_off,2.) / (pow(cut_off,2.) + mt), 2.); ffh2 = pow(cut_off,4.) / (pow(cut_off,4.) + pow(mt,2.)); ff_interpol = (1. + 0.5 * 5. * mt)/(1. + 5. * mt + 5. * pow(mt,3.)); return f1; } double nucleon_axialformfactor(double mt) { return 1.255 / pow(1. + mt / pow(1.03, 2.), 2.); } double unucleon_formfactor(double mom_sqr) { double u; /* u = mom_sqr; */ u = 0; return 2. * pow( pow(LAM_MNN,2.) - pow(NU_M,2.), 2.) / ( pow( pow(LAM_MNN,2.) - u, 2.) + pow( pow(LAM_MNN,2.) - pow(NU_M,2.), 2.) ); } double udelta_formfactor(double mom_sqr) { double u; /* u = mom_sqr; */ u = 0; return 2. * pow( pow(LAM_MNDEL,2.) - pow(DEL_M,2.), 2.) / ( pow( pow(LAM_MNDEL,2.) - u, 2.) + pow( pow(LAM_MNDEL,2.) - pow(DEL_M,2.), 2.) ); } double ud13_formfactor(double mom_sqr) { double u; /* u = mom_sqr; */ u = 0; return 2. * pow( pow(LAM_MNd13,2.) - pow(M_d13,2.), 2.) / ( pow( pow(LAM_MNd13,2.) - u, 2.) + pow( pow(LAM_MNd13,2.) - pow(M_d13,2.), 2.) ); } /*************************************************************************/ /*************************************************************************/ /* */ /* The following amplitudes are for the (e, e' p pi_minus) reaction. */ /* */ /*************************************************************************/ /*************************************************************************/ dcomplex t_vgan_ppim_regge_forward(int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t) { int mu, lambda, nu, alpha, beta, off_shell; double ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, pi_th, cos_th, po_s, po_u, E_u, u, E_in, E_out, norm_in, norm_out, nucleon_isov_ff, nucleon_axff, isov_emff, isov_axialff; dcomplex contact, pion, gauge_corr, pion_gaugeinv, temp_result, rhopiga, A1piga, mom_times_eps4; vec pol_ph_left, pol_ph_right, pol_ph_long, k_ga, p_pi, p_in, p_out, pi_s, pi_u; fvec k4_ga, p4_pi, p_s, p_u, diff, mom, pol4_ph; spinor spinor_p_in, spinor_p_out; spinor_mat contact_vertex_times_eps4, piNN_vertex, dirac_uN, pauli_uN, uNU_vertex, kr_vertex, pauli, pauli_incr, rhoNN_vertex, rhoNN_matrix, A1NN_matrix; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); k_ga = Vpolar(ga_mom_cm, 0., 0.); k4_ga = V4ini(Complex(ga_en_cm,0.), k_ga); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); cos_th = (t + Q_sqr - pow(PI_M,2.) + 2. * ga_en_cm * pi_en) / (2. * ga_mom_cm * pi_mom_cm); if ((cos_th < -1.) || (cos_th > 1.)) return Complex(0., 0.); pi_th = acos(cos_th); p_pi = Vpolar(pi_mom_cm, pi_th, 0.); p4_pi = V4ini(Complex(pi_en,0.), p_pi); p_in = VRmul(k_ga, - 1.0); p_out = VRmul(p_pi,- 1.0); E_in = sqrt( pow( Vnorm(k_ga), 2.) + pow(NU_M,2.) ); E_out = sqrt( pow( Vnorm(p_pi), 2.) + pow(NU_M,2.) ); pi_s = Vadd(p_out, p_pi); po_s = sqrt(s); p_s = V4ini(Complex(po_s, 0.), pi_s); pi_u = Vsub(p_out, k_ga); po_u = E_out - ga_en_cm; p_u = V4ini(Complex(po_u, 0.), pi_u); E_u = sqrt( pow( Vnorm(pi_u), 2.) + pow(NU_M,2.) ); u = 2. * pow(NU_M,2.) + pow(PIM_M,2.) - Q_sqr - s - t; spinor_p_out = spinor_pos(p_out, NU_M, sp_out); spinor_p_in = spinor_pos(p_in, NU_M, sp_in); norm_in = sqrt(E_in + NU_M); norm_out = sqrt(E_out + NU_M); diff = V4sub(k4_ga, p4_pi); mom = V4sub(V4Rmul(p4_pi, 2.), k4_ga); switch(pol_ph) { case -1 : { pol_ph_left = Vini( Complex(1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0.,0.), pol_ph_left); break; } case 0 : { pol_ph_long = Vini( Complex(0., 0.), Complex(0., 0.), Complex(ga_en_cm/sqrt(Q_sqr), 0.) ); pol4_ph = V4ini(Complex(ga_mom_cm/sqrt(Q_sqr), 0.), pol_ph_long); /* pol4_ph = V4ini(Complex(0., 0.), Vini(Complex(0.,0.),Complex(0.,0.), Complex(sqrt(Q_sqr)/ga_en_cm,0.)) ); */ break; } case 1 : { pol_ph_right = Vini( Complex(- 1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0., 0.), pol_ph_right); break; } } /**************************************/ /* */ /* PION exchange contribution */ /* */ /**************************************/ mom_times_eps4 = V4mul(mom, pol4_ph); piNN_vertex = SMCmul(SMCmul(dirac_gamma5(), Complex(2. * NU_M, 0.) ), Complex(F_PINN/PI_M, 0.) ); pion = Cmul(Cmul(Complex(0., - sqrt(2.) * norm_in * norm_out * ELEC), Cmul(pion_regge_trajectory(deg_pi, s, t), mom_times_eps4) ), spinleft_mat_spinright(spinor_p_out, piNN_vertex, spinor_p_in) ); off_shell = 1; switch(off_shell) { case 1 : /* PS coupling for the gauge correction terms */ { dirac_uN = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) dirac_uN = SMadd(dirac_uN, SMCmul(dirac_gamma(mu), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ); uNU_vertex = SMCmul(SMmul(dirac_uN, SMmul(SMadd(fvec_slash(p_u), SMCmul(unit_spinor_mat(), Complex(NU_M, 0.) ) ), dirac_gamma5() ) ), Complex(F_PINN/PIM_M * 2. * NU_M * (t - pow(PIM_M,2.))/(u - pow(NU_M,2.)) , 0.) ); gauge_corr = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * ELEC), pion_regge_trajectory(deg_pi, s, t) ), spinleft_mat_spinright(spinor_p_out, uNU_vertex, spinor_p_in) ); break; } case 2 : /* PV coupling for the gauge correction terms */ { dirac_uN = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) dirac_uN = SMadd(dirac_uN, SMCmul(dirac_gamma(mu), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ); uNU_vertex = SMCmul(SMmul(dirac_uN, SMmul(SMadd(fvec_slash(p_u), SMCmul(unit_spinor_mat(), Complex(NU_M, 0.) ) ), SMmul(fvec_slash(p4_pi), dirac_gamma5() ) ) ), Complex(- F_PINN/PIM_M * (t - pow(PIM_M,2.))/(u - pow(NU_M,2.)) , 0.) ); kr_vertex = SMCmul(SMmul(dirac_uN, dirac_gamma5()), Complex(- F_PINN/PIM_M * (t - pow(PIM_M,2.)), 0.) ); gauge_corr = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * ELEC), pion_regge_trajectory(deg_pi, s, t) ), spinleft_mat_spinright(spinor_p_out, SMadd(uNU_vertex, kr_vertex), spinor_p_in) ); break; } } pion_gaugeinv = Cadd(pion, gauge_corr); /**************************************/ /* */ /* RHO exchange contribution */ /* */ /**************************************/ if ((mech != 1) && (mech != 3)) { rhoNN_matrix = zero_spinor_mat(); for(beta = 0; beta <= 3; beta++) { pauli = zero_spinor_mat(); for(lambda = 0; lambda <= 3; lambda++) { pauli_incr = SMCmul(dirac_sigma(beta, lambda), Cmul(diff.fv[lambda], Complex(0.0,metric(lambda,lambda) * KAPPA_RHO /(2. * NU_M)) ) ); pauli = SMadd(pauli, pauli_incr); } rhoNN_vertex = SMCmul(SMadd(dirac_gamma(beta), pauli), Complex(G_RHONN, 0.) ); temp_result = Complex(0.,0.); for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { for(alpha = 0; alpha <= 3; alpha++) { temp_result = Cadd(temp_result, CRmul(antisymm_epsilon(nu,mu,alpha,beta), Cmul(Cmul(k4_ga.fv[nu], diff.fv[alpha]), pol4_ph.fv[mu]) ) ); } } } rhoNN_matrix = SMadd(rhoNN_matrix, SMCmul(rhoNN_vertex, temp_result) ); } rhopiga = Cmul(CRmul(sqrt(2.) * norm_in * norm_out * G_RHOCPIGA * ELEC / PIM_M, rho_regge_trajectory(deg_rho, s, t) ), spinleft_mat_spinright(spinor_p_out, rhoNN_matrix, spinor_p_in) ); } /**************************************/ /* */ /* A1 exchange contribution */ /* */ /**************************************/ if ((mech == 5) || (mech == 6)) { A1NN_matrix = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { A1NN_matrix = SMadd(A1NN_matrix, SMadd(SMCmul(SMmul(dirac_gamma(mu), dirac_gamma5()), Cmul(V4mul(k4_ga, diff), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ), SMCmul(SMmul(dirac_gamma(mu), dirac_gamma5()), CRmul(- metric(mu,mu), Cmul(V4mul(pol4_ph, diff), k4_ga.fv[mu]) ) ) ) ); } A1piga = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * G_A1NN * ELEC * 2. * G_A1PIGA), A1_regge_trajectory(s, t) ), spinleft_mat_spinright(spinor_p_out, A1NN_matrix, spinor_p_in) ); } switch(mech) { case 1 : /* pion pole exchange */ { return pion; break; } case 2 : /* rho exchange */ { double form_rho; nucleon_isov_ff = nucleon_isovf1_formfactor(-t); form_rho = rhopigamma_formfactor(ff_rho, Q_sqr); return CRmul(form_rho, rhopiga); break; } case 3 : /* gauge invariant pion exchange */ { double form_pi; form_pi = pion_emformfactor(ff_pi, Q_sqr); return CRmul(form_pi, pion_gaugeinv); break; } case 4 : /* gauge invariant pion exchange + rho exchange */ { double form_pi, form_rho; form_pi = pion_emformfactor(ff_pi, Q_sqr); form_rho = rhopigamma_formfactor(ff_rho, Q_sqr); return Cadd(CRmul(form_pi, pion_gaugeinv), CRmul(form_rho, rhopiga) ); break; } case 5 : /* gauge invariant pion exchange + rho exchange + A1 exchange */ { return Cadd(Cadd(pion_gaugeinv, rhopiga), A1piga ); break; } case 6 : /* A1 exchange */ { return A1piga; break; } } } /*************************************************************************/ /*************************************************************************/ /* */ /* The following t matrices are for the (e, e' n pi_plus) reaction. */ /* */ /*************************************************************************/ /*************************************************************************/ dcomplex t_vgap_npip_regge_forward(int mech, int deg_pi, int deg_rho, int ff_pi, int ff_rho, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t) { int mu, lambda, nu, alpha, beta, off_shell; double ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, pi_th, cos_th, po_s, po_u, E_u, E_in, E_out, norm_in, norm_out, nucleon_isov_ff, nucleon_axff, isov_emff, isov_axialff; dcomplex contact, pion, gauge_corr, pion_gaugeinv, temp_result, rhopiga, A1piga, mom_times_eps4; vec pol_ph_left, pol_ph_right, pol_ph_long, k_ga, p_pi, p_in, p_out, pi_s, pi_u; fvec k4_ga, p4_pi, p_s, diff, mom, pol4_ph; spinor spinor_p_in, spinor_p_out; spinor_mat contact_vertex_times_eps4, piNN_vertex, dirac_sN, pauli_sN, sNU_vertex, kr_vertex, pauli, pauli_incr, rhoNN_vertex, rhoNN_matrix, A1NN_matrix; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); k_ga = Vpolar(ga_mom_cm, 0., 0.); k4_ga = V4ini(Complex(ga_en_cm,0.), k_ga); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); cos_th = (t + Q_sqr - pow(PI_M,2.) + 2. * ga_en_cm * pi_en) / (2. * ga_mom_cm * pi_mom_cm); if ((cos_th < -1.) || (cos_th > 1.)) { /* printf("\n Problem cos_th > 1 : %e, for W = %f and Q^2 = %f", cos_th, sqrt(s), Q_sqr); */ cos_th = 1.; return Complex(0., 0.); } pi_th = acos(cos_th); p_pi = Vpolar(pi_mom_cm, pi_th, 0.); p4_pi = V4ini(Complex(pi_en,0.), p_pi); p_in = VRmul(k_ga, - 1.0); p_out = VRmul(p_pi,- 1.0); E_in = sqrt( pow( Vnorm(k_ga), 2.) + pow(NU_M,2.) ); E_out = sqrt( pow( Vnorm(p_pi), 2.) + pow(NU_M,2.) ); pi_s = Vadd(p_out, p_pi); po_s = sqrt(s); p_s = V4ini(Complex(po_s, 0.), pi_s); pi_u = Vsub(p_out, k_ga); po_u = E_out - ga_en_cm; E_u = sqrt( pow( Vnorm(pi_u), 2.) + pow(NU_M,2.) ); spinor_p_out = spinor_pos(p_out, NU_M, sp_out); spinor_p_in = spinor_pos(p_in, NU_M, sp_in); norm_in = sqrt(E_in + NU_M); norm_out = sqrt(E_out + NU_M); diff = V4sub(k4_ga, p4_pi); mom = V4sub(V4Rmul(p4_pi, 2.), k4_ga); switch(pol_ph) { case -1 : { pol_ph_left = Vini( Complex(1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0.,0.), pol_ph_left); break; } case 0 : { pol_ph_long = Vini( Complex(0., 0.), Complex(0., 0.), Complex(ga_en_cm/sqrt(Q_sqr), 0.) ); pol4_ph = V4ini(Complex(ga_mom_cm/sqrt(Q_sqr), 0.), pol_ph_long); /* pol4_ph = V4ini(Complex(0., 0.), Vini(Complex(0.,0.),Complex(0.,0.), Complex(sqrt(Q_sqr)/ga_en_cm,0.)) ); */ break; } case 1 : { pol_ph_right = Vini( Complex(- 1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0., 0.), pol_ph_right); break; } } /**************************************/ /* */ /* PION exchange contribution */ /* */ /**************************************/ dirac_sN = zero_spinor_mat(); pauli_sN = zero_spinor_mat(); mom_times_eps4 = V4mul(mom, pol4_ph); piNN_vertex = SMCmul(SMCmul(dirac_gamma5(), Complex(2. * NU_M, 0.) ), Complex(F_PINN/PI_M, 0.) ); pion = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * ELEC), Cmul(pion_regge_trajectory(deg_pi, s, t), mom_times_eps4) ), spinleft_mat_spinright(spinor_p_out, piNN_vertex, spinor_p_in) ); off_shell = 1; switch(off_shell) { case 1 : /* PS coupling for the gauge correction terms */ { dirac_sN = zero_spinor_mat(); pauli_sN = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) dirac_sN = SMadd(dirac_sN, SMCmul(dirac_gamma(mu), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ); if (mech == 5) { for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { pauli_sN = SMadd(pauli_sN, SMCmul(dirac_sigma(mu, nu), Cmul(Cmul(CRmul(metric(mu,mu), pol4_ph.fv[mu]), k4_ga.fv[nu] ), Complex(0.0,metric(nu,nu) * F2_p /(2. * NU_M)) ) ) ); } } } sNU_vertex = SMCmul(SMmul(dirac_gamma5(), SMmul(SMadd(fvec_slash(p_s), SMCmul(unit_spinor_mat(), Complex(NU_M, 0.) ) ), SMadd(dirac_sN, pauli_sN) ) ), Complex(F_PINN/PIM_M * 2. * NU_M * (t - pow(PIM_M,2.))/(s - pow(NU_M,2.)) , 0.) ); gauge_corr = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * ELEC), pion_regge_trajectory(deg_pi, s, t) ), spinleft_mat_spinright(spinor_p_out, sNU_vertex, spinor_p_in) ); break; } case 2 : /* PV coupling for the gauge correction terms */ { dirac_sN = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) dirac_sN = SMadd(dirac_sN, SMCmul(dirac_gamma(mu), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ); sNU_vertex = SMCmul(SMmul(SMmul(fvec_slash(p4_pi), dirac_gamma5()), SMmul(SMadd(fvec_slash(p_s), SMCmul(unit_spinor_mat(), Complex(NU_M, 0.) ) ), dirac_sN ) ), Complex(- F_PINN/PIM_M * (t - pow(PIM_M,2.))/(s - pow(NU_M,2.)) , 0.) ); kr_vertex = SMCmul(SMmul(dirac_sN, dirac_gamma5()), Complex(F_PINN/PIM_M * (t - pow(PIM_M,2.)), 0.) ); gauge_corr = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * ELEC), pion_regge_trajectory(deg_pi, s, t) ), spinleft_mat_spinright(spinor_p_out, SMadd(sNU_vertex, kr_vertex), spinor_p_in) ); break; } } /***********************************************************/ /* HERE, WE ADD A REAL CONSTANT BACKGROUND TERM */ /* TO THE PION POLE (Following Mack et al's prescription) */ /***********************************************************/ /* printf("\n hello1 %lf %lf %lf %lf",pion.re,pion.im,back_s.re, back_s.im);*/ /***********************************************************/ pion = Cadd(back_s,pion); /***********************************************************/ /* printf("\n hello2 %lf %lf %lf %lf",pion.re,pion.im,back_s.re,back_s.im);*/ pion_gaugeinv = Cadd(pion, gauge_corr); /**************************************/ /* */ /* RHO exchange contribution */ /* */ /**************************************/ if ((mech != 1) && (mech != 3)) { rhoNN_matrix = zero_spinor_mat(); for(beta = 0; beta <= 3; beta++) { pauli = zero_spinor_mat(); for(lambda = 0; lambda <= 3; lambda++) { pauli_incr = SMCmul(dirac_sigma(beta, lambda), Cmul(diff.fv[lambda], Complex(0.0,metric(lambda,lambda) * KAPPA_RHO /(2. * NU_M)) ) ); pauli = SMadd(pauli, pauli_incr); } rhoNN_vertex = SMCmul(SMadd(dirac_gamma(beta), pauli), Complex(G_RHONN, 0.) ); temp_result = Complex(0.,0.); for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { for(alpha = 0; alpha <= 3; alpha++) { temp_result = Cadd(temp_result, CRmul(antisymm_epsilon(nu,mu,alpha,beta), Cmul(Cmul(k4_ga.fv[nu], diff.fv[alpha]), pol4_ph.fv[mu] ) ) ); } } } rhoNN_matrix = SMadd(rhoNN_matrix, SMCmul(rhoNN_vertex, temp_result) ); } rhopiga = Cmul(CRmul(sqrt(2.) * norm_in * norm_out * G_RHOCPIGA * ELEC / PIM_M, rho_regge_trajectory(deg_rho, s, t) ), spinleft_mat_spinright(spinor_p_out, rhoNN_matrix, spinor_p_in) ); } /**************************************/ /* */ /* A1 exchange contribution */ /* */ /**************************************/ if ((mech == 6) || (mech == 7)) { A1NN_matrix = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { A1NN_matrix = SMadd(A1NN_matrix, SMadd(SMCmul(SMmul(dirac_gamma(mu), dirac_gamma5()), Cmul(V4mul(k4_ga, diff), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ), SMCmul(SMmul(dirac_gamma(mu), dirac_gamma5()), CRmul(- metric(mu,mu), Cmul(V4mul(pol4_ph, diff), k4_ga.fv[mu]) ) ) ) ); } A1piga = Cmul(Cmul(Complex(0., - sqrt(2.) * norm_in * norm_out * G_A1NN * ELEC * 2. * G_A1PIGA), A1_regge_trajectory(s, t) ), spinleft_mat_spinright(spinor_p_out, A1NN_matrix, spinor_p_in) ); } switch(mech) { case 1 : /* pion pole exchange */ { return pion; break; } case 2 : /* rho exchange */ { double form_rho; nucleon_isov_ff = nucleon_isovf1_formfactor(-t); form_rho = rhopigamma_formfactor(ff_rho, Q_sqr); return CRmul(form_rho, rhopiga); break; } case 3 : /* gauge invariant pion exchange */ { double form_pi; form_pi = pion_emformfactor(ff_pi, Q_sqr); return CRmul(form_pi, pion_gaugeinv); break; } case 4 : /* gauge invariant pion exchange + rho exchange */ { double form_pi, form_rho; form_pi = pion_emformfactor(ff_pi, Q_sqr); form_rho = rhopigamma_formfactor(ff_rho, Q_sqr); return Cadd(CRmul(form_pi, pion_gaugeinv), CRmul(form_rho, rhopiga) ); break; } case 5 : /* gauge invariant pion exchange (+ magnetic s-channel N) + rho exchange */ { double form_pi, form_rho; form_pi = pion_emformfactor(ff_pi, Q_sqr); form_rho = rhopigamma_formfactor(ff_rho, Q_sqr); return Cadd(CRmul(form_pi, pion_gaugeinv), CRmul(form_rho, rhopiga) ); break; } case 6 : /* gauge invariant pion exchange + rho exchange + A1 exchange */ { double form_pi; form_pi = pion_emformfactor(ff_pi, Q_sqr); return CRmul(form_pi, Cadd(Cadd(pion_gaugeinv, rhopiga), A1piga ) ); break; } case 7 : /* A1 exchange */ { return A1piga; break; } } } /*************************************************************************/ dcomplex t_vgap_npip_regge_backward(int mech, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t) { int mu, kappa, lambda, sigma, rho, tau, nu, alpha, beta, prop; double ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, pi_th, po_s, po_u, E_u, u, E_in, E_out, norm_in, norm_out, nucleon_isov_ff, nucleon_axff, isov_emff, isov_axialff; dcomplex nucleon, vertex1, vertex2, delta_u, d13_u, mom_times_eps4; vec pol_ph_left, pol_ph_right, pol_ph_long, k_ga, p_pi, p_in, p_out, pi_s, pi_u; fvec k4_ga, p4_pi, p4_u, p4_out, p4_av, diff, mom, pol4_ph; spinor spinor_p_in, spinor_p_out; spinor_mat pauli, N_vertex, piNN_vertex, delta_propagator_num, coupling1, coupling2, coupling_magn, coupling_elec, coupling_test, em_vertex, delta_vertex, delta_vertex_incr, d13_propagator_num, coupling1_d13, coupling2_d13, couplingm_d13, couplinge_d13, d13_vertex, d13_vertex_incr; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); k_ga = Vpolar(ga_mom_cm, 0., 0.); k4_ga = V4ini(Complex(ga_en_cm,0.), k_ga); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); pi_th = acos( (t + Q_sqr - pow(PI_M,2.) + 2. * ga_en_cm * pi_en) / (2. * ga_mom_cm * pi_mom_cm) ); p_pi = Vpolar(pi_mom_cm, pi_th, 0.); p4_pi = V4ini(Complex(pi_en,0.), p_pi); p_in = VRmul(k_ga, - 1.0); p_out = VRmul(p_pi,- 1.0); E_in = sqrt( pow( Vnorm(k_ga), 2.) + pow(NU_M,2.) ); E_out = sqrt( pow( Vnorm(p_pi), 2.) + pow(NU_M,2.) ); p4_out = V4ini(Complex(E_out,0.), p_out); pi_s = Vadd(p_out, p_pi); po_s = sqrt(s); pi_u = Vsub(p_out, k_ga); po_u = E_out - ga_en_cm; p4_u = V4ini(Complex(po_u, 0.), pi_u); p4_av = V4Rmul(V4add(p4_out, p4_u), 0.5); E_u = sqrt( pow( Vnorm(pi_u), 2.) + pow(NU_M,2.) ); u = 2. * pow(NU_M,2.) + pow(PIM_M,2.) - Q_sqr - s - t; spinor_p_out = spinor_pos(p_out, NU_M, sp_out); spinor_p_in = spinor_pos(p_in, NU_M, sp_in); norm_in = sqrt(E_in + NU_M); norm_out = sqrt(E_out + NU_M); diff = V4sub(k4_ga, p4_pi); mom = V4sub(V4Rmul(p4_pi, 2.), k4_ga); switch(pol_ph) { case -1 : { pol_ph_left = Vini( Complex(1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0.,0.), pol_ph_left); break; } case 0 : { pol_ph_long = Vini( Complex(0., 0.), Complex(0., 0.), Complex(ga_en_cm/sqrt(Q_sqr), 0.) ); pol4_ph = V4ini(Complex(ga_mom_cm/sqrt(Q_sqr), 0.), pol_ph_long); /* pol4_ph = V4ini(Complex(0., 0.), Vini(Complex(0.,0.),Complex(0.,0.), Complex(sqrt(Q_sqr)/ga_en_cm,0.)) ); */ break; } case 1 : { pol_ph_right = Vini( Complex(- 1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0., 0.), pol_ph_right); break; } } /**************************************/ /* */ /* NUCLEON exchange contribution */ /* */ /**************************************/ pauli = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { pauli = SMadd(pauli, SMCmul(dirac_sigma(mu, nu), Cmul(Cmul(CRmul(metric(mu,mu), pol4_ph.fv[mu]), k4_ga.fv[nu] ), Complex(0.0,metric(nu,nu) * N_MAGN /(2. * NU_M)) ) ) ); } } piNN_vertex = SMCmul(SMadd(SMCmul(dirac_gamma5(), Complex(2. * NU_M * PSPV_PARAM, 0.) ), SMCmul(SMmul(fvec_slash(V4Rmul(p4_pi, - 1.) ), dirac_gamma5() ), Complex(1. - PSPV_PARAM, 0.) ) ), Complex(F_PINN/PI_M, 0.) ); N_vertex = SMmul(pauli, SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(NU_M,0.)) ), piNN_vertex ) ); nucleon = Cmul(Cmul(Complex(0., sqrt(2.) * norm_in * norm_out * ELEC ), nucleon_regge_trajectory(s, u) ), spinleft_mat_spinright(spinor_p_out, N_vertex, spinor_p_in) ); /**************************************/ /* */ /* DELTA exchange contribution */ /* */ /**************************************/ delta_vertex = zero_spinor_mat(); prop = 1; for(mu = 0; mu <= 3; mu++) { for(alpha = 0; alpha <= 3; alpha++) { for(beta = 0; beta <= 3; beta++) { switch(prop) { case 1 : /* numerator of Rarita-Schwinger propagator */ { delta_propagator_num = SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(DEL_M, 0.0) ) ), SMadd(SMadd(SMCmul(unit_spinor_mat(), Complex(metric(beta,alpha),0.) ), SMCmul(SMmul(dirac_gamma(beta),dirac_gamma(alpha) ), Complex(- 1./3. , 0.) ) ), SMadd(SMCmul(SMsub(SMCmul(dirac_gamma(beta), p4_u.fv[alpha]), SMCmul(dirac_gamma(alpha), p4_u.fv[beta]) ), Complex(- 1./ (3. * DEL_M) , 0.) ), SMCmul(unit_spinor_mat(), CRmul(- 2./(3.* pow(DEL_M,2.) ), Cmul(p4_u.fv[beta], p4_u.fv[alpha] ) ) ) ) ) ); break; } case 2 : /* spin 3/2 part of rarita-schwinger propagator */ { delta_propagator_num = SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(DEL_M, 0.0) ) ), SMadd(SMadd(SMCmul(unit_spinor_mat(), Complex(metric(beta,alpha),0.) ), SMCmul(SMmul(dirac_gamma(beta),dirac_gamma(alpha) ), Complex(- 1./3. , 0.) ) ), SMCmul(SMadd(SMmul(fvec_slash(p4_u), SMCmul(dirac_gamma(beta), p4_u.fv[alpha]) ), SMmul(SMCmul(dirac_gamma(alpha), p4_u.fv[beta]), fvec_slash(p4_u) ) ), Complex(- 1./ (3. * V4mul(p4_u, p4_u).re), 0.) ) ) ); break; } } /* coupling1 = SMCmul(SMmul(dirac_gamma5(), SMadd(SMCmul(dirac_gamma(mu), diff.fv[beta] ), SMCmul(fvec_slash(diff), Complex(- metric(beta,mu),0.) ) ) ), Complex(0.0, G1_p33 / (2. * NU_M) ) ); coupling2 = SMCmul(SMmul(dirac_gamma5(), SMadd(SMCmul(unit_spinor_mat(), Cmul(diff.fv[beta], p4_av.fv[mu] ) ), SMCmul(unit_spinor_mat(), CRmul(- metric(beta,mu), V4mul(diff, p4_av) ) ) ) ), Complex(0.0, - G2_p33 / pow(2. * NU_M, 2.) ) ); em_vertex = SMadd(coupling1, coupling2); */ vertex1 = Complex(0.,0.); vertex2 = Complex(0.,0.); for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { vertex1 = Cadd(vertex1, CRmul(metric(beta, beta) * metric(mu, mu) * antisymm_epsilon(beta, mu, kappa, lambda), Cmul(p4_av.fv[kappa], diff.fv[lambda]) ) ); } } for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { for (sigma = 0; sigma <= 3; sigma++) { for (rho = 0; rho <= 3; rho++) { for (tau = 0; tau <= 3; tau++) { vertex2 = Cadd(vertex2, CRmul(metric(beta, beta) * metric(mu, mu) * metric(sigma, sigma) * antisymm_epsilon(beta,sigma,kappa,lambda) * antisymm_epsilon(mu,sigma,rho,tau), Cmul(Cmul(p4_av.fv[kappa], diff.fv[lambda]), Cmul(p4_u.fv[rho], diff.fv[tau]) ) ) ); } } } } } coupling_magn = SMCmul(unit_spinor_mat(), CRmul(GM_p33 * (- 1.5 / NU_M) * (DEL_M + NU_M) / ( pow(DEL_M + NU_M, 2.) ), vertex1 ) ); coupling_elec = SMCmul(SMadd(SMCmul(unit_spinor_mat(), CRmul(- 1.5 / NU_M * (DEL_M + NU_M) * 1./( pow(DEL_M + NU_M, 2.) ), vertex1 ) ), SMCmul(dirac_gamma5(), Cmul(vertex2, Complex(0.0, 6. * (DEL_M + NU_M)/NU_M * 1./( (pow(DEL_M + NU_M,2.) ) * (pow(DEL_M - NU_M,2.) ) ) ) ) ) ), Complex(- GE_p33, 0.0) ); em_vertex = SMadd(coupling_magn, coupling_elec); delta_vertex_incr = SMCmul(SMmul(em_vertex, delta_propagator_num), CRmul(metric(alpha, alpha) * metric(beta, beta) * F_PINDEL/PI_M, Cmul(p4_pi.fv[alpha], CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ) ); delta_vertex = SMadd(delta_vertex, delta_vertex_incr); } } } delta_u = CRmul(sqrt(2.) / 3. * norm_in * norm_out * ELEC, Cmul(delta_regge_trajectory(s, u), spinleft_mat_spinright(spinor_p_out, delta_vertex, spinor_p_in) ) ); /**************************************/ /* */ /* D13 exchange contribution */ /* */ /**************************************/ if ( (mech == 4) || (mech == 5) ) { d13_vertex = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { for(alpha = 0; alpha <= 3; alpha++) { for(beta = 0; beta <= 3; beta++) { d13_propagator_num = SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(M_d13, 0.0) ) ), SMadd(SMadd(SMCmul(unit_spinor_mat(), Complex(metric(beta,alpha),0.) ), SMCmul(SMmul(dirac_gamma(beta),dirac_gamma(alpha) ), Complex(- 1./3. , 0.) ) ), SMadd(SMCmul(SMsub(SMCmul(dirac_gamma(beta), p4_u.fv[alpha]), SMCmul(dirac_gamma(alpha), p4_u.fv[beta]) ), Complex(- 1./ (3. * M_d13) , 0.) ), SMCmul(unit_spinor_mat(), CRmul(- 2./(3.* pow(M_d13,2.) ), Cmul(p4_u.fv[beta], p4_u.fv[alpha] ) ) ) ) ) ); vertex1 = Complex(0.,0.); vertex2 = Complex(0.,0.); for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { vertex1 = Cadd(vertex1, CRmul(metric(beta, beta) * metric(mu, mu) * antisymm_epsilon(beta, mu, kappa, lambda), Cmul(p4_av.fv[kappa], diff.fv[lambda]) ) ); } } for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { for (sigma = 0; sigma <= 3; sigma++) { for (rho = 0; rho <= 3; rho++) { for (tau = 0; tau <= 3; tau++) { vertex2 = Cadd(vertex2, CRmul(metric(beta, beta) * metric(mu, mu) * metric(sigma, sigma) * antisymm_epsilon(beta,sigma,kappa,lambda) * antisymm_epsilon(mu,sigma,rho,tau), Cmul(Cmul(p4_av.fv[kappa], diff.fv[lambda]), Cmul(p4_u.fv[rho], diff.fv[tau]) ) ) ); } } } } } couplinge_d13 = SMCmul(unit_spinor_mat(), CRmul(GEn_d13 * 2. / ( (M_d13 + NU_M) * pow(NU_M, 3.) ), Cmul( vertex2, Complex(0., 1.)) ) ); couplingm_d13 = SMCmul(SMadd(SMCmul(dirac_gamma5(), CRmul(2. * (M_d13 + NU_M) / pow(NU_M, 3.), vertex1 ) ), SMCmul(unit_spinor_mat(), CRmul(- 2. / ( (M_d13 + NU_M) * pow(NU_M, 3.) ), Cmul( vertex2, Complex(0., 1.)) ) ) ), Complex(GMn_d13, 0.0) ); em_vertex = SMadd(couplingm_d13, couplinge_d13); d13_vertex_incr = SMCmul(SMmul(SMmul(em_vertex, d13_propagator_num), SMCmul(dirac_gamma5(), Complex(-1., 0.)) ), CRmul(metric(alpha, alpha) * metric(beta, beta) * F_PINd13/PI_M, Cmul(p4_pi.fv[alpha], CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ) ); d13_vertex = SMadd(d13_vertex, d13_vertex_incr); } } } d13_u = CRmul(sqrt(2.) * norm_in * norm_out * ELEC, Cmul(d13_regge_trajectory(s, u), spinleft_mat_spinright(spinor_p_out, d13_vertex, spinor_p_in) ) ); } switch(mech) { case 1: /* nucleon */ { return CRmul(unucleon_formfactor(u), nucleon); break; } case 2: /* delta */ { return CRmul(udelta_formfactor(u), delta_u); break; } case 3: /* nucleon + delta */ { return Cadd(CRmul(unucleon_formfactor(u), nucleon), CRmul(udelta_formfactor(u), delta_u) ); break; } case 4: /* nucleon + d13 */ { return Cadd(CRmul(unucleon_formfactor(u), nucleon), CRmul(ud13_formfactor(u), d13_u) ); break; } case 5: /* nucleon + delta + d13 */ { return Cadd(Cadd(CRmul(unucleon_formfactor(u), nucleon), CRmul(ud13_formfactor(u), d13_u) ), CRmul(udelta_formfactor(u), delta_u) ); break; } } } /*************************************************************************/ /*************************************************************************/ /* */ /* The following t matrices are for the (e, e' p pi_zero) reaction. */ /* */ /*************************************************************************/ /*************************************************************************/ dcomplex t_vgap_ppio_regge_forward(int mech, int deg_rho, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t) { int mu, lambda, nu, alpha, beta; double ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, pi_th, po_s, po_u, E_u, u, E_in, E_out, norm_in, norm_out, nucleon_isosff, nucleon_isovff; dcomplex temp_result, rhopiga, omegapiga, A1piga; vec pol_ph_left, pol_ph_right, pol_ph_long, k_ga, p_pi, p_in, p_out, pi_s, pi_u; fvec k4_ga, p4_pi, p_s, p_u, diff, mom, pol4_ph; spinor spinor_p_in, spinor_p_out; spinor_mat pauli, pauli_incr, rhoNN_vertex, rhoNN_matrix, omegaNN_vertex, omegaNN_matrix, A1NN_matrix; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); k_ga = Vpolar(ga_mom_cm, 0., 0.); k4_ga = V4ini(Complex(ga_en_cm,0.), k_ga); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); pi_th = acos( (t + Q_sqr - pow(PI_M,2.) + 2. * ga_en_cm * pi_en) / (2. * ga_mom_cm * pi_mom_cm) ); p_pi = Vpolar(pi_mom_cm, pi_th, 0.); p4_pi = V4ini(Complex(pi_en,0.), p_pi); p_in = VRmul(k_ga, - 1.0); p_out = VRmul(p_pi,- 1.0); E_in = sqrt( pow( Vnorm(k_ga), 2.) + pow(NU_M,2.) ); E_out = sqrt( pow( Vnorm(p_pi), 2.) + pow(NU_M,2.) ); pi_s = Vadd(p_out, p_pi); po_s = sqrt(s); p_s = V4ini(Complex(po_s, 0.), pi_s); pi_u = Vsub(p_out, k_ga); po_u = E_out - ga_en_cm; p_u = V4ini(Complex(po_u, 0.), pi_u); E_u = sqrt( pow( Vnorm(pi_u), 2.) + pow(NU_M,2.) ); u = 2. * pow(NU_M,2.) + pow(PIM_M,2.) - Q_sqr - s - t; spinor_p_out = spinor_pos(p_out, NU_M, sp_out); spinor_p_in = spinor_pos(p_in, NU_M, sp_in); norm_in = sqrt(E_in + NU_M); norm_out = sqrt(E_out + NU_M); diff = V4sub(k4_ga, p4_pi); mom = V4sub(V4Rmul(p4_pi, 2.), k4_ga); switch(pol_ph) { case -1 : { pol_ph_left = Vini( Complex(1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0.,0.), pol_ph_left); break; } case 0 : { pol_ph_long = Vini( Complex(0., 0.), Complex(0., 0.), Complex(ga_en_cm/sqrt(Q_sqr), 0.) ); pol4_ph = V4ini(Complex(ga_mom_cm/sqrt(Q_sqr), 0.), pol_ph_long); /* pol4_ph = V4ini(Complex(0., 0.), Vini(Complex(0.,0.),Complex(0.,0.), Complex(sqrt(Q_sqr)/ga_en_cm,0.)) ); */ break; } case 1 : { pol_ph_right = Vini( Complex(- 1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0., 0.), pol_ph_right); break; } } /* printf("\n %f",t); printf("\n 1 %f %f %f %f",k4_ga.fv[1].re, p4_pi.fv[1].re, pol4_ph.fv[1].re, pol4_ph.fv[1].im); printf("\n 2 %f %f %f %f",k4_ga.fv[2].re, p4_pi.fv[2].re, pol4_ph.fv[2].re, pol4_ph.fv[2].im); printf("\n 3 %f %f %f %f",k4_ga.fv[3].re, p4_pi.fv[3].re, pol4_ph.fv[3].re, pol4_ph.fv[3].im); printf("\n 4 %f %f %f %f",k4_ga.fv[0].re, p4_pi.fv[0].re, pol4_ph.fv[0].re, pol4_ph.fv[0].im); */ /**************************************/ /* */ /* RHO exchange contribution */ /* */ /**************************************/ rhoNN_matrix = zero_spinor_mat(); for(beta = 0; beta <= 3; beta++) { pauli = zero_spinor_mat(); for(lambda = 0; lambda <= 3; lambda++) { pauli_incr = SMCmul(dirac_sigma(beta, lambda), Cmul(diff.fv[lambda], Complex(0.0,metric(lambda,lambda) * KAPPA_RHO /(2. * NU_M)) ) ); pauli = SMadd(pauli, pauli_incr); } rhoNN_vertex = SMCmul(SMadd(dirac_gamma(beta), pauli), Complex(G_RHONN, 0.) ); temp_result = Complex(0.,0.); for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { for(alpha = 0; alpha <= 3; alpha++) { temp_result = Cadd(temp_result, CRmul(antisymm_epsilon(nu,mu,alpha,beta), Cmul(Cmul(k4_ga.fv[nu], diff.fv[alpha]), pol4_ph.fv[mu]) ) ); } } } rhoNN_matrix = SMadd(rhoNN_matrix, SMCmul(rhoNN_vertex, temp_result) ); } rhopiga = Cmul(CRmul(norm_in * norm_out * G_RHONPIGA * ELEC / PI0_M, rho_regge_trajectory(deg_rho, s, t) ), spinleft_mat_spinright(spinor_p_out, rhoNN_matrix, spinor_p_in) ); /****************************************/ /* */ /* OMEGA exchange contribution */ /* */ /****************************************/ omegaNN_matrix = zero_spinor_mat(); for(beta = 0; beta <= 3; beta++) { pauli = zero_spinor_mat(); for(lambda = 0; lambda <= 3; lambda++) { pauli_incr = SMCmul(dirac_sigma(beta, lambda), Cmul(diff.fv[lambda], Complex(0.0,metric(lambda,lambda) * KAPPA_OMEGA /(2. * NU_M)) ) ); pauli = SMadd(pauli, pauli_incr); } omegaNN_vertex = SMCmul(SMadd(dirac_gamma(beta), pauli), Complex(G_OMEGANN, 0.) ); temp_result = Complex(0.,0.); for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { for(alpha = 0; alpha <= 3; alpha++) { temp_result = Cadd(temp_result, CRmul(antisymm_epsilon(nu,mu,alpha,beta), Cmul(Cmul(k4_ga.fv[nu], diff.fv[alpha]), pol4_ph.fv[mu]) ) ); } } } omegaNN_matrix = SMadd(omegaNN_matrix, SMCmul(omegaNN_vertex, temp_result) ); } omegapiga = Cmul(CRmul(norm_in * norm_out * G_OMPIGA * ELEC / PI0_M, omega_regge_trajectory(s, t, Q_sqr) ), spinleft_mat_spinright(spinor_p_out, omegaNN_matrix, spinor_p_in) ); /**************************************/ /* */ /* B1 exchange contribution */ /* */ /**************************************/ if ((mech == 4) || (mech == 5)) { A1NN_matrix = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { A1NN_matrix = SMadd(A1NN_matrix, SMadd(SMCmul(SMmul(dirac_gamma(mu), dirac_gamma5()), Cmul(V4mul(k4_ga, diff), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ), SMCmul(SMmul(dirac_gamma(mu), dirac_gamma5()), CRmul(- metric(mu,mu), Cmul(V4mul(pol4_ph, diff), k4_ga.fv[mu]) ) ) ) ); } A1piga = Cmul(Cmul(Complex(0., norm_in * norm_out * b_coup / PI0_M * ELEC ), B1_regge_trajectory(s, t) ), spinleft_mat_spinright(spinor_p_out, A1NN_matrix, spinor_p_in) ); } switch(mech) { case 1 : /* omega exchange */ { if (photelec==1) return omegapiga; if (photelec==2) { double ome_ff1; ome_ff1=ome_ff(Q_sqr); return CRmul(ome_ff1, omegapiga); } break; } case 2 : /* rho exchange */ { if (photelec==1) return rhopiga; if (photelec==2) { double rho_ff1; rho_ff1=rho_ff(Q_sqr); return CRmul(rho_ff1, rhopiga); } break; } case 3 : /* omega + rho exchange */ { if (photelec==1) return Cadd(omegapiga, rhopiga); if (photelec==2) { double rho_ff1, ome_ff1; ome_ff1=ome_ff(Q_sqr); rho_ff1=rho_ff(Q_sqr); return Cadd(CRmul(rho_ff1, rhopiga),CRmul(ome_ff1, omegapiga)); } break; } case 4 : /* B1 exchange */ { if (photelec==1) return A1piga; if (photelec==2) { double b_ff1; b_ff1=b_ff(Q_sqr); return CRmul(b_ff1, A1piga); } break; } case 5 : /* omega + rho + B1 exchange */ { if (photelec==1) return Cadd(Cadd(omegapiga, rhopiga), A1piga); if (photelec==2) { double rho_ff1, ome_ff1, b_ff1; ome_ff1=ome_ff(Q_sqr); rho_ff1=rho_ff(Q_sqr); b_ff1=b_ff(Q_sqr); return Cadd(Cadd(CRmul(rho_ff1, rhopiga),CRmul(ome_ff1, omegapiga)) ,CRmul(b_ff1, A1piga)); } break; } } } dcomplex t_vgap_ppio_regge_backward(int mech, int pol_ph, double sp_out, double sp_in, double Q_sqr, double s, double t) { int mu, kappa, lambda, sigma, rho, tau, nu, alpha, beta, prop; double ga_mom_cm, ga_en_cm, pi_mom_cm, pi_en, pi_th, po_s, po_u, E_u, u, E_in, E_out, norm_in, norm_out, udelta_formf, nucleon_isov_ff, nucleon_axff, isov_emff, isov_axialff; dcomplex nucleon, nucleon_gaugeinv, gauge_corr, vertex1, vertex2, delta_u, d13_u; vec pol_ph_left, pol_ph_right, pol_ph_long, k_ga, p_pi, p_in, p_out, pi_s, pi_u; fvec k4_ga, p4_pi, p4_s, p4_u, p4_out, p4_av, diff, mom, pol4_ph; spinor spinor_p_in, spinor_p_out; spinor_mat dirac, pauli, N_vertex, piNN_vertex, dirac_sN, sNU_vertex, delta_propagator_num, coupling1, coupling2, coupling_magn, coupling_elec, coupling_test, em_vertex, delta_vertex, delta_vertex_incr, d13_propagator_num, coupling1_d13, coupling2_d13, couplingm_d13, couplinge_d13, d13_vertex, d13_vertex_incr; ga_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) + Q_sqr, 2.) + pow(2. * NU_M, 2.) * Q_sqr ) / (4. * s) ); ga_en_cm = sqrt(s) - sqrt(pow(ga_mom_cm,2.) + pow(NU_M,2.)); k_ga = Vpolar(ga_mom_cm, 0., 0.); k4_ga = V4ini(Complex(ga_en_cm,0.), k_ga); pi_mom_cm = sqrt( ( pow(s - pow(NU_M,2.) - pow(PI_M,2.), 2.) - pow(2. * NU_M * PI_M, 2.) ) / (4. * s) ); pi_en = sqrt( pow(pi_mom_cm, 2.) + pow(PI_M, 2.) ); pi_th = acos( (t + Q_sqr - pow(PI_M,2.) + 2. * ga_en_cm * pi_en) / (2. * ga_mom_cm * pi_mom_cm) ); p_pi = Vpolar(pi_mom_cm, pi_th, 0.); p4_pi = V4ini(Complex(pi_en,0.), p_pi); p_in = VRmul(k_ga, - 1.0); p_out = VRmul(p_pi,- 1.0); E_in = sqrt( pow( Vnorm(k_ga), 2.) + pow(NU_M,2.) ); E_out = sqrt( pow( Vnorm(p_pi), 2.) + pow(NU_M,2.) ); p4_out = V4ini(Complex(E_out,0.), p_out); pi_s = Vadd(p_out, p_pi); po_s = sqrt(s); p4_s = V4ini(Complex(po_s,0.), pi_s); pi_u = Vsub(p_out, k_ga); po_u = E_out - ga_en_cm; p4_u = V4ini(Complex(po_u, 0.), pi_u); p4_av = V4Rmul(V4add(p4_out, p4_u), 0.5); E_u = sqrt( pow( Vnorm(pi_u), 2.) + pow(NU_M,2.) ); u = 2. * pow(NU_M,2.) + pow(PIM_M,2.) - Q_sqr - s - t; spinor_p_out = spinor_pos(p_out, NU_M, sp_out); spinor_p_in = spinor_pos(p_in, NU_M, sp_in); norm_in = sqrt(E_in + NU_M); norm_out = sqrt(E_out + NU_M); diff = V4sub(k4_ga, p4_pi); mom = V4sub(V4Rmul(p4_pi, 2.), k4_ga); switch(pol_ph) { case -1 : { pol_ph_left = Vini( Complex(1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0.,0.), pol_ph_left); break; } case 0 : { pol_ph_long = Vini( Complex(0., 0.), Complex(0., 0.), Complex(ga_en_cm/sqrt(Q_sqr), 0.) ); pol4_ph = V4ini(Complex(ga_mom_cm/sqrt(Q_sqr), 0.), pol_ph_long); /* pol4_ph = V4ini(Complex(0., 0.), Vini(Complex(0.,0.),Complex(0.,0.), Complex(sqrt(Q_sqr)/ga_en_cm,0.)) ); */ break; } case 1 : { pol_ph_right = Vini( Complex(- 1./ sqrt(2.), 0.), Complex(0., - 1./sqrt(2.)), Complex(0., 0.) ); pol4_ph = V4ini(Complex(0., 0.), pol_ph_right); break; } } /**************************************/ /* */ /* NUCLEON exchange contribution */ /* */ /**************************************/ dirac = zero_spinor_mat(); pauli = zero_spinor_mat(); dirac_sN = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { for(nu = 0; nu <= 3; nu++) { pauli = SMadd(pauli, SMCmul(dirac_sigma(mu, nu), Cmul(Cmul(CRmul(metric(mu,mu), pol4_ph.fv[mu]), k4_ga.fv[nu] ), Complex(0.0,metric(nu,nu) * F2_p /(2. * NU_M)) ) ) ); } } for(mu = 0; mu <= 3; mu++) { dirac = SMadd(dirac, SMCmul(dirac_gamma(mu), CRmul(F1_p, CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ) ); } piNN_vertex = SMCmul(SMadd(SMCmul(dirac_gamma5(), Complex(2. * NU_M * PSPV_PARAM, 0.) ), SMCmul(SMmul(fvec_slash(V4Rmul(p4_pi, - 1.) ), dirac_gamma5() ), Complex(1. - PSPV_PARAM, 0.) ) ), Complex(F_PINN/PI0_M, 0.) ); N_vertex = SMmul(SMadd(dirac, pauli), SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(NU_M,0.)) ), piNN_vertex ) ); nucleon = Cmul(Cmul(Complex(0., norm_in * norm_out * ELEC), nucleon_regge_trajectory(s, u) ), spinleft_mat_spinright(spinor_p_out, N_vertex, spinor_p_in) ); for(mu = 0; mu <= 3; mu++) dirac_sN = SMadd(dirac_sN, SMCmul(dirac_gamma(mu), CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ); sNU_vertex = SMCmul(SMmul(SMadd(SMCmul(dirac_gamma5(), Complex(2. * NU_M * PSPV_PARAM, 0.) ), SMCmul(SMmul(fvec_slash(V4Rmul(p4_pi, - 1.) ), dirac_gamma5() ), Complex(1. - PSPV_PARAM, 0.) ) ), SMmul(SMadd(fvec_slash(p4_s), SMCmul(unit_spinor_mat(), Complex(NU_M, 0.) ) ), dirac_sN ) ), Complex(F_PINN/PI0_M * (u - pow(NU_M,2.))/(s - pow(NU_M,2.)), 0.) ); gauge_corr = Cmul(Cmul(Complex(0., norm_in * norm_out * ELEC), nucleon_regge_trajectory(s, u) ), spinleft_mat_spinright(spinor_p_out, sNU_vertex, spinor_p_in) ); nucleon_gaugeinv = Cadd(nucleon, gauge_corr); /**************************************/ /* */ /* DELTA exchange contribution */ /* */ /**************************************/ delta_vertex = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { for(alpha = 0; alpha <= 3; alpha++) { for(beta = 0; beta <= 3; beta++) { delta_propagator_num = SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(DEL_M, 0.0) ) ), SMadd(SMadd(SMCmul(unit_spinor_mat(), Complex(metric(beta,alpha),0.) ), SMCmul(SMmul(dirac_gamma(beta),dirac_gamma(alpha) ), Complex(- 1./3. , 0.) ) ), SMadd(SMCmul(SMsub(SMCmul(dirac_gamma(beta), p4_u.fv[alpha]), SMCmul(dirac_gamma(alpha), p4_u.fv[beta]) ), Complex(- 1./ (3. * DEL_M) , 0.) ), SMCmul(unit_spinor_mat(), CRmul(- 2./(3.* pow(DEL_M,2.) ), Cmul(p4_u.fv[beta], p4_u.fv[alpha] ) ) ) ) ) ); vertex1 = Complex(0.,0.); vertex2 = Complex(0.,0.); for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { vertex1 = Cadd(vertex1, CRmul(metric(beta, beta) * metric(mu, mu) * antisymm_epsilon(beta, mu, kappa, lambda), Cmul(p4_av.fv[kappa], diff.fv[lambda]) ) ); } } for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { for (sigma = 0; sigma <= 3; sigma++) { for (rho = 0; rho <= 3; rho++) { for (tau = 0; tau <= 3; tau++) { vertex2 = Cadd(vertex2, CRmul(metric(beta, beta) * metric(mu, mu) * metric(sigma, sigma) * antisymm_epsilon(beta,sigma,kappa,lambda) * antisymm_epsilon(mu,sigma,rho,tau), Cmul(Cmul(p4_av.fv[kappa], diff.fv[lambda]), Cmul(p4_u.fv[rho], diff.fv[tau]) ) ) ); } } } } } coupling_magn = SMCmul(unit_spinor_mat(), CRmul(GM_p33 * (- 1.5 / NU_M) * (DEL_M + NU_M) / ( pow(DEL_M + NU_M, 2.) ), vertex1 ) ); coupling_elec = SMCmul(SMadd(SMCmul(unit_spinor_mat(), CRmul(- 1.5 / NU_M * (DEL_M + NU_M) * 1./( pow(DEL_M + NU_M, 2.) ), vertex1 ) ), SMCmul(dirac_gamma5(), Cmul(vertex2, Complex(0.0, 6. * (DEL_M + NU_M)/NU_M * 1./( (pow(DEL_M + NU_M,2.) ) * (pow(DEL_M - NU_M,2.) ) ) ) ) ) ), Complex(- GE_p33, 0.0) ); em_vertex = SMadd(coupling_magn, coupling_elec); delta_vertex_incr = SMCmul(SMmul(em_vertex, delta_propagator_num), CRmul(metric(alpha, alpha) * metric(beta, beta) * F_PINDEL/PI_M, Cmul(p4_pi.fv[alpha], CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ) ); delta_vertex = SMadd(delta_vertex, delta_vertex_incr); } } } delta_u = CRmul(2. / 3. * norm_in * norm_out * ELEC, Cmul(delta_regge_trajectory(s, u), spinleft_mat_spinright(spinor_p_out, delta_vertex, spinor_p_in) ) ); /**************************************/ /* */ /* D13 exchange contribution */ /* */ /**************************************/ if ( (mech == 4) || (mech == 5) ) { d13_vertex = zero_spinor_mat(); for(mu = 0; mu <= 3; mu++) { for(alpha = 0; alpha <= 3; alpha++) { for(beta = 0; beta <= 3; beta++) { d13_propagator_num = SMmul(SMadd(fvec_slash(p4_u), SMCmul(unit_spinor_mat(), Complex(M_d13, 0.0) ) ), SMadd(SMadd(SMCmul(unit_spinor_mat(), Complex(metric(beta,alpha),0.) ), SMCmul(SMmul(dirac_gamma(beta),dirac_gamma(alpha) ), Complex(- 1./3. , 0.) ) ), SMadd(SMCmul(SMsub(SMCmul(dirac_gamma(beta), p4_u.fv[alpha]), SMCmul(dirac_gamma(alpha), p4_u.fv[beta]) ), Complex(- 1./ (3. * M_d13) , 0.) ), SMCmul(unit_spinor_mat(), CRmul(- 2./(3.* pow(M_d13,2.) ), Cmul(p4_u.fv[beta], p4_u.fv[alpha] ) ) ) ) ) ); vertex1 = Complex(0.,0.); vertex2 = Complex(0.,0.); for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { vertex1 = Cadd(vertex1, CRmul(metric(beta, beta) * metric(mu, mu) * antisymm_epsilon(beta, mu, kappa, lambda), Cmul(p4_av.fv[kappa], diff.fv[lambda]) ) ); } } for (kappa = 0; kappa <= 3; kappa++) { for (lambda = 0; lambda <= 3; lambda++) { for (sigma = 0; sigma <= 3; sigma++) { for (rho = 0; rho <= 3; rho++) { for (tau = 0; tau <= 3; tau++) { vertex2 = Cadd(vertex2, CRmul(metric(beta, beta) * metric(mu, mu) * metric(sigma, sigma) * antisymm_epsilon(beta,sigma,kappa,lambda) * antisymm_epsilon(mu,sigma,rho,tau), Cmul(Cmul(p4_av.fv[kappa], diff.fv[lambda]), Cmul(p4_u.fv[rho], diff.fv[tau]) ) ) ); } } } } } couplinge_d13 = SMCmul(unit_spinor_mat(), CRmul(GEn_d13 * 2. / ( (M_d13 + NU_M) * pow(NU_M, 3.) ), Cmul( vertex2, Complex(0., 1.)) ) ); couplingm_d13 = SMCmul(SMadd(SMCmul(dirac_gamma5(), CRmul(2. * (M_d13 + NU_M) / pow(NU_M, 3.), vertex1 ) ), SMCmul(unit_spinor_mat(), CRmul(- 2. / ( (M_d13 + NU_M) * pow(NU_M, 3.) ), Cmul( vertex2, Complex(0., 1.)) ) ) ), Complex(GMn_d13, 0.0) ); em_vertex = SMadd(couplingm_d13, couplinge_d13); d13_vertex_incr = SMCmul(SMmul(SMmul(em_vertex, d13_propagator_num), SMCmul(dirac_gamma5(), Complex(-1., 0.)) ), CRmul(metric(alpha, alpha) * metric(beta, beta) * F_PINd13/PI_M, Cmul(p4_pi.fv[alpha], CRmul(metric(mu,mu), pol4_ph.fv[mu]) ) ) ); d13_vertex = SMadd(d13_vertex, d13_vertex_incr); } } } d13_u = CRmul(norm_in * norm_out * ELEC, Cmul(d13_regge_trajectory(s, u), spinleft_mat_spinright(spinor_p_out, d13_vertex, spinor_p_in) ) ); } switch(mech) { case 1: /* nucleon */ { /* return CRmul(unucleon_formfactor(u), nucleon); */ return CRmul(unucleon_formfactor(u), nucleon_gaugeinv); break; } case 2: /* delta */ { return CRmul(udelta_formfactor(u), delta_u); break; } case 3: /* nucleon + delta */ { return Cadd(CRmul(unucleon_formfactor(u), nucleon_gaugeinv), CRmul(udelta_formfactor(u), delta_u) ); break; } case 4: /* nucleon + d13 */ { return Cadd(CRmul(unucleon_formfactor(u), nucleon_gaugeinv), CRmul(ud13_formfactor(u), d13_u) ); break; } case 5: /* nucleon + delta + d13 */ { return Cadd(Cadd(CRmul(unucleon_formfactor(u), nucleon_gaugeinv), CRmul(ud13_formfactor(u), d13_u) ), CRmul(udelta_formfactor(u), delta_u) ); break; } } }