62 {211,-211,2112,2212,321,-321,130,310,311,-311,
63 3122,3222,3112,3212,3312,3322,3334,
64 -2212,-2112,-3122,-3222,-3112,-3212,-3312,-3322,-3334};
67 {2,3,6,0,4,5,4,4,4,5,
72 {3,4,1,0,5,6,5,5,5,6,
84 #ifdef G4MULTITHREADED
101 G4double mass2GeV2= massGeV*massGeV;
103 DefineNucleusParameters(A);
107 massA2 = massA*massA;
116 G4double plab2= e[kk]*(e[kk] + 2.0*massGeV);
117 G4double Q2m = 4.0*plab2*massA2/(mass2GeV2 + massA2 + 2.*massA*elab);
225 if(A < 100 && A > 3) { Pnucl = 0.176 + 0.00275*
A; }
226 else { Pnucl = 0.4; }
230 if(A >= 100) { Aeff = 0.7; }
231 else if(A < 100 && A > 75) { Aeff = 1.5 - 0.008*
A; }
264 #ifdef G4MULTITHREADED
287 G4cout <<
"### G4ElasticHadrNucleusHE: energy points in GeV" <<
G4endl;
293 #ifdef G4MULTITHREADED
304 outFile <<
"G4ElasticHadrNucleusHE is a hadron-nucleus elastic scattering\n"
305 <<
"model developed by N. Starkov which uses a Glauber model\n"
306 <<
"parameterization to calculate the final state. It is valid\n"
307 <<
"for all hadrons with incident momentum above 0.4 GeV/c.\n";
339 for(
G4int i=0; i<2; ++i) {
347 for(
size_t j=0; j<numOfCouples; ++j) {
349 auto elmVec =
mat->GetElementVector();
350 size_t numOfElem =
mat->GetNumberOfElements();
351 for(
size_t k=0;
k<numOfElem; ++
k) {
354 if(1 == i && Z > 1) {
373 G4double kine = sqrt(inLabMom*inLabMom + mass*mass) -
mass;
388 G4cout<<
"G4ElasticHadrNucleusHE::SampleT: "
390 <<
" at Z= " << Z <<
" A= " << A
391 <<
" plab(GeV)= " << plab
405 if(0 >
iHadron) {
return 0.0; }
420 if(!ElD1) {
return 0.0; }
427 G4cout<<
" SampleT: Q2(GeV^2)= "<<Q2<<
" t/tmax= "
439 #ifdef G4MULTITHREADED
453 <<
" Z= " << Z <<
" idx= " << idx <<
" iHadron= " <<
iHadron
455 <<
"\n R1= " <<
R1 <<
" R2= " <<
R2 <<
" Aeff= " <<
Aeff
465 Q2max = pElD->maxQ2[i];
468 (pElD->fCumProb[i]).reserve(length);
472 G4cout <<
"### i= " << i <<
" Z= " << Z <<
" A= " << A
473 <<
" length= " << length <<
" Q2max= " <<
Q2max <<
G4endl;
476 (pElD->fCumProb[i]).push_back(0.0);
477 for(
G4int ii=1; ii<length-1; ++ii) {
478 (pElD->fCumProb[i]).push_back(
fLineF[ii]*norm);
480 G4cout <<
" ii= " << ii <<
" val= " << (pElD->fCumProb[i])[ii] <<
G4endl;
483 (pElD->fCumProb[i]).push_back(1.0);
487 G4cout <<
" G4ElasticHadrNucleusHE::FillData done for idx= " << idx
492 #ifdef G4MULTITHREADED
507 if(i == n) { i = n - 1; }
527 G4cout<<
"Q2_2: ekin(GeV)= " << ekin <<
" plab(GeV/c)= " << plab
528 <<
" tmax(GeV2)= " << tmax <<
G4endl;
546 for(iNumbQ2=1; iNumbQ2<
length; ++iNumbQ2) {
547 if(Rand <= (pElD->
fCumProb[idx])[iNumbQ2]) {
break; }
549 iNumbQ2 =
std::min(iNumbQ2, length - 1);
555 G4cout<<
" HadrNucleusQ2_2(2): Q2= "<<Q2<<
" iNumbQ2= " << iNumbQ2
556 <<
" rand= " << Rand <<
" Q2max= " <<
Q2max
557 <<
" tmax= " << tmax <<
G4endl;
568 const std::vector<G4double>& F,
578 xx = (xx > 20.) ? 0.0 :
G4Exp(-xx);
584 if(kk == 1 || kk == 0) {
600 G4cout <<
"GetQ2_2 kk= " << kk <<
" X2= " << X2 <<
" X3= " << X3
601 <<
" F2= " << F2 <<
" F3= " << F3 <<
" Rndm= " << ranUni <<
G4endl;
608 G4double D0 = F12*F2+F1*F32+F3*F22-F32*F2-F22*F1-F12*
F3;
611 G4cout <<
" X1= " << X1 <<
" F1= " << F1 <<
" D0= "
616 Y = X2 + (ranUni -
F2)*(X3 - X2)/(F3 -
F2);
618 G4double DA = X1*F2+X3*F1+X2*F3-X3*F2-X1*F3-X2*
F1;
619 G4double DB = X2*F12+X1*F32+X3*F22-X2*F32-X3*F12-X1*
F22;
620 G4double DC = X3*F2*F12+X2*F1*F32+X1*F3*F22
621 -X1*F2*F32-X2*F3*F12-X3*F1*
F22;
622 Y = (DA*ranUni*ranUni + DB*ranUni + DC)/D0;
639 for(ii=1; ii<
ONQ2-1; ++ii) {
640 curSum = curSec = 0.0;
642 for(
G4int jj=0; jj<10; ++jj) {
643 curQ2 = Q2l+(jj + 0.5)*ddQ2;
644 if(curQ2 >=
Q2max) {
break; }
654 G4cout<<ii <<
". FillFq2: A= " << A <<
" Q2= "<<Q2l<<
" dQ2= "
655 <<
dQ2<<
" Tot= "<<totSum <<
" dTot " <<curSum
656 <<
" curSec= " <<curSec<<
G4endl;
658 if(totSum*1.
e-4 > curSum || Q2l >=
Q2max) {
break; }
664 xx = (xx > 20.) ? 0.0 :
G4Exp(-xx);
666 totSum += curSec*(1.0 -
xx)/
R1;
670 G4cout <<
"### FillFq2 done curQ2= " << curQ2 <<
" Q2max= "<<
Q2max
671 <<
" sumG= " <<
fLineF[ONQ2-2] <<
" totSum= " << totSum
672 <<
" Nbins= " << ii + 1 <<
G4endl;
709 G4cout <<
"GetFq2: Stot= " << Stot <<
" Bhad= " << Bhad
711 <<
" Asq= " << Asq <<
G4endl;
726 G4double FiH = std::asin(HadrReIm/Rho2);
730 G4cout <<
"UnucRho2= " << UnucRho2 <<
" FiH= " << FiH <<
" NN2= " << NN2
731 <<
" Norm= " << Norm <<
G4endl;
736 for(
G4int i1 = 1; i1<=
A; ++i1)
738 N1 *= (-Unucl*Rho2*(A-i1+1)/(
G4double)i1);
742 for(
G4int i2 = 1; i2<=
A; ++i2)
744 N2 *= (-Unucl*Rho2*(A-i2+1)/(
G4double)i2);
747 for(
G4int j2=0; j2<= i2; ++j2)
753 for(
G4int j1=0; j1<=i1; ++j1)
763 Prod1 += Prod2*N2*std::cos(FiH*(i1-i2));
765 if (
std::abs(Prod2*N2/Prod1)<prec)
break;
768 if(
std::abs(N1*Prod1/Prod0) < prec)
break;
775 G4cout <<
"GetLightFq2 Z= " << Z <<
" A= " << A
776 <<
" Q2= " << Q2 <<
" Res= " << Prod0 <<
G4endl;
825 G4double R12ApdR22Ap = 0.5*(R12Apd+R22Apd);
829 std::sqrt((R12+R22)*0.5)));
846 for(
G4int i=1; i<=
A; ++i) {
847 N *= (-Unucl*Rho2*(A-i+1)/(
G4double)i);
852 for(
G4int l=1; l<=i; ++l) {
853 exp1 = l/R22B+(i-l)/R12B;
856 Prod1 += expn4*
G4Exp(-aQ2/(exp1*4));
861 ReElasticAmpl0 += Prod1*N*std::sin(FiH*i);
862 ImElasticAmpl0 += Prod1*dcos;
864 if(
std::abs(Prod1*N/ImElasticAmpl0) < 0.000001)
break;
868 ImElasticAmpl0 *= pi25;
869 ReElasticAmpl0 *= pi25;
878 C2/R12ApdR22Ap*
G4Exp(-aQ2/(4*R12ApdR22Ap))+
879 C3*R22Ap/2*
G4Exp(-aQ2/8*R22Ap));
881 G4double DTot1 = 0.5*(C1*0.5*R12Ap-C2/R12ApdR22Ap+C3*R22Ap*0.5);
883 for(
G4int i=1; i<= A-2; ++i) {
884 N1p *= (-UnuclScr*Rho2*(A-i-1)/(
G4double)i);
889 for(
G4int l=0; l<=i; ++l) {
890 if(l > 0) { BinCoeff *= (i-l+1)/(
G4double)l; }
892 exp1 = l/R22B+(i-l)/R12B;
897 Din2 += N2p*BinCoeff*(C1/exp1p*
G4Exp(-aQ2/(4*exp1p))-
898 C2/exp2p*
G4Exp(-aQ2/(4*exp2p))+
899 C3/exp3p*
G4Exp(-aQ2/(4*exp3p)));
901 DmedTot += N2p*BinCoeff*(C1/exp1p-C2/exp2p+C3/exp3p);
908 DTot1 += DmedTot*dcos;
910 if(
std::abs(Din2*N1p/Din1) < 0.000001)
break;
919 G4double DiffCrSec2 = (ReElasticAmpl0*ReElasticAmpl0+
920 (ImElasticAmpl0+Din1)*
921 (ImElasticAmpl0+Din1))/
twopi;
925 aAIm = ImElasticAmpl0;
940 <<
" E(GeV)= " <<
HadrEnergy <<
" sqrS= " << sqrS
954 TotP = TotN = 7.5*logE - 40.12525 + 103*
G4Exp(-logS*0.165);
965 TotN = 33.0 + 25.5*A0*A0;
968 TotN = 33.0 + 30.*A0*A0*A0*A0;
976 TotP = 23.0 + 40.*A0*A0;
1026 HadrTot = 5.2+5.2*logE + 123.2/sqrS;
1063 TotP = 10.6+2.*logE + 25.*
G4Exp(-logE*0.43);
1071 TotP = 88*(logE+0.2877)*(logE+0.2877)+14.0;
1080 TotN = 10.6 + 2.*logE + 30.*
G4Exp(-logE*0.43);
1084 TotN = 36.1+0.079 - 4.313*logE + 3.*
G4Exp(-x*x) + 1.5*
G4Exp(-y*y);
1088 TotN = 36.1 + 10.*
G4Exp(-x*x) + 24*
G4Exp(-y*y);
1091 TotN = 26. + 110.*x*
x;
1094 TotN = 28.0 + 40.*
G4Exp(-x*x);
1110 else {
HadrSlope = 1.0+1.76*logS - 2.84/sqrS; }
1119 HadrTot = 10+1.8*logE + 25./sqrS;
1141 static const G4double EnP0[6]={1.5,3.0,5.0,9.0,14.0,19.0};
1142 static const G4double C0P0[6]={0.15,0.02,0.06,0.08,0.0003,0.0002};
1143 static const G4double C1P0[6]={0.05,0.02,0.03,0.025,0.0,0.0};
1144 static const G4double B0P0[6]={1.5,2.5,3.0,4.5,1.4,1.25};
1145 static const G4double B1P0[6]={5.0,1.0,3.5,4.0,4.8,4.8};
1148 static const G4double EnN[5]={1.5,5.0,10.0,14.0,20.0};
1149 static const G4double C0N[5]={0.0,0.0,0.02,0.02,0.01};
1150 static const G4double C1N[5]={0.06,0.008,0.0015,0.001,0.0003};
1151 static const G4double B0N[5]={1.5,2.5,3.8,3.8,3.5};
1152 static const G4double B1N[5]={1.5,2.2,3.6,4.5,4.8};
1155 static const G4double EnP[2]={1.5,4.0};
1156 static const G4double C0P[2]={0.001,0.0005};
1157 static const G4double C1P[2]={0.003,0.001};
1158 static const G4double B0P[2]={2.5,4.5};
1159 static const G4double B1P[2]={1.0,4.0};
1162 static const G4double EnPP[4]={1.0,2.0,3.0,4.0};
1163 static const G4double C0PP[4]={0.0,0.0,0.0,0.0};
1164 static const G4double C1PP[4]={0.15,0.08,0.02,0.01};
1165 static const G4double B0PP[4]={1.5,2.8,3.8,3.8};
1166 static const G4double B1PP[4]={0.8,1.6,3.6,4.6};
1169 static const G4double EnPPN[4]={1.0,2.0,3.0,4.0};
1170 static const G4double C0PPN[4]={0.0,0.0,0.0,0.0};
1171 static const G4double C1PPN[4]={0.0,0.0,0.0,0.0};
1172 static const G4double B0PPN[4]={1.5,2.8,3.8,3.8};
1173 static const G4double B1PPN[4]={0.8,1.6,3.6,4.6};
1176 static const G4double EnK[4]={1.4,2.33,3.0,5.0};
1177 static const G4double C0K[4]={0.0,0.0,0.0,0.0};
1178 static const G4double C1K[4]={0.01,0.007,0.005,0.003};
1179 static const G4double B0K[4]={1.5,2.0,3.8,3.8};
1180 static const G4double B1K[4]={1.6,1.6,1.6,1.6};
1183 static const G4double EnKM[2]={1.4,4.0};
1184 static const G4double C0KM[2]={0.006,0.002};
1185 static const G4double C1KM[2]={0.00,0.00};
1186 static const G4double B0KM[2]={2.5,3.5};
1187 static const G4double B1KM[2]={1.6,1.6};
1269 <<
" Fdistr "<<Fdistr<<
G4endl;
1301 <<
" MaxT MaxTR "<<tmax<<
" "<<MaxTR<<
G4endl;
1306 G4double DDD0=MaxTR*0.5, DDD1=0.0, DDD2=MaxTR;
1311 static const G4int maxNumberOfLoops = 10000;
1312 G4int loopCounter = -1;
1313 while ( (
std::abs(delta) > 0.0001) &&
1314 ++loopCounter < maxNumberOfLoops )
1319 DDD0 = (DDD0+DDD1)*0.5;
1324 DDD0 = (DDD0+DDD2)*0.5;
1326 delta =
GetFt(DDD0)*norm - rand;
1328 return (loopCounter >= maxNumberOfLoops) ? 0.0 : DDD0;
1337 for(
G4int M = 0; M <=
N; ++M) {
1339 if (
N > 0 &&
N > M && M > 0 ) {