19 #include "Randomize.hh"
45 G4cout <<
"###### Calling QweakSimEPEvent::QweakSimEPEvent () " << G4endl;
73 G4cout <<
"###### Leaving QweakSimEPEvent::QweakSimEPEvent () " << G4endl;
81 G4cout <<
"###### Calling QweakSimEPEvent::~QweakSimEPEvent () " << G4endl;
87 G4cout <<
"###### Leaving QweakSimEPEvent::~QweakSimEPEvent () " << G4endl;
154 G4double cosPhi = cos(PhiAngle);
155 G4double sinPhi = sin(PhiAngle);
166 G4double cosTheta = 1.0;
167 G4double sinTheta = 0.0;
168 G4double ThetaAngle = 0.0;
169 G4double E_out = 0.0;
177 cosTheta = cos(ThetaAngle);
178 sinTheta = sin(ThetaAngle);
186 cosTheta = cosThetaMin + G4UniformRand()*(cosThetaMax - cosThetaMin);
187 sinTheta = sqrt(1. - cosTheta * cosTheta);
188 ThetaAngle = acos(cosTheta);
191 G4cerr <<
"Warning: unkown isotropy type. Pick 0 or 1." << G4endl;
198 G4double ux = sinTheta * cosPhi;
199 G4double uy = sinTheta * sinPhi;
200 G4double uz = cosTheta;
201 G4ThreeVector myNormMomentum(ux,uy,uz);
211 return myNormMomentum;
218 std::vector< G4double > &fCrossSection,
222 G4ThreeVector &OutgoingMomentumDirection,
230 G4double IncomingMomentumDirectionMag = IncomingMomentumDirection.mag();
235 theta = OutgoingMomentumDirection.theta()/degree;
236 phi = OutgoingMomentumDirection.phi()/degree;
239 G4double dot = OutgoingMomentumDirection.dot(IncomingMomentumDirection);
241 G4double RelativeThetaAngle = acos(dot/IncomingMomentumDirectionMag);
340 fCrossSection[0] =
Delta_Resonance(E_in,RelativeThetaAngle, fWeightN, Q2, E_out);
349 G4double ThetaRecoil;
351 E_recoil, ThetaRecoil,
352 Q2, fWeightN, Asymmetry);
382 fCrossSection[0] =
AlNuclInel(E_in, RelativeThetaAngle, fWeightN, Q2, E_out);
388 fCrossSection[0] =
AlGDR(E_in, RelativeThetaAngle, fWeightN, Q2, E_out);
402 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
410 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
417 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
424 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
431 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
438 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
445 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
452 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
463 fCrossSection[0] =
AlloyScattering(E_in, RelativeThetaAngle, Z, A, fWeightN, Q2, E_out);
467 fCrossSection[0] =
CGDR(E_in, RelativeThetaAngle, fWeightN, Q2, E_out);
471 fCrossSection[0] =
CNuclInel(E_in, RelativeThetaAngle, 1, fWeightN, Q2, E_out);
475 fCrossSection[0] =
CNuclInel(E_in, RelativeThetaAngle, 2, fWeightN, Q2, E_out);
479 fCrossSection[0] =
CNuclInel(E_in, RelativeThetaAngle, 3, fWeightN, Q2, E_out);
483 fCrossSection[0] = 0;
484 E_out = E_in*G4UniformRand();
485 if(E_out < 0.0) E_out = E_in;
486 G4double STH = sin(RelativeThetaAngle/2.0);
487 Q2 = 4.0*E_in*E_out*STH*STH;
495 "horowitz_alloy_tables/elasticAl27.csv",
500 "horowitz_alloy_tables/elasticAl27.csv");
672 "horowitz_alloy_tables/elasticZn64.csv",
677 "horowitz_alloy_tables/elasticZn64.csv");
683 "horowitz_alloy_tables/elasticMg24.csv",
688 "horowitz_alloy_tables/elasticMg24.csv");
694 "horowitz_alloy_tables/elasticCu63.csv",
699 "horowitz_alloy_tables/elasticCu63.csv");
705 "horowitz_alloy_tables/elasticCr52.csv",
710 "horowitz_alloy_tables/elasticCr52.csv");
716 "horowitz_alloy_tables/elasticFe56.csv",
721 "horowitz_alloy_tables/elasticFe56.csv");
727 "horowitz_alloy_tables/elasticSi28.csv",
732 "horowitz_alloy_tables/elasticSi28.csv");
736 G4cout <<
"Warning! ReactionType Not SELECTED!!!!" << G4endl;
807 G4double Lamda_2 = 0.710;
808 G4double
M_p = 938.2796 * MeV;
813 G4double myhbarc = hbarc / MeV / fermi;
814 G4double alpha = 1.0/137.035999074;
815 G4double CC = myhbarc*alpha/2.0;
816 G4double Electron_Mass = 0.511 * MeV;
820 const G4double theta_min = 0.01 * degree;
821 if (Theta < theta_min) {
823 G4cout <<
"Warning: Elastic_Cross_Section_Proton: theta less than " << theta_min << G4endl;
824 G4cout <<
"Warning: Elastic_Cross_Section_Proton: theta was set to " << theta_min << G4endl;
827 G4double CTH = cos(Theta/2.);
828 G4double STH = sin(Theta/2.);
829 G4double T2THE = STH*STH/CTH/CTH;
830 G4double ETA = 1.0+2.0*E_in*STH*STH/M;
832 Q2 = 4.0*E_in*E_out*STH*STH;
833 G4double tau = Q2/4.0/M/M;
835 G4double CrossSection = (Z*CC/E_in*CTH/STH/STH)*(Z*CC/E_in*CTH/STH/STH)/ETA;
837 G4double Mott = CrossSection*10000.0;
839 G4double GEP_DIPOLE = 1.0/(1.0+Q2/1.E6/Lamda_2)/(1.0+Q2/1.E6/Lamda_2);
840 G4double GMP_DIPOLE = GEP_DIPOLE*mu;
841 G4double FAC = 1.0/(1.0+tau);
844 G4double FunctionofTheta = log (STH*STH) * log (CTH*CTH);
845 G4double delta_Schwinger = (-2.0*alpha/pi) * ((log(E_in/15.0) - 13.0/12.0) * (log(Q2/(Electron_Mass*Electron_Mass)) - 1.0) + 17.0/36.0 + FunctionofTheta/2.0);
847 G4double Sigma_Dipole;
848 Sigma_Dipole = Mott*(GEP_DIPOLE*GEP_DIPOLE*FAC+tau*GMP_DIPOLE*GMP_DIPOLE*(FAC+2.*T2THE));
849 Sigma_Dipole *= (1.0 + delta_Schwinger);
850 fWeightN = Sigma_Dipole*sin(Theta);
865 G4double
M_p = 938.2796;
872 G4double ap = sqrt(0.427);
873 G4double a0 = sqrt((a*a-1.5*ap*ap)/(3.5-10/Z-1.5/A));
889 G4double CTH = cos(Theta/2.0);
890 G4double STH = sin(Theta/2.0);
892 G4double ETA = 1.0+2.0*E_in*STH*STH/M;
895 Q2 = 4*E_in*E_out*STH*STH;
896 G4double q2 = Q2/1000000*(1.0/0.197)*(1.0/0.197);
897 G4double x = (1.0/4.0)*q2*a0*a0;
903 G4double F0 = (1.0/Z)*( Z-4.0/3.0*(Z-5.0)*x+4.0/15.0*(Z-8.0)*x*x)*exp(-x);
904 G4double F2 = (1.0-2.0/7.0*x)*exp(-x);
905 G4double Fe = sqrt( F0*F0+(7.0/450.0)*q2*q2*(Q*Q/Z/Z)*F2*F2 );
906 Fe=Fe*exp(-0.25*q2*ap*ap);
908 G4double Fe_2 = pow(Fe,2);
928 G4double Electron_Mass = 0.511 * MeV;
929 G4double alpha = 1.0/137.035999074;
931 G4double FunctionofTheta = log (STH*STH) * log (CTH*CTH);
932 G4double delta_Schwinger = (-2.0*alpha/pi) * ((log(E_in/15.0) - 13.0/12.0) * (log(Q2/(Electron_Mass*Electron_Mass)) - 1.0) + 17.0/36.0 + FunctionofTheta/2.0);
936 G4double SigmaMott = pow(((0.72/E_in)*CTH/(STH*STH)),2)/(1+2*E_in/M*STH*STH)*10000 ;
941 G4double Xsect = SigmaMott*F_2;
942 Xsect = Xsect * (1.0 + delta_Schwinger);
943 fWeightN = Xsect*sin(Theta);
961 G4double Lamda_2 = 0.710;
962 G4double
M_p = 938.2796;
964 G4double mu_n = -1.91;
974 G4double CTH = cos(Theta/2.0);
975 G4double STH = sin(Theta/2.0);
976 G4double T2THE = STH*STH/CTH/CTH;
977 G4double ETA = 1.0+2.0*E_in*STH*STH/M;
980 Q2 = 4.*E_in*E_out*STH*STH;
981 G4double tau = Q2/4./M/M;
983 G4double CrossSection = (Z*0.72/E_in*CTH/STH/STH)*(Z*0.72/E_in*CTH/STH/STH)/ETA;
985 G4double Mott = CrossSection*10000.0;
988 G4double GEP_DIPOLE = 1.0/(1.0+Q2/1.E6/Lamda_2)*(1.0+Q2/1.E6/Lamda_2);
990 G4double GEn_DIPOLE = 0.0;
991 G4double GMn_DIPOLE = GEP_DIPOLE*mu_n;
992 G4double FAC = 1.0/(1.0+tau);
995 G4double Sigma_Dipole_n = Mott*(GEn_DIPOLE*GEn_DIPOLE*FAC+tau*GMn_DIPOLE*GMn_DIPOLE*(FAC+2.*T2THE));
999 fWeightN = Sigma_Dipole_n*sin(Theta);
1000 return Sigma_Dipole_n;
1015 G4double M_electron = 0.511;
1022 E_out = M_electron + G4UniformRand()*(E_beam - M_electron);
1025 G4double xsect =
Sigma_EEPrime(E_in/1000.0, E_out/1000.0, Theta, Q2);
1029 xsect = xsect*(E_beam - M_electron)/1000.0;
1031 fWeightN = xsect*sin(Theta);
1055 G4double w2,xval1[51],xvalL[51];
1056 G4double sigT,sigL,epsilon;
1059 G4double t2,epmax,xneu,gamma;
1061 G4double mp = 0.9382727;
1062 G4double mp2 = mp*mp;
1063 G4double alpha = 1.0/137.036;
1064 G4double mpion = 0.135;
1066 G4double xval[101]={ 0,
1067 0.12286E+01,0.15200E+01,0.15053E+01,0.16960E+01,0.16466E+01,
1068 0.14055E+01,0.12247E+00,0.22000E+00,0.84591E-01,0.90400E-01,
1069 0.16956E+00,0.29002E+00,0.74046E+01,0.65122E+01,0.58506E+01,
1070 0.16990E+01,0.45729E+01,0.53546E+03,-.97628E+03,0.82539E+05,
1071 0.29494E+01,0.20352E+01,0.12422E+00,0.19560E+01,0.22333E+01,
1072 -.32484E+00,0.24212E+00,0.57737E-01,0.30497E+01,0.63111E+01,
1073 0.37579E+00,0.41100E+01,0.20668E-01,0.45490E+03,0.54493E-01,
1074 0.22565E+01,0.40369E+01,0.43734E+00,0.65625E+00,0.36182E+00,
1075 0.55216E-01,0.41789E+00,0.18104E+00,0.91306E+00,0.18116E+01,
1076 0.24152E+03,0.19329E+01,0.38000E+00,0.28732E+01,-.53116E+00,
1077 0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,
1078 0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,
1079 0.00000E+00,0.00000E+00,0.99495E+01,0.70370E-02,0.16172E+01,
1080 0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,
1081 0.20782E+05,0.79523E+04,0.54933E+00,0.00000E+00,0.68629E+01,
1082 0.10369E+01,0.88112E+00,0.00000E+00,0.35659E+03,0.20281E-02,
1083 0.40336E+02,0.00000E+00,0.45242E+00,0.20000E-01,0.28691E+00,
1084 0.00000E+00,0.25115E+03,0.10663E+01,0.55422E+01,0.30350E+00,
1085 0.10541E+01,0.20527E+01,0.00000E+00,0.00000E+00,0.13055E+02,
1086 0.27997E+01,0.39546E+00,0.46372E+00,0.49972E+01,0.00000E+00};
1090 G4double sin_t2 = sin(t2);
1091 G4double tan_t2 = tan(t2);
1092 G4double sin2_t2 = sin_t2*sin_t2;
1093 G4double tan2_t2 = tan_t2*tan_t2;
1094 G4double sigma_eep = 0.0;
1095 epmax = eni-mpion*(1.0+0.5*mpion/mp);
1096 epmax = epmax/(1.0+(2.0*eni/mp)*sin2_t2);
1101 q2 = 4.0*eni*eprime*sin2_t2;
1103 w2 = mp2 + 2.0*mp*xneu - q2;
1104 epsilon = 1.0/(1.0+2.0*(1.0+xneu*xneu/q2)*tan2_t2);
1105 gamma = alpha*eprime*(w2-mp2)/((2.0*pi)*(2.0*pi));
1106 gamma = gamma/(q2*mp*eni*(1.0-epsilon));
1112 xvalL[i] = xval[50+i];
1114 xvalL[i] = xval1[i];
1117 xvalL[43] = xval1[47];
1118 xvalL[44] = xval1[48];
1119 xvalL[50] = xval1[50];
1123 sigma_eep=sigT+epsilon*sigL;
1124 sigma_eep=sigma_eep*gamma;
1134 G4double xb,mass[8],width[8];
1135 G4double height[8],rescoef[7][5];
1136 G4double nr_coef[4][5],sigr[8],sig_nr;
1137 G4double intwidth[8],k,kcm,kr[8],kcmr[8],ppicm,ppi2cm;
1138 G4double petacm,ppicmr[8],ppi2cmr[8],petacmr[8],epicmr[8],epi2cmr[8];
1139 G4double eetacmr[8],epicm,epi2cm,eetacm,br[8][4],ang[8];
1140 G4double pgam[8],pwid[8][4],x0[8],q20;
1141 G4double sig_res,t,xpr[3],m0;
1144 G4double xt,p1,p2,p3;
1146 G4double mp = 0.9382727;
1147 G4double mpi = 0.135;
1148 G4double meta = 0.547;
1149 G4double mp2 = mp*mp;
1150 G4double w = sqrt(w2);
1188 br[i][2] = 1.-br[i][1]-br[i][3];
1209 br[i][2] = 1.-br[i][1]-br[i][3];
1215 xb = q2/(q2+w2-mp2);
1216 xpr[1] = 1.+(w2-(mp+mpi)*(mp+mpi))/(q2+q20);
1218 xpr[2] = 1.+(w2-(mp+mpi+mpi)*(mp+mpi+mpi))/(q2+q20);
1221 t = log(log((q2+m0)/0.330*0.330)/log(m0/0.330*0.330));
1225 k = (w2 - mp2)/2./mp;
1226 kcm = (w2-mp2)/2./w;
1228 epicm = (w2 + mpi*mpi -mp2 )/2./w;
1229 ppicm = sqrt(fmax(0.0,(epicm*epicm - mpi*mpi)));
1230 epi2cm = (w2 + (2.*mpi)*(2.*mpi) -mp2 )/2./w;
1231 ppi2cm = sqrt(fmax(0.0,(epi2cm*epi2cm - (2.*mpi)*(2.*mpi))));
1232 eetacm = (w2 + meta*meta -mp2 )/2./w;
1233 petacm = sqrt(fmax(0.0,(eetacm*eetacm - meta*meta)));
1246 intwidth[i] = xval[num];
1247 width[i] = intwidth[i];
1253 intwidth[7] = xval[44];
1254 width[7] = intwidth[7];
1259 intwidth[7] = xval[48];
1260 width[7] = intwidth[7];
1265 kr[i] = (mass[i]*mass[i]-mp2)/2./mp;
1266 kcmr[i] = (mass[i]*mass[i]-mp2)/2./mass[i];
1267 epicmr[i] = (mass[i]*mass[i] + mpi*mpi -mp2 )/2./mass[i];
1268 ppicmr[i] = sqrt(fmax(0.0,(epicmr[i]*epicmr[i] - mpi*mpi)));
1269 epi2cmr[i] = (mass[i]*mass[i] + (2.*mpi)*(2.*mpi) -mp2 )/2./mass[i];
1270 ppi2cmr[i] = sqrt(fmax(0.0,(epi2cmr[i]*epi2cmr[i] - (2.*mpi)*(2.*mpi))));
1271 eetacmr[i] = (mass[i]*mass[i] + meta*meta -mp2 )/2./mass[i];
1272 petacmr[i] = sqrt(fmax(0.0,(eetacmr[i]*eetacmr[i] - meta*meta)));
1275 pwid[i][1] = intwidth[i]*pow(ppicm/ppicmr[i],(2.*ang[i]+1.))
1276 *pow((ppicmr[i]*ppicmr[i]+x0[i]*x0[i])/(ppicm*ppicm+x0[i]*x0[i]),ang[i]);
1279 pwid[i][2] = intwidth[i]*pow(ppi2cm/ppi2cmr[i],(2.*ang[i]+4.))
1280 *pow((ppi2cmr[i]*ppi2cmr[i]+x0[i]*x0[i])/(ppi2cm*ppi2cm+x0[i]*x0[i]),(ang[i]+2));
1283 pwid[i][2] = w/mass[i]*pwid[i][2];
1288 pwid[i][3]=intwidth[i]*pow(petacm/petacmr[i],(2.*ang[i]+1.))
1289 *pow((petacmr[i]*petacmr[i]+x0[i]*x0[i])/(petacm*petacm+x0[i]*x0[i]),ang[i]);
1293 pgam[i] = (kcm/kcmr[i])*(kcm/kcmr[i])*(kcmr[i]*kcmr[i]+x0[i]*x0[i])/(kcm*kcm+x0[i]*x0[i]);
1294 pgam[i] = intwidth[i]*pgam[i];
1295 width[i] = br[i][1]*pwid[i][1]+br[i][2]*pwid[i][2]+br[i][3]*pwid[i][3];
1305 rescoef[i][j]=xval[num];
1310 height[i] = rescoef[i][1]*(1.+rescoef[i][2]*q2/(1.+rescoef[i][3]*q2))/ pow(1.+q2/0.91,rescoef[i][4]);
1314 height[i] = rescoef[i][1]*q2/(1.+rescoef[i][2]*q2)*exp(-1.*rescoef[i][3]*q2);
1317 height[i] = height[i]*height[i];
1323 height[7] = xval[45]*q2/(1.+xval[46]*q2)*exp(-1.*xval[47]*q2);
1327 height[7] = xval[49]/(1.+q2/0.91);
1330 height[7] = height[7]*height[7];
1339 nr_coef[i][j]=xval[num];
1348 sigr[i] = width[i]*pgam[i]/((w2 - mass[i]*mass[i])*(w2 - mass[i]*mass[i])
1349 + (mass[i]*width[i])*(mass[i]*width[i]));
1350 sigr[i] = height[i]*kr[i]/k*kcmr[i]/kcm*sigr[i]/intwidth[i];
1351 sig_res = sig_res + sigr[i];
1353 sig_res = sig_res*w;
1360 xt = (q2+xval[37])/(w2-1.15+q2+xval[37]);
1361 p2 = xval[38]*exp(-1.*xval[39]*q2)+xval[40]*log(q2/xval[41]+1.);
1362 p3 = xval[42]*exp(-1.*xval[43]*q2)+xval[44]*log(q2/xval[45]+1.);
1363 p1 = xval[46]*(1.+xval[50]*q2/(1.+0.534*q2));
1365 sig_nr = p1*pow(xt,p2)*pow(1.-xt,p3);
1372 sig_nr = sig_nr + nr_coef[i][1]*pow(1.-xpr[i],(nr_coef[i][3]+nr_coef[i][2]*t)) /(1.-xb)/(q2+q20)
1373 *pow(q2/(q2+q20), nr_coef[i][4]) *pow(xpr[i],(xval[41]+xval[42]*t));
1377 G4double sig = sig_res + sig_nr;
1390 G4double &E_out1, G4double &E_out2, G4double &theta2,
1391 G4double &q2, G4double &fWeightN, G4double &asymmetry)
1393 G4double alpha = 1.0/137.036;
1394 G4double G_F = 1.166e-11;
1395 G4double M_electron = 0.511;
1396 G4double sin2_theta_W = 0.02381;
1398 G4double theta_CM = 2.0*atan(tan(theta1)*sqrt((E_in+M_electron)/(2.*M_electron)));
1399 E_out1 = M_electron+(E_in-M_electron)*(cos(theta_CM/2.0)*cos(theta_CM/2.0));
1400 E_out2 = E_in - E_out1 + M_electron;
1401 theta2 = atan(2.0*M_electron/(E_in+M_electron)/tan(theta1));
1405 q2 = 2*M_electron*(M_electron+E_in)*sin(theta_CM/2.0)*sin(theta_CM/2.0);
1408 G4double Xsect = pow((1+cos(theta_CM))*(3+cos(theta_CM)*cos(theta_CM)),2);
1410 Xsect = (1.99e4)*Xsect/pow(sin(theta_CM),4);
1411 fWeightN = Xsect*sin(theta1);
1412 asymmetry = -M_electron*E_in*(G_F/(sqrt(2.0)*alpha*3.1415927))
1413 *16*sin(theta_CM)*sin(theta_CM)/(3+cos(theta_CM)*cos(theta_CM))*(1-4*sin2_theta_W);
1414 asymmetry = asymmetry*1e6;
1440 Double_t value[
value_n] = {0.0};
1441 std::vector< G4double > CrossSection;
1442 G4double xsec = 0.0;
1462 const Double_t pos[
value_d] = {Zpos,E_in,E_out,Theta};
1468 fWeightN = value[6]*sin(Theta*degree);
1473 CrossSection.push_back(value[6]*0.001);
1474 CrossSection.push_back(value[2]*0.001);
1475 CrossSection.push_back(value[3]*0.001);
1476 CrossSection.push_back(value[4]*0.001);
1477 CrossSection.push_back(value[6]*0.001);
1478 CrossSection.push_back(value[7]*0.001);
1479 CrossSection.push_back(value[8]*0.001);
1480 CrossSection.push_back(value[9]*0.001);
1481 CrossSection.push_back(value[11]*0.001);
1482 CrossSection.push_back(value[12]*0.001);
1483 CrossSection.push_back(value[14]*0.001);
1484 CrossSection.push_back(value[13]*0.001);
1485 CrossSection.push_back(0.0);
1489 CrossSection[12] = xsec/(ElasticPeakDeltaE*0.001);
1490 CrossSection[5] = 0.0;
1492 CrossSection[4] = CrossSection[5] + CrossSection[6] + CrossSection[7] + CrossSection[12];
1493 CrossSection[0] = CrossSection[4];
1495 return CrossSection;
1516 if (E_out > E_elastic) {
1551 G4cout <<
"---> Calling CreateLookupTable() <---" << G4endl;
1554 if (energy != 3350*MeV && energy != 1160*MeV && energy != 877*MeV) {
1555 G4cout <<
"#### Current beam energy is not a valid choice for lookup table" << G4endl;
1556 G4cout <<
"#### Setting beam energy to default value for lookup table (3.35 GeV)" << G4endl;
1574 TString filename =
"radiative_cross_section_";
1577 filename += (Int_t)energy;
1580 if (energy != 3350*MeV) filename +=
"_v2";
1583 TString filepath =
"./radiative_lookup_tables/";
1586 in.open(filepath + filename);
1587 if (!in.is_open()) {
1588 G4cout <<
"#### Failed to open lookup table data file \"" << filepath << filename <<
"\"" << G4endl;
1594 G4cout <<
"#### Found lookup table data file \"" << filepath << filename <<
"\"" << G4endl;
1597 fLookupTable->ReadTextFile((filepath +filename).Data());
1599 G4cout <<
"+++++++++++++++++++++++++++++" << G4endl;
1600 G4cout <<
"++ Lookup Table Parameters ++" << G4endl;
1601 G4cout <<
"+++++++++++++++++++++++++++++" << G4endl;
1602 G4cout <<
"Beam Energy: " <<
fLookupTable->GetMinimum(1)/1000 <<
" GeV" << G4endl;
1603 G4cout <<
"Target: " << target << G4endl;
1604 G4cout <<
"E\' Lower Bound: " <<
fLookupTable->GetMinimum(2)/1000 <<
" GeV" << G4endl;
1605 G4cout <<
"E\' Upper Bound: " <<
fLookupTable->GetMaximum(2)/1000 <<
" GeV" << G4endl;
1606 G4cout <<
"Theta Lower Bound: " <<
fLookupTable->GetMinimum(3)/degree <<
" degrees" << G4endl;
1607 G4cout <<
"Theta Upper Bound: " <<
fLookupTable->GetMaximum(3)/degree <<
" degrees" << G4endl;
1608 G4cout <<
"+++++++++++++++++++++++++++++" << G4endl;
1614 G4cout <<
"---> Leaving CreateLookupTable() <---" << G4endl;
1847 G4cout <<
"---> Calling CheckLookupTableBounds() <---" << G4endl;
1850 G4cout <<
"!!!! Beam Energy is out of bounds" << G4endl;
1851 G4cout <<
"---> Changing Beam Energy to default value (" <<
fLookupTable->GetMinimum(1)/1000 <<
" GeV)" << G4endl;
1859 G4cout <<
"!!!! Minimum E\' is out of bounds" << G4endl;
1860 G4cout <<
"---> Changing Minimum E\' to lower bound (" <<
fLookupTable->GetMinimum(2)/1000 <<
" GeV)" << G4endl;
1864 G4cout <<
"!!!! Maximum E\' is out of bounds" << G4endl;
1865 G4cout <<
"---> Changing Maximum E\' to upper bound (" <<
fLookupTable->GetMaximum(2)/1000 <<
" GeV)" << G4endl;
1869 G4cout <<
"!!!! Minimum E\' greater than maximum E\'" << G4endl;
1870 G4cout <<
"---> Changing Minimum E\' to " <<
GetEPrime_Max()/1000 <<
" GeV" << G4endl;
1875 G4cout <<
"!!!! Minimum Theta is out of bounds" << G4endl;
1876 G4cout <<
"---> Changing Minimum Theta to lower bound (" <<
fLookupTable->GetMinimum(3)/degree <<
" degrees)" << G4endl;
1880 G4cout <<
"!!!! Maximum Theta is out of bounds" << G4endl;
1881 G4cout <<
"---> Changing Maximum Theta to upper bound (" <<
fLookupTable->GetMaximum(3)/degree <<
" degrees)" << G4endl;
1885 G4cout <<
"!!!! Minimum Theta greater than maximum Theta" << G4endl;
1886 G4cout <<
"---> Changing Minimum Theta to " <<
GetThetaAngle_Max() <<
" degrees" << G4endl;
1888 G4cout <<
"---> Leaving CheckLookupTableBounds() <---" << G4endl;
1901 G4double
M_p = 938.2796;
1903 G4double A_Al = 27.0;
1904 G4double M_Al = M_p*A_Al;
1907 G4double STH = sin(Theta/2.0);
1910 G4double ETA = 1.0+2.0*E_in*STH*STH/M_Al;
1913 Q2 = 4*E_in*E_out*STH*STH;
1915 Theta *= 180/3.14159;
1919 Theta *= 3.14159/180;
1921 fWeightN = xsect*sin(Theta);
1940 G4double
M_p = 938.272081;
1941 G4double Z_Al = 13.0;
1942 G4double N_Al = 14.0;
1943 G4double A_Al = 27.0;
1944 G4double M_Al = M_p*A_Al;
1946 G4double CTH = cos(Theta/2.0);
1947 G4double STH = sin(Theta/2.0);
1950 G4double ETA = 1.0+2.0*E_in*STH*STH/M_Al;
1952 Q2 = 4.0*E_in*E_out*STH*STH;
1955 G4double E_peak = 20.8;
1959 G4double mu = ((N_Al*Z_Al)/A_Al)*M_Al;
1961 G4double long_ratio = pow(N_Al/A_Al,2.0)/(2.0*mu)*Q2/E_peak;
1962 G4double tran_ratio = 0.5*pow(N_Al/A_Al,2.0)*(E_peak/mu)*((1.0+STH*STH)/(CTH*CTH));
1966 "horowitz_alloy_tables/elasticAl27.csv",
1971 G4double xsect = elasticAl*fac*(long_ratio + tran_ratio);
1973 fWeightN = xsect*sin(Theta);
1997 G4double M_A = 931.494 * MeV;
2002 G4double alpha_FS = 1.0/137.035999074;
2003 G4double m_e = 0.511 * MeV;
2006 G4double CTH = cos(Theta/2.0);
2007 G4double STH = sin(Theta/2.0);
2008 G4double ETA = 1.0+2.0*E_in*STH*STH/M;
2010 Q2 = 4*E_in*E_out*STH*STH;
2011 G4double myhbarc = hbarc / MeV / fermi;
2012 G4double q2 = Q2/(myhbarc*myhbarc);
2016 G4double SigmaMott = pow(alpha_FS*myhbarc*Z/(2.0*E_in),2);
2017 SigmaMott *= (CTH*CTH)/pow(STH,4)*(E_out/E_in)*10000;
2018 G4double FF = (1.0 - (q2*a*a)/9.0)*exp(-(q2*a*a)/4.0);
2019 G4double sigma = SigmaMott*FF*FF;
2021 G4double delta_Schwinger = 0.0;
2023 G4double FunctionofTheta = log (STH*STH) * log (CTH*CTH);
2024 delta_Schwinger = (-2.0*alpha_FS/pi) * ((log(E_in/
SchwingerDeltaE) - 13.0/12.0)
2025 * (log(Q2/(m_e*m_e)) - 1.0) + 17.0/36.0 + FunctionofTheta/2.0);
2027 sigma = sigma*(1.0 + delta_Schwinger);
2028 fWeightN = sigma*sin(Theta);
2045 G4double M_A = 931.494 * MeV;
2050 G4double E_peak = 24.0*MeV;
2051 G4double Energy_Integration_Factor = 6.5;
2056 G4double CTH = cos(Theta/2.0);
2057 G4double STH = sin(Theta/2.0);
2058 G4double ETA = 1.0+2.0*E_in*STH*STH/M;
2059 E_out = E_in/ETA-E_peak;
2060 Q2 = 4*E_in*E_out*STH*STH;
2063 G4double LongRatio = (N*Q2)/(2*A*Z*M*E_peak);
2064 G4double TranRatio = (N*E_peak)/(2*A*Z*M)*(1+STH*STH)/(CTH*CTH);
2065 G4double sigma_el =
AlloyScattering(E_in, Theta, Z, A, fWeightN, Q2, E_out);
2066 G4double sigma = (LongRatio+TranRatio)*sigma_el*Energy_Integration_Factor;
2079 fWeightN = sigma*sin(Theta);
2100 G4double M_A = 931.494 * MeV;
2104 G4double alpha_FS = 1.0/137.035999074;
2105 G4double myhbarc = hbarc / MeV / fermi;
2106 G4double m_e = 0.511 * MeV;
2107 G4double EState[3] = { 4.439*MeV,
2112 G4double CTH = cos(Theta/2.0);
2113 G4double STH = sin(Theta/2.0);
2114 G4double ETA = 1.0+2.0*E_in*STH*STH/M;
2115 E_out = E_in/ETA-EState[nState-1];
2116 Q2 = 4*E_in*E_out*STH*STH;
2117 G4double q = sqrt(Q2/(myhbarc*myhbarc));
2120 G4double SigmaMott = pow(alpha_FS*myhbarc*Z/(2.0*E_in),2);
2121 SigmaMott *= (CTH*CTH)/pow(STH,4)*(E_out/E_in)*10000;
2127 TF1* ff2 =
new TF1(
"4439",
"0.0147*exp(-3.25*(x-1.15)**2)",0.5,1.8);
2130 }
else if(nState==2) {
2131 TF1* ff2 =
new TF1(
"7654",
"0.0358*exp(-5.00*(x-0.96)**2)",0.5,1.8);
2134 }
else if(nState==3) {
2135 TF1* ff2 =
new TF1(
"9641",
"0.0526*exp(-2.45*(x-1.25)**2)",0.5,1.8);
2139 G4cout <<
"Please select from the first three states. nState = {1,2,3} only" << G4endl;
2143 G4double sigma = SigmaMott*FF2;
2146 G4double delta_Schwinger = 0.0;
2149 -0.5*log(E_in/E_out)*log(E_in/E_out) + 13.0/6.0*log(Q2/(m_e*m_e))
2152 sigma = sigma*(1.0 + delta_Schwinger);
2154 fWeightN = sigma*sin(Theta);
2175 const G4double Mpi = 139.57018*MeV;
2182 if(E_in < Mpi) E_in = Mpi;
2183 E_out = Mpi + G4UniformRand()*(E_in - Mpi);
2184 G4double pf = sqrt(pow(E_out,2.0) - pow(Mpi,2.0));
2187 G4double STH = sin(Theta/2.0);
2188 Q2 = 4.0*E_in*E_out*STH*STH;
2195 G4double intern_rad_len = 0.0204;
2204 G4double xsect = (1.0/1000.00) *
wiser_sigma(E_in/GeV, pf/GeV, Theta, rad_len, type);
2206 fWeightN = xsect*sin(Theta);
2223 const G4double Mpi = 139.57018*MeV;
2235 if(E_in < Mpi) E_in = Mpi;
2236 E_out = Mpi + G4UniformRand()*(E_in - Mpi);
2237 G4double pf = sqrt(pow(E_out,2.0) - pow(Mpi,2.0));
2240 G4double STH = sin(Theta/2.0);
2241 Q2 = 4.0*E_in*E_out*STH*STH;
2264 G4double Al_length = 0.0*mm;
2265 G4double lh2_length = 0.0*mm;
2280 G4double intern_rad_len = 0.0204;
2281 G4double rad_len = Al_length/(8.896*cm) + intern_rad_len + lh2_length/(866.0*cm);
2304 G4double xsect_proton = (1.0/1000.00) *
wiser_sigma(E_in/GeV, pf/GeV, Theta, rad_len, type);
2307 G4double xsect_neutron = (1.0/1000.00) *
wiser_sigma(E_in/GeV, pf/GeV, Theta, rad_len, 0);
2308 G4double xsect = 13.0*xsect_proton + 14.0*xsect_neutron;
2309 fWeightN = xsect*sin(Theta);
2326 const G4double Mpi = 0.13957*GeV;
2339 G4double pf = sqrt(pow(E_out,2) - pow(Mpi,2));
2345 G4double C_length = 0.0*mm;
2351 G4double intern_rad_len = 0.0204;
2352 G4double rad_len = C_length/(19.32*cm) + intern_rad_len;
2359 G4double xsect = (1.0/1000.00) *
wiser_sigma(E_in/GeV, pf/GeV, Theta, rad_len, type);
2361 fWeightN = xsect*sin(Theta);
2386 G4double xsect = 0.0;
2388 const G4double alpha = 1/137.035999139;
2389 const G4double
M_p = 938.272081;
2390 const G4double
M_n = 939.565413;
2391 const G4double m_e = 0.5109989461*MeV;
2392 const G4double Z_Al = 13.0;
2393 const G4double A_Al = 27.0;
2394 const G4double N_Al = A_Al-Z_Al;
2395 const G4double M_Al = M_p*Z_Al + M_n*N_Al;
2396 const G4double hbar_c = 197.3269788;
2397 const G4double R = 3.94;
2398 const G4double deltaE = 20.0*MeV;
2400 G4double STH = sin(Theta/2.0);
2401 G4double CTH = cos(Theta/2.0);
2404 G4double ETA = 1.0 + 2.0*(E_in/M_Al)*STH*STH;
2409 E_out = (E_in - E_lvl - ((E_lvl*E_lvl)/(2.0*M_Al)))/ETA;
2412 Q2 = 4.0*E_in*E_out*STH*STH;
2413 G4double q = sqrt(Q2/(hbar_c*hbar_c));
2417 G4double q_eff = q*(1.0 + (3.0*Z_Al*alpha*hbar_c)/(2.0*E_in*R));
2420 G4double sigma_mott = pow((Z_Al*alpha*hbar_c*CTH)/(2.0*E_in*STH*STH),2.0)/ETA;
2422 sigma_mott = 10000.0*sigma_mott;
2426 if((q_eff >= 0.3) && (q_eff <= 1.8)){
2427 FF2 = fit_c*exp(-0.5*pow((q_eff-fit_mean)/(fit_sigma),2.0));
2433 xsect = sigma_mott*FF2;
2438 G4double delta_Schwinger = 0.0;
2439 delta_Schwinger = (TMath::Log(TMath::Sqrt(E_in*E_out)/deltaE)-(13.0/12.0))*(TMath::Log(Q2/(m_e*m_e))-1.0);
2440 delta_Schwinger += (17.0/36.0) + 0.25*TMath::Log(E_in/E_out)*TMath::Log(E_in/E_out) + 0.5*((1.0/6.0)*TMath::Pi()*TMath::Pi()-TMath::DiLog(TMath::Cos(Theta/2.0)*TMath::Cos(Theta/2.0)));
2441 delta_Schwinger *= (2.0*alpha/TMath::Pi());
2443 xsect *= TMath::Exp(-delta_Schwinger);
2447 fWeightN = xsect*sin(Theta);
2466 const G4String path,
2471 const G4double M = 13.0*938.272081 + 14.0*939.565413;
2472 const G4double alpha = 1.0/137.035999139;
2473 const G4double deltaE = 20.0*MeV;
2474 const G4double m_e = 0.5109989461*MeV;
2476 G4double STH = sin(theta/2.0);
2477 G4double ETA = 1.0+2.0*(E_in/M)*STH*STH;
2479 Q2 = 4.0*E_in*E_out*STH*STH;
2482 G4double radtodeg = (180.0/TMath::Pi());
2483 G4double xsect = 0.0;
2484 TGraph *graph =
new TGraph(path,
"%lg %lg %*lg",
",");
2485 graph->SetBit(graph->kIsSortedX);
2487 if((theta*radtodeg) >= 4.0 && (theta*radtodeg) <= 13.5)
2489 xsect = graph->Eval((theta*radtodeg), 0,
"S");
2494 G4double delta_Schwinger = 0.0;
2495 delta_Schwinger = (TMath::Log(E_in/deltaE)-(13.0/12.0))*(TMath::Log(Q2/(m_e*m_e))-1.0);
2496 delta_Schwinger += (17.0/36.0) + 0.5*((1.0/6.0)*TMath::Pi()*TMath::Pi()-TMath::DiLog(TMath::Cos(theta/2.0)*TMath::Cos(theta/2.0)));
2497 delta_Schwinger *= (2.0*alpha/TMath::Pi());
2499 xsect *= TMath::Exp(-delta_Schwinger)*1000.0;
2501 fWeightN = xsect*sin(theta);
2507 const G4String path)
2509 G4double radtodeg = (180.0/3.1415927);
2510 G4double asym = 0.0;
2511 TGraph *graph =
new TGraph(path,
"%lg %*lg %lg",
",");
2512 graph->SetBit(graph->kIsSortedX);
2513 if((theta*radtodeg) >= 4.0 && (theta*radtodeg) <= 13.5)
2515 asym = graph->Eval((theta*radtodeg), 0,
"S");
2539 G4double xsect = 0.0;
2541 G4double Eout = 0.0;
2545 G4double M_electron = 0.000511;
2546 G4double Mp = 0.93828;
2553 Eout = M_electron + G4UniformRand()*(Ein - M_electron);
2555 G4double CTH = cos(Theta/2.0);
2556 G4double STH = sin(Theta/2.0);
2557 G4double T2THE = STH*STH/CTH/CTH;
2558 G4double Nu = Ein - Eout;
2559 Q2 = 4.0*Ein*Eout*STH*STH;
2560 Wsq = Mp*Mp + 2.0*Mp*Nu - Q2;
2563 G4double MOTT = pow((0.00072/Ein*CTH/STH/STH),2);
2569 F1F2QE09(Zin, Ain, Q2, Wsq, F1, F2);
2573 xsect = MOTT*(W2 + 2.0*T2THE*W1)*(Ein - M_electron);
2577 if (xsect <= 0) xsect = 0.0;
2581 fWeightN = xsect*sin(Theta);
2607 G4double xsect = 0.0;
2609 G4double Eout = 0.0;
2613 G4double M_electron = 0.000511;
2614 G4double Mp = 0.93828;
2621 Eout = M_electron + G4UniformRand()*(Ein - M_electron);
2623 G4double CTH = cos(Theta/2.0);
2624 G4double STH = sin(Theta/2.0);
2625 G4double T2THE = STH*STH/CTH/CTH;
2626 G4double Nu = Ein - Eout;
2627 Q2 = 4.0*Ein*Eout*STH*STH;
2628 Wsq = Mp*Mp + 2.0*Mp*Nu - Q2;
2631 G4double MOTT = pow((0.00072/Ein*CTH/STH/STH),2);
2637 F1F2IN09(Zin, Ain, Q2, Wsq, F1, F2);
2641 xsect = MOTT*(W2 + 2.0*T2THE*W1)*(Ein - M_electron);
2647 if (xsect <= 0) xsect = 0.0;
2649 fWeightN = xsect*sin(Theta);
2660 G4double wsq, G4double &F1, G4double &F2)
2686 G4double avgN, Pauli_sup1, Pauli_sup2, GEP, GEN, GMP, GMN, Q, Q3, Q4;
2687 G4double amp = 0.93828;
2688 G4double amd = 1.8756;
2689 G4double RMUP = 2.792782;
2690 G4double RMUN = -1.913148;
2691 G4double pz, Nu, dpz, pznom, pzmin;
2692 G4double QV, TAU, FY, dwmin, w2p;
2693 G4double kappa, lam, lamp, taup, squigglef, psi, psip, nuL, nuT;
2694 G4double kf, Es, GM2bar, GE2bar, W2bar, Delta, GL, GT;
2695 G4int izz, izzmin, izp, izznom, izdif;
2698 G4double fyd[200] = {
2699 0.00001,0.00002,0.00003,0.00005,0.00006,0.00009,0.00010,0.00013,
2700 0.00015,0.00019,0.00021,0.00026,0.00029,0.00034,0.00038,0.00044,
2701 0.00049,0.00057,0.00062,0.00071,0.00078,0.00089,0.00097,0.00109,
2702 0.00119,0.00134,0.00146,0.00161,0.00176,0.00195,0.00211,0.00232,
2703 0.00252,0.00276,0.00299,0.00326,0.00352,0.00383,0.00412,0.00447,
2704 0.00482,0.00521,0.00560,0.00603,0.00648,0.00698,0.00747,0.00803,
2705 0.00859,0.00921,0.00985,0.01056,0.01126,0.01205,0.01286,0.01376,
2706 0.01467,0.01569,0.01671,0.01793,0.01912,0.02049,0.02196,0.02356,
2707 0.02525,0.02723,0.02939,0.03179,0.03453,0.03764,0.04116,0.04533,
2708 0.05004,0.05565,0.06232,0.07015,0.07965,0.09093,0.10486,0.12185,
2709 0.14268,0.16860,0.20074,0.24129,0.29201,0.35713,0.44012,0.54757,
2710 0.68665,0.86965,1.11199,1.43242,1.86532,2.44703,3.22681,4.24972,
2711 5.54382,7.04016,8.48123,9.40627,9.40627,8.48123,7.04016,5.54382,
2712 4.24972,3.22681,2.44703,1.86532,1.43242,1.11199,0.86965,0.68665,
2713 0.54757,0.44012,0.35713,0.29201,0.24129,0.20074,0.16860,0.14268,
2714 0.12185,0.10486,0.09093,0.07965,0.07015,0.06232,0.05565,0.05004,
2715 0.04533,0.04116,0.03764,0.03453,0.03179,0.02939,0.02723,0.02525,
2716 0.02356,0.02196,0.02049,0.01912,0.01793,0.01671,0.01569,0.01467,
2717 0.01376,0.01286,0.01205,0.01126,0.01056,0.00985,0.00921,0.00859,
2718 0.00803,0.00747,0.00698,0.00648,0.00603,0.00560,0.00521,0.00482,
2719 0.00447,0.00412,0.00383,0.00352,0.00326,0.00299,0.00276,0.00252,
2720 0.00232,0.00211,0.00195,0.00176,0.00161,0.00146,0.00134,0.00119,
2721 0.00109,0.00097,0.00089,0.00078,0.00071,0.00062,0.00057,0.00049,
2722 0.00044,0.00038,0.00034,0.00029,0.00026,0.00021,0.00019,0.00015,
2723 0.00013,0.00010,0.00009,0.00006,0.00005,0.00003,0.00002,0.00001};
2725 G4double avp2[200] = {
2726 1.0,0.98974,0.96975,0.96768,0.94782,0.94450,0.92494,0.92047,
2727 0.90090,0.89563,0.87644,0.87018,0.85145,0.84434,0.82593,0.81841,
2728 0.80021,0.79212,0.77444,0.76553,0.74866,0.73945,0.72264,0.71343,
2729 0.69703,0.68740,0.67149,0.66182,0.64631,0.63630,0.62125,0.61154,
2730 0.59671,0.58686,0.57241,0.56283,0.54866,0.53889,0.52528,0.51581,
2731 0.50236,0.49291,0.47997,0.47063,0.45803,0.44867,0.43665,0.42744,
2732 0.41554,0.40656,0.39511,0.38589,0.37488,0.36611,0.35516,0.34647,
2733 0.33571,0.32704,0.31656,0.30783,0.29741,0.28870,0.27820,0.26945,
2734 0.25898,0.25010,0.23945,0.23023,0.21943,0.20999,0.19891,0.18911,
2735 0.17795,0.16793,0.15669,0.14667,0.13553,0.12569,0.11504,0.10550,
2736 0.09557,0.08674,0.07774,0.06974,0.06184,0.05484,0.04802,0.04203,
2737 0.03629,0.03129,0.02654,0.02247,0.01867,0.01545,0.01251,0.01015,
2738 0.00810,0.00664,0.00541,0.00512,0.00512,0.00541,0.00664,0.00810,
2739 0.01015,0.01251,0.01545,0.01867,0.02247,0.02654,0.03129,0.03629,
2740 0.04203,0.04802,0.05484,0.06184,0.06974,0.07774,0.08674,0.09557,
2741 0.10550,0.11504,0.12569,0.13553,0.14667,0.15669,0.16793,0.17795,
2742 0.18911,0.19891,0.20999,0.21943,0.23023,0.23945,0.25010,0.25898,
2743 0.26945,0.27820,0.28870,0.29741,0.30783,0.31656,0.32704,0.33571,
2744 0.34647,0.35516,0.36611,0.37488,0.38589,0.39511,0.40656,0.41554,
2745 0.42744,0.43665,0.44867,0.45803,0.47063,0.47997,0.49291,0.50236,
2746 0.51581,0.52528,0.53889,0.54866,0.56283,0.57241,0.58686,0.59671,
2747 0.61154,0.62125,0.63630,0.64631,0.66182,0.67149,0.68740,0.69703,
2748 0.71343,0.72264,0.73945,0.74866,0.76553,0.77444,0.79212,0.80021,
2749 0.81841,0.82593,0.84434,0.85145,0.87018,0.87644,0.89563,0.90090,
2750 0.92047,0.92494,0.94450,0.94782,0.96768,0.96975,0.98974,1.0};
2764 5.1377e-03, 9.8071e-01, 4.6379e-02, 1.6433e+00,
2765 6.9826e+00, -2.2655e-01, 1.1095e-01, 2.7945e-02,
2766 4.0643e-01, 1.6076e+00, -7.5460e+00, 4.4418e+00,
2767 -3.7464e-01, 1.0414e-01, -2.6852e-01, 9.6653e-01,
2768 -1.9055e+00, 9.8965e-01, 2.0613e+02, -4.5536e-02,
2769 2.4902e-01, -1.3728e-01, 2.9201e+01, 4.9280e-03};
2779 Nu = (wsq - amp*amp + QSQ) / 2. / amp;
2782 if(Nu <= 0.0 || QSQ < 0.)
return;
2783 TAU = QSQ / 4.0 / amp / amp;
2784 QV = sqrt(Nu*Nu + QSQ);
2790 GEP = 1./ (1. + 0.14 * Q + 3.01 * QSQ + 0.02 * Q3 + 1.20 * Q4 + 0.32 * pow(Q,5));
2792 GMN = RMUN / (1.- 1.74 * Q + 9.29 * QSQ - 7.63 * Q3 + 4.63 * Q4);
2793 GEN = 1.25 * RMUN * TAU / (1. + 18.3 * TAU) / pow((1. + QSQ / 0.71),2);
2800 if(IA==2) Es=0.0022;
2803 if(IA==3) Es=0.001 ;
2825 if ((QV > 2.* kf) || (IA == 1)) {
2828 Pauli_sup2 = 0.75 * (QV / kf) * (1.0 - (pow((QV / kf),2))/12.);
2830 Pauli_sup1 = Pauli_sup2;
2835 kappa = QV / 2. / amp;
2836 lam = Nu / 2. / amp;
2837 lamp = lam - Es / 2. / amp;
2838 taup = kappa*kappa - lamp*lamp;
2839 squigglef = sqrt(1. + pow((kf/amp),2)) -1.;
2842 if(1.+lamp <= 0.)
return;
2843 if(taup * (1. + taup) <= 0.)
return;
2845 psi = (lam - TAU ) / sqrt(squigglef) / sqrt((1.+lam )* TAU + kappa * sqrt(TAU * (1. + TAU)));
2846 psip = (lamp - taup) / sqrt(squigglef) / sqrt((1.+lamp)*taup + kappa * sqrt(taup * (1. + taup)));
2847 nuL = pow((TAU / kappa / kappa),2);
2852 nuT = TAU / 2. / kappa / kappa;
2854 GM2bar = Pauli_sup1 * (Z * GMP*GMP + avgN * GMN*GMN);
2855 GE2bar = Pauli_sup2 * (Z * GEP*GEP + avgN * GEN*GEN);
2857 W2bar = (GE2bar + TAU * GM2bar) / (1. + TAU);
2859 Delta = squigglef * (1. - psi*psi) * (sqrt(TAU * (1.+TAU)) / kappa + squigglef/3. *
2860 (1. - psi*psi) * TAU / kappa / kappa);
2861 GL = kappa*kappa / TAU * (GE2bar + Delta * W2bar) / 2. / kappa / (1. + squigglef *
2862 (1. + psi*psi) / 2.);
2863 GT = (2. * TAU * GM2bar + Delta * W2bar) / 2. / kappa / (1. + squigglef *
2864 (1. + psi*psi) / 2.);
2875 FY = 1.5576 / (1. + 1.7720*1.7720 * pow((psip + 0.3014),2)) / (1. + exp(-2.4291 * psip)) / kf;
2882 pz = (QSQ - 2. * amp * Nu ) / 2. / QV;
2883 izz = int((pz + 1.0) / 0.01) + 1;
2884 if (izz < 1) izz = 1;
2885 if (izz > 200) izz = 200;
2890 dpz = avp2[izznom] / 2. / QV;
2896 if ((izznom + izdif) < 1) izpmax = 1;
2897 if (izpmax > 200) izpmax = 200;
2898 for (izp = izznom; izp <= izpmax; izp++) {
2899 pz = -1. + 0.01 * (izp-0.5);
2904 w2p = pow((amd + Nu - amp ),2) - QV*QV + 2. * QV * pz - avp2[izp];
2907 if (abs(w2p - amp*amp) > dwmin) {
2908 if (izzmin < 2) izzmin = 2;
2909 if (izzmin > 199) izzmin = 199;
2911 }
else if (abs(w2p - amp*amp) < dwmin) {
2912 dwmin = abs(w2p - amp*amp);
2918 pznom = -1. + 0.01 * (izz-0.5);
2920 for (izp = 1; izp <= 19; izp++) {
2921 pz = pznom - 0.01 + 0.001 * izp;
2926 w2p = pow((amd + Nu - amp ),2) - QV*QV + 2. * QV * pz - avp2[izz];
2927 if (abs(w2p - amp*amp) < dwmin) {
2928 dwmin = abs(w2p - amp*amp);
2933 if (dwmin >= 1.e6 || abs(pznom-pzmin) > 0.01) {
2936 if (pzmin < pznom) FY = fyd[izz] - (fyd[izz-1] - fyd[izz]) * (pzmin - pznom) / 0.01;
2937 else FY = fyd[izz] + (fyd[izz+1] - fyd[izz]) * (pzmin - pznom) / 0.01;
2943 F2 = Nu * FY * (nuL * GL + nuT * GT);
2944 F1 = amp * FY * GT / 2.;
2949 if (F1 < 0.0) F1 = 0.;
2950 if (Nu > 0. && F1 > 0.) R = (F2 / Nu) / (F1 / amp) * (1. + Nu*Nu / QSQ) - 1.0;
2956 y = (wsq -amp*amp) / QV;
2964 F1=F1*(1.0+P[7]+P[8]*y+P[9]*y*y +P[10]*pow(y,3) +P[11]*pow(y,4));
2965 R = R * ( 1.0 + P[12] );
2966 F2 = Nu * F1/amp * (1. + R) / (1. + Nu*Nu/QSQ);
2967 if (F1 < 0.0) F1=0.0;
2975 G4double wsq, G4double &F1, G4double &F2)
2993 G4double nu,siglp,sigtp,F1pp,F1dp;
2994 G4double W1,W2,sigt,Rc,sigl,F1d, F1p,qv;
2995 G4double DW2DPF,Wsqp,pf,kf,Es,dw2des,Fyuse;
2996 G4double x4, emcfac;
2998 G4double PM = 0.93828;
3001 G4double XXp[99] = {
3002 -3.000,-2.939,-2.878,-2.816,-2.755,-2.694,-2.633,-2.571,-2.510,
3003 -2.449,-2.388,-2.327,-2.265,-2.204,-2.143,-2.082,-2.020,-1.959,
3004 -1.898,-1.837,-1.776,-1.714,-1.653,-1.592,-1.531,-1.469,-1.408,
3005 -1.347,-1.286,-1.224,-1.163,-1.102,-1.041,-0.980,-0.918,-0.857,
3006 -0.796,-0.735,-0.673,-0.612,-0.551,-0.490,-0.429,-0.367,-0.306,
3007 -0.245,-0.184,-0.122,-0.061, 0.000, 0.061, 0.122, 0.184, 0.245,
3008 0.306, 0.367, 0.429, 0.490, 0.551, 0.612, 0.673, 0.735, 0.796,
3009 0.857, 0.918, 0.980, 1.041, 1.102, 1.163, 1.224, 1.286, 1.347,
3010 1.408, 1.469, 1.531, 1.592, 1.653, 1.714, 1.776, 1.837, 1.898,
3011 1.959, 2.020, 2.082, 2.143, 2.204, 2.265, 2.327, 2.388, 2.449,
3012 2.510, 2.571, 2.633, 2.694, 2.755, 2.816, 2.878, 2.939, 3.000};
3014 G4double fyp[99] = {
3015 0.0272,0.0326,0.0390,0.0464,0.0551,0.0651,0.0766,0.0898,0.1049,
3016 0.1221,0.1416,0.1636,0.1883,0.2159,0.2466,0.2807,0.3182,0.3595,
3017 0.4045,0.4535,0.5066,0.5637,0.6249,0.6901,0.7593,0.8324,0.9090,
3018 0.9890,1.0720,1.1577,1.2454,1.3349,1.4254,1.5163,1.6070,1.6968,
3019 1.7849,1.8705,1.9529,2.0313,2.1049,2.1731,2.2350,2.2901,2.3379,
3020 2.3776,2.4090,2.4317,2.4454,2.4500,2.4454,2.4317,2.4090,2.3776,
3021 2.3379,2.2901,2.2350,2.1731,2.1049,2.0313,1.9529,1.8705,1.7849,
3022 1.6968,1.6070,1.5163,1.4254,1.3349,1.2454,1.1577,1.0720,0.9890,
3023 0.9090,0.8324,0.7593,0.6901,0.6249,0.5637,0.5066,0.4535,0.4045,
3024 0.3595,0.3182,0.2807,0.2466,0.2159,0.1883,0.1636,0.1416,0.1221,
3025 0.1049,0.0898,0.0766,0.0651,0.0551,0.0464,0.0390,0.0326,0.0272};
3028 G4double xvald0[50] = {
3029 0.1964E+01, 0.1086E+01, 0.5313E-02, 0.1265E+01, 0.8000E+01,
3030 0.2979E+00, 0.1354E+00, 0.2200E+00, 0.8296E-01, 0.9578E-01,
3031 0.1094E+00, 0.3794E+00, 0.8122E+01, 0.5189E+01, 0.3290E+01,
3032 0.1870E+01, 0.6110E+01,-0.3464E+02, 0.9000E+03, 0.1717E+01,
3033 0.4335E-01, 0.1915E+03, 0.2232E+00, 0.2119E+01, 0.2088E+01,
3034 -0.3029E+00, 0.2012E+00, 0.1104E-02, 0.2276E-01,-0.4562E+00,
3035 0.2397E+00, 0.1204E+01, 0.2321E-01, 0.5419E+03, 0.2247E+00,
3036 0.2168E+01, 0.2266E+03, 0.7649E-01, 0.1457E+01, 0.1318E+00,
3037 -0.7534E+02, 0.1776E+00, 0.1636E+01, 0.1350E+00,-0.5596E-02,
3038 0.5883E-02, 0.1934E+01, 0.3800E+00, 0.3319E+01, 0.1446E+00};
3041 5.1377e-03, 9.8071e-01, 4.6379e-02, 1.6433e+00,
3042 6.9826e+00, -2.2655e-01, 1.1095e-01, 2.7945e-02,
3043 4.0643e-01, 1.6076e+00, -7.5460e+00, 4.4418e+00,
3044 -3.7464e-01, 1.0414e-01, -2.6852e-01, 9.6653e-01,
3045 -1.9055e+00, 9.8965e-01, 2.0613e+02, -4.5536e-02,
3046 2.4902e-01, -1.3728e-01, 2.9201e+01, 4.9280e-03};
3049 nu = (wsq - PM*PM + qsq) / 2. / PM;
3050 qv = sqrt(nu*nu + qsq);
3056 x = qsq / (2.0 * PM * nu);
3058 if (wsq <= 0.0) x = 0.0;
3060 if (IA <= 2)
return;
3073 if(IA==2) Es=0.0022;
3076 if(IA==3) Es=0.001 ;
3101 dw2des = 2. * (nu + PM) ;
3103 for (ism = 0; ism < 99; ism++) {
3104 Fyuse = fyp[ism]/100.;
3105 Wsqp = wsq + XXp[ism] * pf * DW2DPF - Es * dw2des;
3108 resmodd(Wsqp,qsq,xvald0,F1dp);
3109 F1d = F1d + F1dp * Fyuse;
3110 F1p = F1p + F1pp * Fyuse;
3111 sigt = sigt + sigtp * Fyuse;
3112 sigl = sigl + siglp * Fyuse;
3117 if(sigt > 0.) Rc = sigl / sigt;
3118 W1 = (2. * Z * F1d + (IA - 2. * Z) * (2. * F1d - F1p)) / PM;
3119 W1= W1*(1.0+P[13]*x+P[14]*pow(x,2)+P[15]*pow(x,3)+P[16]*pow(x,4)+P[17]*pow(x,5));
3121 if(W > 0.0) W1=W1*pow((1.0+(P[20]*W+P[21]*pow(W,2))/(1.0+P[22]*qsq)),2);
3124 if(wsq > 0.0 ) Rc = Rc * ( 1.0 + P[6] + P[23]*IA );
3125 W2 = W1 * (1. + Rc) / (1. + nu*nu / qsq);
3127 x4 = qsq / 2. / PM / nu;
3129 F1 = PM * W1 * emcfac;
3130 F2 = nu * W2 * emcfac;
3138 G4double &R, G4double &sigT, G4double &sigL)
3144 G4double xval1[50],xvalL[50];
3146 G4double mp = .9382727;
3147 G4double mp2 = mp*mp;
3148 G4double alpha = 1./137.036;
3150 G4double xval[100] = {
3151 0.12298E+01,0.15304E+01,0.15057E+01,0.16980E+01,0.16650E+01,
3152 0.14333E+01,0.13573E+00,0.22000E+00,0.82956E-01,0.95782E-01,
3153 0.10936E+00,0.37944E+00,0.77805E+01,0.42291E+01,0.12598E+01,
3154 0.21242E+01,0.63351E+01,0.68232E+04,0.33521E+05,0.25686E+01,
3155 0.60347E+00,0.21240E+02,0.55746E-01,0.24886E+01,0.23305E+01,
3156 -.28789E+00,0.18607E+00,0.63534E-01,0.19790E+01,-.56175E+00,
3157 0.38964E+00,0.54883E+00,0.22506E-01,0.46213E+03,0.19221E+00,
3158 0.19141E+01,0.24606E+03,0.67469E-01,0.13501E+01,0.12054E+00,
3159 -.89360E+02,0.20977E+00,0.15715E+01,0.90736E-01,-.38495E-02,
3160 0.10362E-01,0.19341E+01,0.38000E+00,0.34187E+01,0.14462E+00,
3161 0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,
3162 0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,0.00000E+00,
3163 0.00000E+00,0.00000E+00,0.29414E+02,0.19910E+02,0.22587E+00,
3164 0.00000E+00,0.00000E+00,0.38565E+04,0.65717E+00,0.00000E+00,
3165 0.15792E+03,0.97046E+02,0.31042E+00,0.00000E+00,0.42160E+01,
3166 0.38200E-01,0.12182E+01,0.00000E+00,0.13764E+02,0.31393E+00,
3167 0.29997E+01,0.00000E+00,0.55124E+01,0.53743E-01,0.13091E+01,
3168 0.00000E+00,0.86746E+02,0.40864E-04,0.40294E+01,0.31285E+01,
3169 0.33403E+00,0.49623E+01,0.00000E+00,0.00000E+00,0.11000E+02,
3170 0.18951E+01,0.51376E+00,0.00000E+00,0.42802E+01,0.00000E+00};
3172 for (G4int i = 0; i<50; i++) {
3174 xvalL[i] = xval[50+i] ;
3175 if(i < 12) xvalL[i] = xval1[i];
3177 xvalL[42] = xval1[46];
3178 xvalL[43] = xval1[47];
3179 xvalL[49] = xval1[49];
3185 F1 = sigT*(w2-mp2)/8./pi/pi/alpha/0.3894e3;
3194 G4double xval[50], G4double &sig)
3199 G4double W,mp,mp2,mass[7],width[7];
3200 G4double height[7],rescoef[6][4];
3201 G4double nr_coef[3][4],wdif,sig_nr;
3203 G4double mpi,meta,intwidth[7],k,kcm,kr[7],kcmr[7],ppicm,ppi2cm;
3204 G4double petacm,ppicmr[7],ppi2cmr[7],petacmr[7],epicmr[7],epi2cmr[7];
3205 G4double eetacmr[7],epicm,epi2cm,eetacm,br[7][2],ang[7],sigrsv[7];
3206 G4double pgam[7],pwid[7][2],x0[7],dip;
3207 G4double sig_res,xpr,alpha,F1;
3210 G4double xval0[12] = {
3211 0.12298E+01,0.15304E+01,0.15057E+01,0.16980E+01,0.16650E+01,
3212 0.14333E+01,0.13573E+00,0.22000E+00,0.82956E-01,0.95782E-01,
3213 0.10936E+00,0.37944E+00
3226 if(w2 < 1.07327*1.07327 || w2 > 25 || q2 < 0.0 || q2 > 11.0) {
3227 G4cerr <<
"ERROR: " << __FILE__ <<
" line " << __LINE__ << G4endl;
3228 G4cerr <<
" W2/Q2 check failed: should be 1.07327^2<W2<25 and 0 < Q2 < 11" << G4endl;
3229 G4cerr <<
" but are w2 q2: " << w2 <<
" " << q2 << G4endl;
3252 for (i = 0; i < 7; i++) x0[i] = 0.215;
3256 for (i = 0; i < 7; i++) br[i][1] = 1.-br[i][0];
3265 for (i = 0; i < 6; i++) {
3269 for (i = 0; i < 6; i++) {
3271 intwidth[i] = xval0[num-1];
3277 intwidth[6] = 0.380;
3279 iw = G4int(1000.*sqrt(w2));
3280 W = 0.001 * (iw+0.5);
3282 wdif = W - (mp + mpi);
3285 k = (w2 - mp2) / 2. / mp;
3286 kcm = (w2 - mp2) / 2. / W;
3287 epicm = (w2 + mpi*mpi -mp2 ) / 2. / W;
3288 ppicm = pow(std::max(0.0,(epicm*epicm - mpi*mpi)),0.5);
3289 epi2cm = (w2 + pow((2.*mpi),2) -mp2 ) / 2. / W;
3290 ppi2cm = pow(std::max(0.0,(epi2cm*epi2cm - pow((2.*mpi),2))),0.5);
3291 eetacm = (w2 + meta*meta -mp2 ) / 2. / W;
3292 petacm = pow(std::max(0.0,(eetacm*eetacm - meta*meta)),0.5);
3293 for (i = 0; i < 7; i++) {
3294 kr[i] = (mass[i]*mass[i]-mp2)/2./mp;
3295 kcmr[i] = (mass[i]*mass[i]-mp2)/2./mass[i];
3296 epicmr[i] = (mass[i]*mass[i] + mpi*mpi -mp2 )/2./mass[i];
3297 ppicmr[i] = pow(std::max(0.0,(epicmr[i]*epicmr[i] - mpi*mpi)),0.5);
3298 epi2cmr[i] = (mass[i]*mass[i] + pow(2.*mpi,2) -mp2 )/2./mass[i];
3299 ppi2cmr[i] = pow(std::max(0.0,(epi2cmr[i]*epi2cmr[i] - pow((2.*mpi),2))),0.5);
3300 eetacmr[i] = (mass[i]*mass[i] + meta*meta -mp2 )/2./mass[i];
3301 petacmr[i] = pow(std::max(0.0,(eetacmr[i]*eetacmr[i] - meta*meta)),0.5);
3304 pwid[i][0] = intwidth[i]*pow((ppicm/ppicmr[i]),(2.*ang[i]+1.))*pow(((ppicmr[i]*ppicmr[i]+x0[i]*x0[i])/(ppicm*ppicm+x0[i]*x0[i])),ang[i]);
3307 pwid[i][1] = intwidth[i]*pow((ppi2cm/ppi2cmr[i]),(2.*ang[i]+4.))*
3308 pow(((ppi2cmr[i]*ppi2cmr[i]+x0[i]*x0[i])/(ppi2cm*ppi2cm+x0[i]*x0[i])),(ang[i]+2.))* W / mass[i];
3310 pwid[i][1] = intwidth[1]*pow((petacm/petacmr[i]),(2.*ang[i]+1.))*
3311 pow(((petacmr[i]*petacmr[i]+x0[i]*x0[i])/(petacm*petacm+x0[i]*x0[i])),ang[i]);
3313 pgam[i] = pow((kcm/kcmr[i]),2)*(kcmr[i]*kcmr[i]+x0[i]*x0[i])/(kcm*kcm+x0[i]*x0[i]);
3314 pgam[i] = intwidth[i]*pgam[i];
3315 width[i] = br[i][0]*pwid[i][0]+br[i][1]*pwid[i][1];
3316 sigr[i] = width[i] * pgam[i] / (pow(w2 - mass[i]*mass[i],2) + pow(mass[i]*width[i],2)) * kr[i] / k * kcmr[i] / kcm / intwidth[i];
3324 for (i = 0; i < 6; i++) {
3325 for (j = 0; j < 4; j++) {
3327 rescoef[i][j]=xval[num-1];
3331 for (i = 0; i < 2; i++) {
3332 for (j = 0; j < 4; j++) {
3334 nr_coef[i][j]=xval[num-1];
3340 for (i = 0; i < 6; i++) {
3341 height[i] = rescoef[i][0]*(1.+rescoef[i][1] * q2 / (1. + rescoef[i][2] * q2))/pow((1. + q2/0.91),rescoef[i][3]);
3343 dip = 1./pow((1. + q2 / 0.91),2);
3344 height[6] = xval[48]*dip;
3346 for (i = 0; i < 7; i++) {
3347 sigrsv[i] = height[i]*height[i] * sigr[i];
3348 sig_res = sig_res + sigrsv[i];
3351 sig_res = sig_res * sqrt(w2);
3356 xpr = 1.+(w2-pow(mp+mpi,2))/(q2+0.05);
3359 wdif = W - (mp + mpi);
3360 for (i = 0; i < 2; i++) {
3361 sig_nr = sig_nr +(nr_coef[i][0]*pow(wdif,((2*(i+1)+1)/2.)))/pow(q2+nr_coef[i][1],(nr_coef[i][2]+nr_coef[i][3]*q2+xval[44+i]*q2*q2));
3363 sig_nr = sig_nr * xpr;
3364 sig = sig_res + sig_nr;
3366 F1 = sig * (w2-mp2)/8./pi/pi/alpha/0.3894e3;
3374 G4double q2,G4double xval[50])
3377 G4double W,mp,mp2,xb;
3378 G4double mass[7] = {0,0,0,0,0,0,0};
3379 G4double width[7] = {0,0,0,0,0,0,0};
3380 G4double height[7] = {0,0,0,0,0,0,0};
3381 G4double intwidth[7] = {0,0,0,0,0,0,0};
3382 G4double rescoef[6][4];
3383 G4double nr_coef[3][4],sigr[7],wdif[2],sig_nr,h_nr[3];
3384 G4double mpi,meta,k,kcm,kr[7],kcmr[7],ppicm,ppi2cm;
3385 G4double petacm,ppicmr[7],ppi2cmr[7],petacmr[7],epicmr[7],epi2cmr[7];
3386 G4double eetacmr[7],epicm,epi2cm,eetacm,br[7][3],ang[7];
3387 G4double pgam[7],pwid[7][3],x0[7],q20;
3388 G4double sig_res,t,xpr[2],m0,sig;
3396 wdif[0] = W - (mp + mpi);
3397 wdif[1] = W - (mp + 2.*mpi);
3400 if(sf == 2) m0 = xval[48];
3427 for (i = 0; i < 7; i++) {
3428 br[i][1] = 1.-br[i][0]-br[i][2];
3440 for (i = 0; i < 7; i++) {
3446 xb = q2/(q2+w2-mp2);
3447 xpr[0] = 1.+(w2-pow((mp+mpi),2))/(q2+q20);
3449 xpr[1] = 1.+(w2-pow((mp+mpi+mpi),2))/(q2+q20);
3452 t = log(log((q2+m0)/0.330/0.330)/log(m0/0.330/0.330));
3456 k = (w2 - mp2)/2./mp;
3457 kcm = (w2-mp2)/2./W;
3459 epicm = (w2 + mpi*mpi -mp2 )/2./W;
3460 ppicm = pow(std::max(0.0,(epicm*epicm - mpi*mpi)),0.5);
3461 epi2cm = (w2 + pow((2.*mpi),2) -mp2 )/2./W;
3462 ppi2cm = pow(std::max(0.0,(epi2cm*epi2cm - pow((2.*mpi),2))),0.5);
3463 eetacm = (w2 + meta*meta -mp2 )/2./W;
3464 petacm = pow(std::max(0.0,(eetacm*eetacm - meta*meta)),0.5);
3468 for (i = 0; i < 6; i++) {
3472 for (i = 0; i < 6; i++) {
3474 intwidth[i] = xval[num-1];
3475 width[i] = intwidth[i];
3479 intwidth[6] = xval[43];
3480 width[6] = intwidth[6];
3483 intwidth[6] = xval[47];
3484 width[6] = intwidth[6];
3487 for (i = 0; i < 7; i++) {
3488 kr[i] = (mass[i]*mass[i]-mp2)/2./mp;
3489 kcmr[i] = (mass[i]*mass[i]-mp2)/2./mass[i];
3490 epicmr[i] = (mass[i]*mass[i] + mpi*mpi -mp2 )/2./mass[i];
3491 ppicmr[i] = pow(std::max(0.0,(epicmr[i]*epicmr[i] - mpi*mpi)),0.5);
3492 epi2cmr[i] = (mass[i]*mass[i] + pow((2.*mpi),2) -mp2 )/2./mass[i];
3493 ppi2cmr[i] = pow(std::max(0.0,(epi2cmr[i]*epi2cmr[i] - pow((2.*mpi),2))),0.5);
3494 eetacmr[i] = (mass[i]*mass[i] + meta*meta -mp2 )/2./mass[i];
3495 petacmr[i] = pow(std::max(0.0,(eetacmr[i]*eetacmr[i] - meta*meta)),0.5);
3499 pwid[i][0] = intwidth[i]*pow((ppicm/ppicmr[i]),(2.*ang[i]+1.))*pow(((ppicmr[i]*ppicmr[i]+x0[i]*x0[i])/(ppicm*ppicm+x0[i]*x0[i])),ang[i]);
3501 pwid[i][1] = intwidth[i]*pow((ppi2cm/ppi2cmr[i]),(2.*ang[i]+4.))*pow(((ppi2cmr[i]*ppi2cmr[i]+x0[i]*x0[i])/(ppi2cm*ppi2cm+x0[i]*x0[i])),(ang[i]+2));
3503 pwid[i][1] = W/mass[i]*pwid[i][1];
3506 if(i == 1 || i == 4) {
3507 pwid[i][2] = intwidth[i]*pow((petacm/petacmr[i]),(2.*ang[i]+1.))*pow(((petacmr[i]*petacmr[i]+x0[i]*x0[i])/(petacm*petacm+x0[i]*x0[i])),ang[i]);
3510 pgam[i] = pow((kcm/kcmr[i]),2)*(pow(kcmr[i],2)+x0[i]*x0[i])/(kcm*kcm+x0[i]*x0[i]);
3511 pgam[i] = intwidth[i]*pgam[i];
3512 width[i] = br[i][0]*pwid[i][0]+br[i][1]*pwid[i][1]+br[i][2]*pwid[i][2];
3519 for (i = 0; i < 6; i++) {
3520 for (j = 0; j < 4; j++) {
3522 rescoef[i][j]=xval[num-1];
3526 height[i] = rescoef[i][0]*(1.+rescoef[i][1]*q2/(1.+rescoef[i][2]*q2))/pow((1.+q2/0.91),rescoef[i][3]);
3528 height[i] = rescoef[i][0]*q2/(1.+rescoef[i][1]*q2)*exp(-1.*rescoef[i][2]*q2);
3531 height[i] = height[i]*height[i];
3535 height[6] = xval[44]*q2/(1.+xval[45]*q2)*exp(-1.*xval[46]*q2);
3537 height[6] = xval[48]/(1.+q2/0.91);
3540 height[6] = height[6]*height[6];
3544 for (i = 0; i < 3; i++) {
3545 for (j = 0; j < 4; j++) {
3547 nr_coef[i][j]=xval[num-1];
3554 for (i = 0; i < 7; i++) {
3555 sigr[i] = width[i]*pgam[i]/(pow(w2 - mass[i]*mass[i],2.) + pow(mass[i]*width[i],2.));
3556 sigr[i] = height[i]*kr[i]/k*kcmr[i]/kcm*sigr[i]/intwidth[i];
3557 sig_res = sig_res + sigr[i];
3559 sig_res = sig_res*W;
3563 for (i = 0; i < 2; i++) {
3564 h_nr[i] = nr_coef[i][0]/pow(q2+nr_coef[i][1],nr_coef[i][2] + nr_coef[i][3]*q2+xval[44+i]*q2*q2);
3565 sig_nr = sig_nr +h_nr[i]*(pow(wdif[0],(2*(i+1)+1)/2.));
3568 sig_nr = sig_nr*xpr[0];
3570 }
else if (sf == 2) {
3571 for (i = 0; i < 1; i++) {
3572 sig_nr = sig_nr + nr_coef[i][0]*pow((1.-xpr[i]),(nr_coef[i][2]+nr_coef[i][1]*t))/(1.-xb)/(q2+q20);
3573 sig_nr = sig_nr*pow(q2/(q2+q20),nr_coef[i][3])*pow(xpr[i],(xval[40]+xval[41]*t));
3576 sig = sig_res + sig_nr;
3586 G4double am = 0.9383;
3590 5.1377e-03, 9.8071e-01, 4.6379e-02, 1.6433e+00,
3591 6.9826e+00, -2.2655e-01, 1.1095e-01, 2.7945e-02,
3592 4.0643e-01, 1.6076e+00, -7.5460e+00, 4.4418e+00,
3593 -3.7464e-01, 1.0414e-01, -2.6852e-01, 9.6653e-01,
3594 -1.9055e+00, 9.8965e-01, 2.0613e+02, -4.5536e-02,
3595 2.4902e-01, -1.3728e-01, 2.9201e+01, 4.9280e-03};
3597 G4double p18, x, f1corr;
3599 if (w2 <= 0.0)
return 0;
3601 nu = (w2 - am*am + q2) / 2. / am;
3602 x = q2 / (2.0 * am * nu );
3604 if (a < 2.5)
return 0;
3608 if (a > 2.5 && a < 3.5) p18 = 70;
3610 if (a > 3.5 && a < 4.5) p18 = 170;
3612 if(a > 4.5) p18 = 215;
3613 if(a > 20.) p18 = 235;
3614 if(a > 50.) p18 = 230;
3617 f1corr = P[0]*exp(-pow(w-P[1],2)/P[2])/(pow(1.0 + std::max(0.3,q2)/P[3],P[4]))*pow(nu,P[5])*(1.0 + p18 * pow(a,(1.0 + P[19] * x)));
3621 if (f1 <= 1.0E-9 ) f1 = 0.0;
3653 G4double ALPHA,C,LN_C,X_U;
3658 G4double ALPHA_COEF[9] = {
3671 G4double C_COEF[3] = {
3677 if (A < 2.5)
return 0;
3679 if ( (X > 0.70) || (X < 0.0085) ) {
3681 if (X < 0.0085) X_U =.0085;
3682 if (X > 0.70) X_U = 0.70;
3688 for (G4int i = 1; i <= 2; i++) {
3689 LN_C = LN_C + C_COEF[i] * pow(log(X_U),i);
3694 ALPHA = ALPHA_COEF[0];
3695 for (G4int i = 1; i <= 8; i++) {
3696 ALPHA = ALPHA + ALPHA_COEF[i] * pow(X_U,i);
3699 fitval = C*pow(A,ALPHA);
3714 G4double
M_p = 938.2796 * MeV;
3715 G4double M = M_p * Ain;
3716 G4double alpha_FS = 1.0/137.035999074;
3717 G4double m_e = 0.511 * MeV;
3720 G4double STH = sin(Theta/2.);
3721 G4double CTH = cos(Theta/2.);
3723 E_out = E_in/(1+2*E_in/M*STH*STH);
3724 Q2 = 4.*E_in*E_out*STH*STH;
3728 G4double sigMott = pow(Zin*0.719982/E_in*CTH/(STH*STH),2);
3729 sigMott = sigMott/(1+2*E_in/M*STH*STH)*10000;
3732 G4int NUC_MODEL = 1;
3733 G4bool OUT_OF_RANGE = 0;
3735 G4double qsq = Q2/1e6;
3740 G4cout <<
"** No generator fo A < 3 ** " << G4endl;
3743 else if (Ain >= 3) {
3745 if (NUC_MODEL == 1) {
3746 FF =
FF_BESSEL(Zin,Ain,qsq,OUT_OF_RANGE);
3748 if (OUT_OF_RANGE || (NUC_MODEL == 0)) {
3750 G4cout <<
"** No generator for He3 **" << G4endl;
3753 else if (Ain <= 20) {
3754 FF =
Fshell(Zin,Ain,qsq);
3757 FF =
Fgauss(Zin,Ain,qsq);
3762 G4double xsec = sigMott*FF*FF;
3764 G4double delta_Schwinger = 0.0;
3766 G4double FunctionofTheta = log (STH*STH) * log (CTH*CTH);
3767 delta_Schwinger = (-2.0*alpha_FS/pi) * ((log(E_in/
SchwingerDeltaE) - 13.0/12.0)
3768 * (log(Q2/(m_e*m_e)) - 1.0) + 17.0/36.0 + FunctionofTheta/2.0);
3770 xsec = xsec*(1.0 + delta_Schwinger);
3771 fWeightN = xsec*sin(Theta);
3783 G4double fgauss = 0.;
3786 G4double radius = 1.07*pow(avgA,1./3.);
3791 if(iA==205)radius=5.470;
3792 if(iA==56) radius=3.729;
3793 if(iA==28) radius=3.085;
3794 if(iA==27) radius=3.035;
3795 if(iA==24) radius=3.08;
3797 G4double x2 = (T/pow(.197328,2))*pow(radius,2);
3798 G4double CHARR = (T/pow(.197328,2))*(2.4*2.4)/6.;
3802 if (CHARR<80) fgauss = exp(-CHARR)/(1.+x2/6.);
3811 G4double fshell = 0.;
3813 G4double radius = 1.07*pow(avgA,1./3.);
3817 if(iA==16) radius=2.737;
3818 if(iA==15) radius=2.611;
3819 if(iA==14) radius=2.540;
3820 if(iA==12) radius=2.464;
3821 if(iA== 9) radius=2.519;
3822 if(iA== 7) radius=2.39;
3823 if(iA== 6) radius=2.56;
3824 if(iA== 4) radius=1.676;
3825 G4double x2 = (T/pow(.197328,2))*pow(radius,2);
3826 G4double alp = (iZ-2.)/3.;
3827 G4double CHARR = x2*(2.+3.*alp)/(12.+30.*alp);
3830 if (CHARR<80) fshell = exp(-CHARR)*(1.-alp*x2/(6.+15.*alp));
3836 G4bool &OUT_OF_RANGE){
3862 G4double a_3He[] = {0.20020E-01, 0.41934E-01, 0.36254E-01, 0.17941E-01,
3863 0.46608E-02, 0.46834E-02, 0.52042E-02, 0.38280E-02,
3864 0.25661E-02, 0.14182E-02, 0.61390E-03, 0.22929E-03};
3866 G4double a_12C[] = {0.15721E-01, 0.38732E-01, 0.36808E-01, 0.14671E-01,
3867 -0.43277E-02,-0.97752E-02,-0.68908E-02,-0.27631E-02,
3868 -0.63568E-03, 0.71809E-04, 0.18441E-03, 0.75066E-04,
3869 0.51069E-04, 0.14308E-04, 0.23170E-05, 0.68465E-06};
3871 G4double a_15N[] = {0.25491E-01, 0.50618E-01, 0.29822E-01,-0.55196E-02,
3872 -0.15913E-01,-0.76184E-02,-0.23992E-02,-0.47940E-03};
3875 G4double a_16O[] = {0.20238E-01, 0.44793E-01, 0.33533E-01, 0.35030E-02,
3876 -0.12293E-01,-0.10329E-01,-0.34036E-02,-0.41627E-03,
3877 -0.94435E-03,-0.25571E-03, 0.23759E-03,-0.10603E-03,
3878 0.41480E-04, 0.00000E-03};
3880 G4double a_26Mg[] = {2.9280e-2, 5.5520e-2, 2.3910e-2,-1.3940e-2,-1.5840e-2,
3881 -3.5680e-3, 1.9670e-3, 1.4470e-3,-8.6820e-5,-1.4000e-4,
3882 7.0000e-5,-2.0000e-5, 3.0000e-6, 1.0000e-7,-2.0000e-7};
3885 G4double a_27Al[] = {0.43418E-01, 0.60298E-01, 0.28950E-02,-0.23522E-01,
3886 -0.79791E-02, 0.23010E-02, 0.10794E-02, 0.12574E-03,
3887 -0.13021E-03, 0.56563E-04,-0.18011E-04, 0.42869E-05};
3890 G4double a_28Si[] = {0.33495E-01, 0.59533E-01, 0.20979E-01,-0.16900E-01,
3891 -0.14998E-01,-0.93248E-03, 0.33266E-02, 0.59244E-03,
3892 -0.40013E-03, 0.12242E-03,-0.12994E-04,-0.92784E-05,
3893 0.72595E-05,-0.42096E-05};
3895 G4double a_29Si[] = {3.3521e-02, 5.9679e-02, 2.0593e-02,-1.8646e-02,
3896 -1.6550e-02,-1.1922e-03, 2.8025e-03,-6.7353e-05,
3897 -3.4619e-04, 1.7611e-04,-5.7173e-06, 1.2371e-05};
3899 G4double a_30Si[] = {2.8397e-02, 5.4163e-02, 2.5167e-02,-1.2858e-02,
3900 -1.7592e-02,-4.6722e-03, 2.4804e-03, 1.4760e-03,
3901 -3.0168e-04, 4.8346e-05, 0.0000e+00,-5.1570e-06,
3904 G4double a_48Ti[] = {2.7850e-02, 5.5432e-02, 2.6369e-02,-1.7091e-02,
3905 -2.1798e-02,-2.4889e-03, 7.6631e-03, 3.4554e-03,
3906 -6.7477e-04, 1.0764e-04,-1.6564e-06,-5.5566e-06};
3908 G4double a_50Ti[] = {3.1818e-02, 5.8556e-02, 1.9637e-02,-2.4309e-02,
3909 -1.8748e-02, 3.3741e-03, 8.9961e-03, 3.7954e-03,
3910 -4.1238e-04, 1.2540e-04};
3912 G4double a_50Cr[] = {3.9174e-02, 6.1822e-02, 6.8550e-03,-3.0170e-02,
3913 -9.8745e-03, 8.7944e-03, 6.8502e-03,-9.3609e-04,
3914 -2.4962e-03,-1.5361e-03,-7.3687e-04};
3916 G4double a_52Cr[] = {0.39287e-1, 0.62477e-1, 0.62482e-2,-0.32885e-1,
3917 -0.10648e-1, 0.10520e-1, 0.85478e-2,-0.24003e-3,
3918 -0.20499e-2,-0.12001e-2,-0.56649e-3};
3920 G4double a_54Cr[] = {3.9002e-02, 6.0305e-02, 4.5845e-03,-3.0723e-02,
3921 -9.1355e-03, 9.3251e-03, 6.0583e-03,-1.5602e-03,
3922 -7.6809e-04, 7.6809e-04,-3.4804e-04};
3924 G4double a_54Fe[] = {4.2339e-02, 6.4428e-02, 1.5840e-03,-3.5171e-02,
3925 -1.0116e-02, 1.2069e-02, 6.2230e-03,-1.2045e-03,
3926 1.3561e-04, 1.0428e-05,-1.6980e-05, 9.1817e-06,
3927 -3.9988e-06, 1.5731e-06,-5.7862e-07, 2.0186e-07,
3930 G4double a_56Fe[] = {0.42018E-1, 0.62337E-1, 0.23995e-3,-0.32776E-1,
3931 -0.79941E-2, 0.10844E-1, 0.49123e-2,-0.22144e-2,
3932 -0.18146E-3, 0.37261E-3,-0.23296E-3, 0.11494E-3,
3933 -0.50596E-4, 0.20652E-4,-0.79428E-5, 0.28986E-5,
3936 G4double a_58Fe[] = {4.1791e-02, 6.0524e-02,-1.4978e-03,-3.1183e-02,
3937 -5.8013e-03, 1.0611e-02, 4.1629e-03,-2.9045e-06,
3938 5.4106e-04,-3.8689e-04, 2.0514e-04,-9.5237e-05,
3939 4.0707e-05,-1.6346e-05, 6.2233e-06,-2.2568e-06,
3942 G4double a_63Cu[] = {4.5598e-02, 6.0706e-02,-7.8616e-03,-3.1638e-02,
3943 -1.4447e-03, 1.0953e-02, 4.2578e-03,-2.4224e-04,
3944 -3.0067e-04, 2.3903e-04,-1.2910e-04, 6.0195e-05,
3945 -2.5755e-05, 1.0332e-05,-3.9330e-06, 1.4254e-06,
3948 G4double a_65Cu[] = {0.45444E-01, 0.59544E-01,-0.94968E-02,-0.31561e-01,
3949 0.22898E-03, 0.11189E-01, 0.37360E-02,-0.64873E-03,
3950 -0.51133E-03, 0.43765E-03,-0.24276E-03, 0.11507E-03,
3951 -0.49761E-04, 0.20140E-04,-0.76945E-05, 0.28055E-05,
3954 G4double a_64Zn[] = {0.47038E-01, 0.61536E-01,-0.90045E-02,-0.30669E-01,
3955 -0.78705E-03, 0.10034E-01, 0.14053E-02,-0.20640E-02,
3956 0.35105E-03, 0.27303E-04,-0.63811E-04, 0.40893E-04,
3957 -0.20311E-04, 0.88986E-05,-0.35849E-05, 0.13522E-05,
3960 G4double a_66Zn[] = {4.6991e-02, 6.0995e-02,-9.6693e-03,-3.0457e-02,
3961 -5.3435e-04, 9.7083e-03, 1.4091e-03,-7.0813e-04,
3962 2.0809e-04,-4.8275e-05, 7.2680e-06, 9.1369e-07,
3963 -1.4874e-06, 8.8831e-07,-4.1689e-07, 1.7283e-07,
3966 G4double a_68Zn[] = {4.6654e-02, 5.8827e-02,-1.2283e-02,-2.9865e-02,
3967 2.5669e-03, 1.0235e-02, 3.1861e-03,-1.7351e-04,
3968 -4.2979e-04, 3.3700e-04,-1.8435e-04, 8.7043e-05,
3969 -3.7612e-05, 1.5220e-05,-5.8282e-06, 2.1230e-06,
3972 G4double a_70Zn[] = {4.6362e-02, 5.7130e-02,-1.3877e-02,-3.0030e-02,
3973 3.5341e-03, 1.0113e-02, 4.1029e-03, 7.6469e-04,
3974 -1.0138e-03, 6.0837e-04,-2.9929e-04, 1.3329e-04,
3975 -5.5502e-05, 2.1893e-05,-8.2286e-06, 2.9559e-06,
3979 G4double a_196Pt[] = {0.50218e-1, 0.53722e-1,-0.35015e-1,-0.34588e-1,
3980 0.23564e-1, 0.14340e-1,-0.13270e-1,-0.51212e-2,
3981 0.56088e-2, 0.14890e-2,-0.10928e-2, 0.55662e-3,
3982 -0.50557e-4,-0.19708e-3, 0.24016e-3};
3986 G4double qq = sqrt ( T ) / 0.197328;
3989 G4double ff_bessel=0;
3993 ff_bessel = 1.00000;
4002 if(iA == 3 && iZ == 2){
4003 if(qq>10.10 ) OUT_OF_RANGE=
true;
4006 for(G4int i=0;i<n;i++)
4009 else if(iA == 12 && iZ == 6){
4010 if(qq>4.01 ) OUT_OF_RANGE=
true;
4013 for(G4int i=0;i<n;i++)
4016 else if(iA == 15 && iZ == 7){
4017 if(qq>3.17) OUT_OF_RANGE=
true;
4020 for(G4int i=0;i<n;i++)
4023 else if(iA == 16 && iZ == 8){
4024 if(qq>2.77) OUT_OF_RANGE=
true;
4027 for(G4int i=0;i<n;i++)
4030 else if(iA == 26 && iZ == 26){
4031 if(qq>3.0) OUT_OF_RANGE=
true;
4035 for(G4int i=0;i<n;i++)
4038 else if(iA == 27 && iZ == 13){
4039 if(qq>2.70) OUT_OF_RANGE=
true;
4043 for(G4int i=0;i<n;i++)
4046 else if(iA == 28 && iZ == 14){
4047 if(qq>2.64) OUT_OF_RANGE=
true;
4051 for(G4int i=0;i<n;i++)
4054 else if(iA == 29 && iZ == 14){
4055 if(qq>2.64) OUT_OF_RANGE=
true;
4059 for(G4int i=0;i<n;i++)
4062 else if(iA == 30 && iZ == 14){
4063 if(qq>2.64) OUT_OF_RANGE=
true;
4067 for(G4int i=0;i<n;i++)
4070 else if (iA == 48 && iZ == 22) {
4071 if (qq>2.20) OUT_OF_RANGE=
true;
4075 for(G4int i=0;i<n;i++)
4078 else if (iA == 50 && iZ == 22) {
4079 if (qq>2.20) OUT_OF_RANGE=
true;
4083 for(G4int i=0;i<n;i++)
4086 else if (iA == 50 && iZ == 24) {
4087 if (qq>2.59) OUT_OF_RANGE=
true;
4091 for(G4int i=0;i<n;i++)
4094 else if (iA == 52 && iZ == 24) {
4095 if (qq>2.59) OUT_OF_RANGE=
true;
4099 for(G4int i=0;i<n;i++)
4102 else if (iA == 54 && iZ == 24) {
4103 if (qq>2.59) OUT_OF_RANGE=
true;
4107 for(G4int i=0;i<n;i++)
4110 else if(iA == 54 && iZ == 26){
4111 if(qq>2.22) OUT_OF_RANGE=
true;
4115 for(G4int i=0;i<n;i++)
4118 else if(iA == 56 && iZ == 26){
4119 if(qq>2.22) OUT_OF_RANGE=
true;
4123 for(G4int i=0;i<n;i++)
4126 else if(iA == 58 && iZ == 26){
4127 if(qq>2.22) OUT_OF_RANGE=
true;
4131 for(G4int i=0;i<n;i++)
4134 else if(iA == 63 && iZ == 29){
4135 if(qq>2.22) OUT_OF_RANGE=
true;
4139 for(G4int i=0;i<n;i++)
4142 else if(iA == 65 && iZ == 29){
4143 if(qq>2.22) OUT_OF_RANGE=
true;
4147 for(G4int i=0;i<n;i++)
4150 else if(iA == 64 && iZ == 30){
4151 if(qq>2.22) OUT_OF_RANGE=
true;
4155 for(G4int i=0;i<n;i++)
4158 else if(iA == 66 && iZ == 30){
4159 if(qq>2.22) OUT_OF_RANGE=
true;
4163 for(G4int i=0;i<n;i++)
4166 else if(iA == 68 && iZ == 30){
4167 if(qq>2.22) OUT_OF_RANGE=
true;
4171 for(G4int i=0;i<n;i++)
4174 else if(iA == 70 && iZ == 30){
4175 if(qq>2.22) OUT_OF_RANGE=
true;
4179 for(G4int i=0;i<n;i++)
4182 else if(iA == 196 && iZ == 78){
4183 if(qq>2.28) OUT_OF_RANGE=
true;
4184 if(qq<0.34) OUT_OF_RANGE=
true;
4187 for(G4int i=0;i<n;i++)
4193 if(OUT_OF_RANGE || (R_max == 0.)){
4198 G4double qmu = 3.14159265 / R_max;
4200 G4double sinqR = sin(qq*R_max);
4201 G4double qmux,qm,qp;
4203 G4double PI4=12.56637062;
4204 G4double PI2=6.28318531;
4206 for(G4int j=0;j<n;j++){
4207 qmux = qmu * Float_t(j+1);
4211 ff = ff + a[j]*(pow((-1.),(j+1)))*sinqR/(qm*qp);
4213 ff = ff + a[j]*pow(R_max,2)/(PI2*(j+1));
4216 if((qq*R_max>1.E-20) && (ff<1.E20))
4217 ff_bessel = PI4/Float_t(iZ)/qq *ff;
4221 if (ff_bessel < 0) ff_bessel*=-1;
4236 const G4double Mp=0.938;
4237 const G4double gf=0.0000116637;
4238 const G4double alpha=1./137.;
4240 const G4double s2tw_low=0.2387;
4241 const G4double qwp=0.0713;
4242 const G4double qwn=-0.988;
4250 const G4double rt1a=-0.23;
4254 const G4double theta_min = 1.745329E-4;
4255 if (theta<theta_min)
4260 energy=energy/1000.0;
4263 G4double Q2_ep=4*energy*energy*sin(theta/2.0)*sin(theta/2.0);
4264 Q2_ep=Q2_ep/(1.0+2.0*energy/Mp*sin(theta/2.0)*sin(theta/2.0));
4268 G4double tau=Q2_ep/4.0/(Mp*Mp);
4269 G4double epsilon=1.0/(1.0+2.0*(1.0+tau)*tan(theta/2.0)*tan(theta/2.0));
4270 G4double epsilonp=sqrt(tau*(1.0+tau)*(1.0-epsilon*epsilon));
4274 G4double gvd=1.0/( (1.0+Q2_ep/0.71)*(1.0+Q2_ep/0.71) );
4276 G4double gmpg=2.793*gvd;
4277 G4double geng=1.91*tau*gvd/(1.+5.6*tau);
4278 G4double gmng=-1.91*gvd;
4284 G4double gt1a=1.2695/((1+Q2_ep/1.001/1.001)*(1+Q2_ep/1.001/1.001));
4295 G4double gepz=qwp*gepg+qwn*geng;
4296 G4double gmpz=qwp*gmpg+qwn*gmng;
4297 G4double gapz=-(1.0+rt1a)*gt1a;
4299 G4double asym=-gf/(4.0*pi*alpha*sqrt(2.0))*Q2_ep*1e6;
4300 asym=asym/(epsilon*gepg*gepg+tau*gmpg*gmpg);
4301 asym=asym*(epsilon*gepg*gepz+tau*gmpg*gmpz-(1.0-4.0*s2tw_low)*epsilonp*gmpg*gapz);
4322 const G4double gf=0.0000116637;
4323 const G4double alpha=1./137.;
4324 const G4double qwp=0.0713;
4325 const G4double qwn=-0.988;
4326 const G4double NT=14.;
4327 const G4double ZT=13.;
4331 energy = energy/1000.0;
4334 G4double Q2=4*energy*energy*sin(theta/2.)*sin(theta/2.);
4340 G4double asym=-gf/(4.*pi*alpha*sqrt(2.))*1e6*Q2*(qwp+qwn*NT/ZT);
4359 const G4double Mp=0.938;
4360 const G4double gf=0.0000116637;
4361 const G4double alpha=1./137.;
4362 const G4double qwp=0.0713;
4363 const G4double qwn=-0.988;
4364 const G4double NT=5.;
4365 const G4double ZT=4.;
4369 energy = energy/1000.;
4372 G4double Q2=4*energy*energy*sin(theta/2.)*sin(theta/2.);
4373 Q2=Q2/(1.+2.*energy/(9.*Mp)*sin(theta/2.)*sin(theta/2.));
4376 Q2=Q2*(1.+(3./2.*sqrt(3./5.)*ZT*0.197/137./(energy*1.77)))*(1.+(3./2.*sqrt(3./5.)*ZT*0.197/137./(energy*1.77)));
4379 G4double asym=-gf/(4.*pi*alpha*sqrt(2.))*1e6*Q2*(qwp+qwn*NT/ZT);
4414 const G4double G_F = 1.1663787e-5;
4415 const G4double alpha = 1/137.035999074;
4416 const G4double Qw_p = 0.0721;
4417 const G4double Qw_n = -0.9878;
4420 energy = energy/1000.0;
4421 eprime = eprime/1000.0;
4425 G4double A_0 = -G_F/(4*pi*alpha*sqrt(2.0));
4426 G4double born_asym = 1.0e6*A_0*qq*(Qw_p+Qw_n*((A-Z)/Z));
4439 const G4double Mn= 0.939565;
4440 const G4double gf=0.0000116637;
4441 const G4double alpha=1./137.;
4443 const G4double s2tw_low=0.2387;
4444 const G4double qwp=0.0713;
4445 const G4double qwn=-0.988;
4453 const G4double rt1a=-0.23;
4457 const G4double theta_min = 1.745329E-4;
4458 if (theta<theta_min)
4463 energy=energy/1000.0;
4466 G4double Q2_ep=4*energy*energy*sin(theta/2.0)*sin(theta/2.0);
4467 Q2_ep=Q2_ep/(1.0+2.0*energy/Mn*sin(theta/2.0)*sin(theta/2.0));
4471 G4double tau=Q2_ep/4.0/(Mn*Mn);
4472 G4double epsilon=1.0/(1.0+2.0*(1.0+tau)*tan(theta/2.0)*tan(theta/2.0));
4473 G4double epsilonp=sqrt(tau*(1.0+tau)*(1.0-epsilon*epsilon));
4477 G4double gvd=1.0/( (1.0+Q2_ep/0.71)*(1.0+Q2_ep/0.71) );
4479 G4double gmpg=2.793*gvd;
4480 G4double geng=1.91*tau*gvd/(1.+5.6*tau);
4481 G4double gmng=-1.91*gvd;
4489 G4double gt1a=1.2695/((1+Q2_ep/1.001/1.001)*(1+Q2_ep/1.001/1.001));
4500 G4double gapz=-(1.0+rt1a)*gt1a;
4509 G4double genz=qwp*geng+qwn*gepg;
4510 G4double gmnz=qwp*gmng+qwn*gmpg;
4511 G4double asym_neutron = -gf/(4.0*pi*alpha*sqrt(2.0))*Q2_ep*1e6;
4512 asym_neutron =asym_neutron /(epsilon*geng*geng+tau*gmng*gmng);
4513 asym_neutron =asym_neutron *(epsilon*geng*genz+tau*gmng*gmnz-(1.0-4.0*s2tw_low)*epsilonp*gmng*gapz);
4516 return asym_neutron;
4535 G4double asym=-100*Q2_pi;
4579 G4cout << G4endl <<
"##### Beam Energy must be greater than zero" << G4endl << G4endl;
G4double TargetLuminosityUSALDummy2
void GetanEvent(G4double E_in, std::vector< G4double > &CrossSection, G4double &weight_n, G4double &Q2, G4double &E_out, G4ThreeVector &MomentumDirection, G4double &theta, G4double &phi, G4double &Asymmetry)
G4int ReactionRegion
reaction region used for event generation
QweakSimEPEventMessenger * EventGen_Messenger
G4ThreeVector GetNormMomentum() const
G4double TargetLuminosityDSALDummy4_Si
G4double Quasi_Elastic_Bosted(G4double E_in, G4double Theta, G4int Zin, G4int Ain, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4int ReactionType
reaction type used for event generation
G4double TargetCenterPositionZ
void SetEPrime_Max(G4double energy)
G4double GetThetaAngle_Max()
QweakSimFieldMap< value_t, value_n > * fLookupTable
void SetEPrime_Min(G4double energy)
G4double GetThetaAngle_Max()
void SetThetaAngle_Max(G4double ang)
G4double TargetDSDummyPositionOffsetZ
G4double TargetLuminosityUSALWindow
void SetPhaseSpace(G4double ps)
G4double TargetLuminosityDSALDummy4
G4ThreeVector GetMomentumDirection()
G4double GetThetaAngle_Min()
G4double Alinel_crsec_gen(G4double E_in=1160, G4double th=8.0)
G4double Fshell(G4int Z, G4int A, G4double q2)
G4double TargetLuminosityDSALDummy2
G4double fitemc(G4double X, G4int A)
G4double Moller_Scattering(G4double E_in, G4double theta1, G4double &E_out1, G4double &E_out2, G4double &theta2, G4double &q2, G4double &fWeightN, G4double &asymmetry)
static const G4int value_n
G4double TargetLuminosityDSALDummy4_Zn
UI control for the event generator.
void SetLuminosity(G4double lum)
G4double Pion_PhotoProductionAl(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double AlNuclInel(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4int SuperElasticCheck(G4double E_in, G4double E_out, G4double theta, G4double &xsec)
G4double GetPhiAngle_Min()
G4double TargetLuminosityDSALDummy4_Mn
A multi-dimensional grid of values with interpolation methods.
G4double CGDR(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
void CheckLookupTableBounds()
void SetPhiAngle_Max(G4double ang)
G4double GetThetaAngle_Min()
void SetEPrime_Max(G4double energy)
G4int GetActiveOctantNumber()
G4double Pion_PhotoProductionCarbon(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double GetEPrime() const
G4double GetAsymmetry_Pi(G4double Q2_pi)
void SetPhiAngle_Max(G4double ang)
G4double TargetLuminosityUSALDummy4
void SetEPEvent(QweakSimEPEvent *EP)
void F1F2QE09(G4int Z, G4int A, G4double QSQ, G4double wsq, G4double &F1, G4double &F2)
G4double Aluminum_Excited_State(G4double E_in, G4double Theta, G4double E_lvl, G4double fit_c, G4double fit_mean, G4double fit_sigma, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double AlloyScattering(G4double E_in, G4double Theta, G4int Zin, G4int Ain, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double Horowitz_DW_Xsect(G4double E_in, G4double theta, const G4String path, G4double &fWeightN, G4double &Q2, G4double &E_out)
static const G4double M_p
G4double GetAsymmetry_AL(G4double theta, G4double energy)
void SetThetaAngle_Min(G4double ang)
G4double ElasticPeakDeltaE
G4double TargetLuminosityDSALDummy8
G4double TargetLuminosityUSCDummy
G4double CNuclInel(G4double E_in, G4double Theta, G4int nState, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double TargetLuminosityDSALDummy4_Ti
G4double Elastic_Cross_Section_Carbon(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double ResMod507(G4int sf, G4double w2, G4double q2, G4double *xval)
G4double GetOriginVertexPositionZ() const
G4double GetBeamEnergy() const
G4double GetPhiAngle_Max()
G4double GetAsymmetry_EP(G4double theta, G4double energy)
G4double TargetUSDummyPositionOffsetZ
G4double Quasi_Elastic_Neutron(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
static const G4double Theta_Min
void SetBeamEnergy(G4double energy=1.160 *GeV)
G4double AlGDR(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double wiser_sigma(G4double Ebeam, G4double pf, G4double thf, G4double rad_len, G4int type)
void SetPhiAngle_Min(G4double ang)
QweakSimEPEvent(QweakSimUserInformation *myUI)
G4double Delta_Resonance(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
void SetThetaAngle_Max(G4double ang)
G4double TargetExitWindowNippleThickness
void F1F2IN09(G4int Z, G4int A, G4double QSQ, G4double wsq, G4double &F1, G4double &F2)
void christy507(G4double wsq, G4double Q2, G4double &F1, G4double &R, G4double &sigt, G4double &sigl)
G4double TargetLuminosityDSCDummy
void SetEPrime(G4double energy)
void SetBeamEnergy(G4double energy)
G4double Elastic_Cross_Section_Proton(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double TargetThicknessDSALDummy4
G4double Born_Approx_Nuclei_Asym(G4double Z, G4double A, G4double energy, G4double eprime, G4double qq)
G4double TargetLuminosityLH2
void SetPhaseSpace(G4double ps)
G4double TargetLuminosityDSALDummy4_Mg
G4double TargetLuminosityDSALDummy4_Cu
void SetLuminosity(G4double lum)
G4double NuclearInelastic_Bosted(G4double E_in, G4double Theta, G4int Zin, G4int Ain, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double TargetLuminosityDSALDummy4_Fe
static const G4double M_n
G4int Isotropy
isotropy used for event generation
G4int kActiveOctantNumber
Active octant number in the simulation, 0 will enable all octants.
G4double GetAsymmetry_Be(G4double theta, G4double energy)
G4double MEC2009(G4int a, G4double q2, G4double w2)
G4int GetNumberOfEventToBeProcessed() const
G4double TargetLuminosityDSALWindow
G4double GetAsymmetry_EN(G4double theta, G4double energy)
void SetEPrime_Min(G4double energy)
G4int GetReactionType() const
G4double Horowitz_DW_Asym(G4double theta, const G4String path)
G4double TargetEntranceWindowThickness
G4double TargetLuminosityDSALDummy4_Al
static const G4int value_d
G4double GetPhiAngle_Max()
virtual ~QweakSimEPEvent()
G4double Elastic_Cross_Section_Aluminum(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double TargetLuminosityDSALDummy4_Cr
G4double FF_BESSEL(G4int Z, G4int A, G4double q2, G4bool &ofr)
const std::vector< G4double > Radiative_Cross_Section_Lookup(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
G4double resmod507_v2(G4double sf, G4double w2, G4double q2, G4double xval[50])
void SetThetaAngle_Min(G4double ang)
QweakSimUserInformation * myUserInfo
G4double Sigma_EEPrime(G4double eni, G4double eprime, G4double theta, G4double &q2)
G4double TargetLuminosityUSALDummy1
G4double Fgauss(G4int Z, G4int A, G4double q2)
G4double Pion_PhotoProduction(G4double E_in, G4double Theta, G4double &fWeightN, G4double &Q2, G4double &E_out)
void resmodd(G4double w2, G4double q2, G4double xval[50], G4double &sig)
G4double GetPhiAngle_Min()
void SetPhiAngle_Min(G4double ang)