61const G4int G4ElasticHadrNucleusHE::fHadronCode[] =
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};
66const G4int G4ElasticHadrNucleusHE::fHadronType[] =
67{2,3,6,0,4,5,4,4,4,5,
71const G4int G4ElasticHadrNucleusHE::fHadronType1[] =
72{3,4,1,0,5,6,5,5,5,6,
76G4double G4ElasticHadrNucleusHE::fLineF[] = {0.0};
77G4double G4ElasticHadrNucleusHE::fEnergy[] = {0.0};
78G4double G4ElasticHadrNucleusHE::fLowEdgeEnergy[] = {0.0};
79G4double G4ElasticHadrNucleusHE::fBinom[240][240] = {{0.0}};
82G4ElasticHadrNucleusHE::fElasticData[NHADRONS][ZMAX] = {{
nullptr}};
88G4bool G4ElasticHadrNucleusHE::fStoreToFile =
false;
89G4bool G4ElasticHadrNucleusHE::fRetrieveFromFile =
false;
104 G4double mass2GeV2= massGeV*massGeV;
106 DefineNucleusParameters(
A);
110 massA2 = massA*massA;
116 for(
G4int kk = 0; kk<NENERGY; ++kk)
119 G4double plab2= e[kk]*(e[kk] + 2.0*massGeV);
120 G4double Q2m = 4.0*plab2*massA2/(mass2GeV2 + massA2 + 2.*massA*elab);
136void G4ElasticData::DefineNucleusParameters(
G4int A)
228 if(A < 100 && A > 3) { Pnucl = 0.176 + 0.00275*
A; }
229 else { Pnucl = 0.4; }
233 if(
A >= 100) { Aeff = 0.7; }
234 else if(A < 100 && A > 75) { Aeff = 1.5 - 0.008*
A; }
247 dQ2 = hMass = hMass2 = hLabMomentum = hLabMomentum2 = HadrEnergy
248 = R1 = R2 = Pnucl = Aeff = HadrTot = HadrSlope = HadrReIm = TotP = DDSect2
249 = DDSect3 = ConstU = Slope1 = Slope2 = Coeff1 = Coeff2
250 = Slope0 = Coeff0 = aAIm = aDIm = Dtot11 = Q2max = 0.0;
251 iHadrCode = iHadron = iHadron1 = 0;
254 ekinLowLimit = 400.0*CLHEP::MeV;
256 BoundaryP[0]=9.0; BoundaryTG[0]=5.0;BoundaryTL[0]=0.;
257 BoundaryP[1]=20.0;BoundaryTG[1]=1.5;BoundaryTL[1]=0.;
258 BoundaryP[2]=5.0; BoundaryTG[2]=1.0;BoundaryTL[2]=1.5;
259 BoundaryP[3]=8.0; BoundaryTG[3]=3.0;BoundaryTL[3]=0.;
260 BoundaryP[4]=7.0; BoundaryTG[4]=3.0;BoundaryTL[4]=0.;
261 BoundaryP[5]=5.0; BoundaryTG[5]=2.0;BoundaryTL[5]=0.;
262 BoundaryP[6]=5.0; BoundaryTG[6]=1.5;BoundaryTL[6]=3.0;
266 if(fEnergy[0] == 0.0) {
267#ifdef G4MULTITHREADED
269 if(fEnergy[0] == 0.0) {
278 fLowEdgeEnergy[0] = 0.0;
279 fLowEdgeEnergy[1] = 0.5;
280 fLowEdgeEnergy[2] = 0.7;
281 fLowEdgeEnergy[3] = 0.9;
284 for(
G4int i=4; i<NENERGY; ++i) {
286 fLowEdgeEnergy[i] = e/f;
290 G4cout <<
"### G4ElasticHadrNucleusHE: energy points in GeV" <<
G4endl;
291 for(
G4int i=0; i<NENERGY; ++i) {
292 G4cout <<
" " << i <<
" " << fLowEdgeEnergy[i]
293 <<
" " << fEnergy[i] <<
G4endl;
296#ifdef G4MULTITHREADED
307 outFile <<
"G4ElasticHadrNucleusHE is a hadron-nucleus elastic scattering\n"
308 <<
"model developed by N. Starkov which uses a Glauber model\n"
309 <<
"parameterization to calculate the final state. It is valid\n"
310 <<
"for all hadrons with incident momentum above 0.4 GeV/c.\n";
318 for(
G4int j = 0; j < NHADRONS; ++j) {
319 for(
G4int k = 0; k < ZMAX; ++k) {
323 fElasticData[j][k] =
nullptr;
324 for(
G4int l = j+1; l < NHADRONS; ++l) {
325 if(ptr == fElasticData[l][k]) { fElasticData[l][k] =
nullptr; }
331 fDirectory =
nullptr;
339 if(!isMaster) {
return; }
344 for(
G4int i=0; i<2; ++i) {
347 iHadrCode = fHadronCode[i];
348 iHadron = fHadronType[i];
349 iHadron1 = fHadronType1[i];
351 hMass2 = hMass*hMass;
352 for(
G4int j=0; j<numOfCouples; ++j) {
355 std::size_t numOfElem = mat->GetNumberOfElements();
356 for(std::size_t k=0; k<numOfElem; ++k) {
357 G4int Z = std::min((*elmVec)[k]->GetZasInt(), ZMAX-1);
358 if(!fElasticData[i][
Z]) {
359 if(1 == i &&
Z > 1) {
360 fElasticData[1][
Z] = fElasticData[0][
Z];
378 G4double kine = sqrt(inLabMom*inLabMom + mass*mass) - mass;
379 if(kine <= ekinLowLimit) {
382 G4int Z = std::min(iZ,ZMAX-1);
388 hMass2 = hMass*hMass;
393 G4cout<<
"G4ElasticHadrNucleusHE::SampleT: "
395 <<
" at Z= " <<
Z <<
" A= " <<
A
396 <<
" plab(GeV)= " << plab
397 <<
" hadrCode= " << iHadrCode
402 for(idx=0; idx<NHADRONS; ++idx) {
403 if(iHadrCode == fHadronCode[idx]) {
404 iHadron = fHadronType[idx];
405 iHadron1 = fHadronType1[idx];
410 if(0 > iHadron) {
return 0.0; }
413 Q2 = HadronProtonQ2(plab, tmax);
424 ElD1 = fElasticData[idx][
Z];
425 if(!ElD1) {
return 0.0; }
429 Q2 = HadronNucleusQ2_2(ElD1, plab, tmax);
432 G4cout<<
" SampleT: Q2(GeV^2)= "<<Q2<<
" t/tmax= "
444#ifdef G4MULTITHREADED
446 if(!fElasticData[idx][
Z]) {
450 if(fRetrieveFromFile) {
451 std::ostringstream ss;
452 InFileName(ss, p,
Z);
453 std::ifstream infile(ss.str(), std::ios::in);
454 for(
G4int i=0; i<NENERGY; ++i) {
455 if(ReadLine(infile, pElD->fCumProb[i])) {
458 fRetrieveFromFile =
false;
471 <<
" Z= " <<
Z <<
" idx= " << idx <<
" iHadron= " << iHadron
472 <<
" iHadron1= " << iHadron1 <<
" iHadrCode= " << iHadrCode
473 <<
"\n R1= " << R1 <<
" R2= " << R2 <<
" Aeff= " << Aeff
474 <<
" Pnucl= " << Pnucl <<
G4endl;
477 if(!fRetrieveFromFile) {
478 for(
G4int i=0; i<NENERGY; ++i) {
480 hLabMomentum2 = T*(T + 2.*hMass);
481 hLabMomentum = std::sqrt(hLabMomentum2);
482 HadrEnergy = hMass + T;
483 DefineHadronValues(
Z);
484 Q2max = pElD->maxQ2[i];
486 G4int length = FillFq2(
A);
487 (pElD->fCumProb[i]).reserve(length);
488 G4double norm = 1.0/fLineF[length-1];
491 G4cout <<
"### i= " << i <<
" Z= " <<
Z <<
" A= " <<
A
492 <<
" length= " << length <<
" Q2max= " << Q2max <<
G4endl;
495 (pElD->fCumProb[i]).push_back(0.0);
496 for(
G4int ii=1; ii<length-1; ++ii) {
497 (pElD->fCumProb[i]).push_back(fLineF[ii]*norm);
499 G4cout <<
" ii= " << ii <<
" val= "
500 << (pElD->fCumProb[i])[ii] <<
G4endl;
503 (pElD->fCumProb[i]).push_back(1.0);
508 std::ostringstream ss;
509 OutFileName(ss, p,
Z);
510 std::ofstream fileout(ss.str());
511 for(
G4int i=0; i<NENERGY; ++i) {
512 WriteLine(fileout, pElD->fCumProb[i]);
518 G4cout <<
" G4ElasticHadrNucleusHE::FillData done for idx= " << idx
522 fElasticData[idx][
Z] = pElD;
524#ifdef G4MULTITHREADED
532void G4ElasticHadrNucleusHE::InterpolateHN(
G4int n,
const G4double EnP[],
538 for(i=1; i<
n; ++i) {
if(hLabMomentum <= EnP[i]) {
break; } }
539 if(i == n) { i =
n - 1; }
541 Coeff0 = LineInterpol(EnP[i], EnP[i-1], C0P[i], C0P[i-1], hLabMomentum);
542 Coeff1 = LineInterpol(EnP[i], EnP[i-1], C1P[i], C1P[i-1], hLabMomentum);
543 Slope0 = LineInterpol(EnP[i], EnP[i-1], B0P[i], B0P[i-1], hLabMomentum);
544 Slope1 = LineInterpol(EnP[i], EnP[i-1], B1P[i], B1P[i-1], hLabMomentum);
553G4ElasticHadrNucleusHE::HadronNucleusQ2_2(
const G4ElasticData* pElD,
556 G4double ekin = std::sqrt(hMass2 + plab*plab) - hMass;
559 G4cout<<
"Q2_2: ekin(GeV)= " << ekin <<
" plab(GeV/c)= " << plab
560 <<
" tmax(GeV2)= " << tmax <<
G4endl;
564 for(idx=0; idx<NENERGY-1; ++idx) {
565 if(ekin <= fLowEdgeEnergy[idx+1]) {
break; }
572 Q2max = pElD->maxQ2[idx];
573 G4int length = (
G4int)(pElD->fCumProb[idx]).size();
578 for(iNumbQ2=1; iNumbQ2<length; ++iNumbQ2) {
579 if(Rand <= (pElD->fCumProb[idx])[iNumbQ2]) {
break; }
581 iNumbQ2 = std::min(iNumbQ2, length - 1);
582 G4double Q2 = GetQ2_2(iNumbQ2, length, pElD->fCumProb[idx], Rand);
583 Q2 = std::min(Q2, Q2max);
587 G4cout<<
" HadrNucleusQ2_2(2): Q2= "<<Q2<<
" iNumbQ2= " << iNumbQ2
588 <<
" rand= " << Rand <<
" Q2max= " << Q2max
589 <<
" tmax= " << tmax <<
G4endl;
600 const std::vector<G4double>& F,
610 xx = (xx > 20.) ? 0.0 :
G4Exp(-xx);
611 G4double Y = X1 -
G4Log(1.0 - (ranUni - F1)*(1.0 - xx)/(1.0 - F1))/R1;
616 if(kk == 1 || kk == 0) {
632 G4cout <<
"GetQ2_2 kk= " << kk <<
" X2= " << X2 <<
" X3= " << X3
633 <<
" F2= " << F2 <<
" F3= " << F3 <<
" Rndm= " << ranUni <<
G4endl;
643 G4cout <<
" X1= " << X1 <<
" F1= " << F1 <<
" D0= "
647 if(std::abs(D0) < 1.e-9) {
648 Y = X2 + (ranUni - F2)*(X3 - X2)/(F3 - F2);
650 G4double DA = X1*F2+X3*F1+X2*F3-X3*F2-X1*F3-X2*F1;
654 Y = (DA*ranUni*ranUni + DB*ranUni + DC)/D0;
671 for(ii=1; ii<ONQ2-1; ++ii) {
672 curSum = curSec = 0.0;
674 for(
G4int jj=0; jj<10; ++jj) {
675 curQ2 = Q2l+(jj + 0.5)*ddQ2;
676 if(curQ2 >= Q2max) {
break; }
677 curSec = HadrNucDifferCrSec(
A, curQ2);
680 G4double del = (curQ2 >= Q2max) ? Q2max - Q2l : dQ2;
686 G4cout<<ii <<
". FillFq2: A= " <<
A <<
" Q2= "<<Q2l<<
" dQ2= "
687 <<dQ2<<
" Tot= "<<totSum <<
" dTot " <<curSum
688 <<
" curSec= " <<curSec<<
G4endl;
690 if(totSum*1.e-4 > curSum || Q2l >= Q2max) {
break; }
692 ii = std::min(ii, ONQ2-2);
696 xx = (xx > 20.) ? 0.0 :
G4Exp(-xx);
697 curSec = HadrNucDifferCrSec(
A, curQ2);
698 totSum += curSec*(1.0 - xx)/R1;
700 fLineF[ii + 1] = totSum;
702 G4cout <<
"### FillFq2 done curQ2= " << curQ2 <<
" Q2max= "<< Q2max
703 <<
" sumG= " << fLineF[ONQ2-2] <<
" totSum= " << totSum
704 <<
" Nbins= " << ii + 1 <<
G4endl;
719 G4double y = (1.-Coeff1-Coeff0)/HadrSlope*(1.-
G4Exp(-HadrSlope*Q2))
720 + Coeff0*(1.-
G4Exp(-Slope0*Q2))
721 + Coeff2/Slope2*
G4Exp(Slope2*valueConstU)*(
G4Exp(Slope2*Q2)-1.)
722 + 2.*Coeff1/Slope1*(1./Slope1-(1./Slope1+SqrQ2)*
G4Exp(-Slope1*SqrQ2));
729 G4double prec =
A > 208 ? 1.0e-7 : 1.0e-6;
737 G4cout<<
" Fq2 Before for i Tot B Im "<<HadrTot<<
" "<<HadrSlope<<
" "
741 G4cout <<
"GetFq2: Stot= " << Stot <<
" Bhad= " << Bhad
743 <<
" Asq= " << Asq <<
G4endl;
744 G4cout <<
"R1= " << R1 <<
" R2= " << R2 <<
" Pnucl= " << Pnucl <<
G4endl;
751 G4double Norm = (R12*R1-Pnucl*R22*R2);
755 G4double Unucl = Stot/twopi*R13/Norm;
758 G4double FiH = std::asin(HadrReIm/Rho2);
762 G4cout <<
"UnucRho2= " << UnucRho2 <<
" FiH= " << FiH <<
" NN2= " << NN2
763 <<
" Norm= " << Norm <<
G4endl;
768 for(
G4int i1 = 1; i1<=
A; ++i1)
770 N1 *= (-Unucl*Rho2*(
A-i1+1)/(
G4double)i1);
774 for(
G4int i2 = 1; i2<=
A; ++i2)
776 N2 *= (-Unucl*Rho2*(
A-i2+1)/(
G4double)i2);
779 for(
G4int j2=0; j2<= i2; ++j2)
785 for(
G4int j1=0; j1<=i1; ++j1)
791 N4*exp1*exp2*(1.-
G4Exp(-Q2*dddd))*GetBinomCof(i1,j1)/dddd;
793 Prod2 += Prod3*N5*GetBinomCof(i2,j2);
795 Prod1 += Prod2*N2*std::cos(FiH*(i1-i2));
797 if (std::abs(Prod2*N2/Prod1)<prec)
break;
800 if(std::abs(N1*Prod1/Prod0) < prec)
break;
807 G4cout <<
"GetLightFq2 Z= " <<
Z <<
" A= " <<
A
808 <<
" Q2= " << Q2 <<
" Res= " << Prod0 <<
G4endl;
827 BoundaryTL[0] = Q2max;
828 BoundaryTL[1] = Q2max;
829 BoundaryTL[3] = Q2max;
830 BoundaryTL[4] = Q2max;
831 BoundaryTL[5] = Q2max;
833 G4double dSigPodT = HadrTot*HadrTot*(1+HadrReIm*HadrReIm)*
834 ( Coeff1*
G4Exp(-Slope1*SqrQ2)+
835 Coeff2*
G4Exp( Slope2*(valueConstU)+aQ2)+
836 (1-Coeff1-Coeff0)*
G4Exp(-HadrSlope*aQ2)+
837 Coeff0*
G4Exp(-Slope0*aQ2) )*2.568/(16*pi);
853 G4double R23Ap = R22*R2*Pnucl/R22Ap;
857 G4double R12ApdR22Ap = 0.5*(R12Apd+R22Apd);
859 G4double DDSec1p = (DDSect2+DDSect3*
G4Log(0.53*HadrEnergy/R1));
861 std::sqrt((R12+R22)*0.5)));
862 G4double DDSec3p = (DDSect2+DDSect3*
G4Log(0.53*HadrEnergy/R2));
864 G4double Norm = (R12*R1-Pnucl*R22*R2)*Aeff;
867 G4double Unucl = Stot/(twopi*Norm)*R13;
868 G4double UnuclScr = Stot/(twopi*Norm)*R13Ap;
878 for(
G4int i=1; i<=
A; ++i) {
884 for(
G4int l=1; l<=i; ++l) {
885 exp1 = l/R22B+(i-l)/R12B;
888 Prod1 += expn4*
G4Exp(-aQ2/(exp1*4));
893 ReElasticAmpl0 += Prod1*
N*std::sin(FiH*i);
894 ImElasticAmpl0 += Prod1*dcos;
895 if(std::abs(Prod1*
N/ImElasticAmpl0) < 0.000001)
break;
898 static const G4double pi25 = CLHEP::pi/2.568;
899 ImElasticAmpl0 *= pi25;
900 ReElasticAmpl0 *= pi25;
908 C2/R12ApdR22Ap*
G4Exp(-aQ2/(4*R12ApdR22Ap))+
909 C3*R22Ap/2*
G4Exp(-aQ2/8*R22Ap));
913 for(
G4int i=1; i<=
A-2; ++i) {
914 N1p *= (-UnuclScr*Rho2*(
A-i-1)/(
G4double)i);
919 for(
G4int l=0; l<=i; ++l) {
920 if(l > 0) { BinCoeff *= (i-l+1)/(
G4double)l; }
922 exp1 = l/R22B+(i-l)/R12B;
927 Din2 += N2p*BinCoeff*(
C1/exp1p*
G4Exp(-aQ2/(4*exp1p))-
928 C2/exp2p*
G4Exp(-aQ2/(4*exp2p))+
929 C3/exp3p*
G4Exp(-aQ2/(4*exp3p)));
931 DmedTot += N2p*BinCoeff*(
C1/exp1p-
C2/exp2p+
C3/exp3p);
938 DTot1 += DmedTot*dcos;
940 if(std::abs(Din2*N1p/Din1) < 0.000001)
break;
949 G4double DiffCrSec2 = (ReElasticAmpl0*ReElasticAmpl0+
950 (ImElasticAmpl0+Din1)*
951 (ImElasticAmpl0+Din1))/twopi;
954 aAIm = ImElasticAmpl0;
962void G4ElasticHadrNucleusHE::DefineHadronValues(
G4int Z)
968 G4cout <<
"GetHadrValues: Z= " <<
Z <<
" iHadr= " << iHadron
969 <<
" E(GeV)= " << HadrEnergy <<
" sqrS= " << sqrS
970 <<
" plab= " << hLabMomentum
971 <<
" E - m "<<HadrEnergy - hMass<<
G4endl;
982 if(hLabMomentum > 10) {
983 TotP = TotN = 7.5*logE - 40.12525 + 103*
G4Exp(-logS*0.165);
988 if( hLabMomentum > 1.4 ) {
989 TotN = 33.3+15.2*(hLabMomentum2-1.35)/
992 }
else if(hLabMomentum > 0.8) {
994 TotN = 33.0 + 25.5*A0*A0;
997 TotN = 33.0 + 30.*A0*A0*A0*A0;
1001 if(hLabMomentum >= 1.05) {
1002 TotP = 39.0+75.*(hLabMomentum-1.2)/(hLabMomentum2*hLabMomentum+0.15);
1003 }
else if(hLabMomentum >= 0.7) {
1005 TotP = 23.0 + 40.*A0*A0;
1010 HadrTot = 0.5*(TotP+TotN);
1013 if(hLabMomentum >= 2.) { HadrSlope = 5.44 + 0.88*logS; }
1014 else if(hLabMomentum >= 0.5) { HadrSlope = 3.73*hLabMomentum-0.37; }
1015 else { HadrSlope = 1.5; }
1018 if(hLabMomentum >= 1.2) {
1019 HadrReIm = 0.13*(logS - 5.8579332)*
G4Exp(-logS*0.18);
1020 }
else if(hLabMomentum >= 0.6) {
1021 HadrReIm = -75.5*(
G4Exp(
G4Log(hLabMomentum)*0.25)-0.95)/
1024 HadrReIm = 15.5*hLabMomentum/(27*hLabMomentum2*hLabMomentum+2);
1030 if( iHadrCode == 3122) {
1034 }
else if( iHadrCode == 3222) {
1038 }
else if(iHadrCode == 3112 || iHadrCode == 3212 ) {
1042 }
else if( iHadrCode == 3312 || iHadrCode == 3322 ) {
1046 }
else if( iHadrCode == 3334) {
1055 HadrTot = 5.2+5.2*logE + 123.2/sqrS;
1056 HadrSlope = 8.32+0.57*logS;
1058 if( HadrEnergy < 1000 ) {
1059 HadrReIm = 0.06*(sqrS-2.236)*(sqrS-14.14)*
G4Exp(-logS*0.8);
1061 HadrReIm = 0.6*(logS - 5.8579332)*
G4Exp(-logS*0.25);
1066 if( iHadrCode == -3122) {
1070 }
else if( iHadrCode == -3222) {
1074 }
else if(iHadrCode == -3112 || iHadrCode == -3212 ) {
1078 }
else if( iHadrCode == -3312 || iHadrCode == -3322 ) {
1082 }
else if( iHadrCode == -3334) {
1091 if(hLabMomentum >= 3.5) {
1092 TotP = 10.6+2.*logE + 25.*
G4Exp(-logE*0.43);
1094 }
else if(hLabMomentum >= 1.15) {
1095 G4double x = (hLabMomentum - 2.55)/0.55;
1096 G4double y = (hLabMomentum - 1.47)/0.225;
1097 TotP = 3.2*
G4Exp(-x*x) + 12.*
G4Exp(-y*y) + 27.5;
1099 }
else if(hLabMomentum >= 0.4) {
1100 TotP = 88*(logE+0.2877)*(logE+0.2877)+14.0;
1103 G4double x = (hLabMomentum - 0.29)/0.085;
1104 TotP = 20. + 180.*
G4Exp(-x*x);
1108 if(hLabMomentum >= 3.0 ) {
1109 TotN = 10.6 + 2.*logE + 30.*
G4Exp(-logE*0.43);
1110 }
else if(hLabMomentum >= 1.3) {
1111 G4double x = (hLabMomentum - 2.1)/0.4;
1112 G4double y = (hLabMomentum - 1.4)/0.12;
1113 TotN = 36.1+0.079 - 4.313*logE + 3.*
G4Exp(-x*x) + 1.5*
G4Exp(-y*y);
1114 }
else if(hLabMomentum >= 0.65) {
1115 G4double x = (hLabMomentum - 0.72)/0.06;
1116 G4double y = (hLabMomentum - 1.015)/0.075;
1117 TotN = 36.1 + 10.*
G4Exp(-x*x) + 24*
G4Exp(-y*y);
1118 }
else if(hLabMomentum >= 0.37) {
1120 TotN = 26. + 110.*x*x;
1122 G4double x = (hLabMomentum - 0.29)/0.07;
1123 TotN = 28.0 + 40.*
G4Exp(-x*x);
1125 HadrTot = (TotP+TotN)*0.5;
1127 HadrSlope = 7.28+0.245*logS;
1128 HadrReIm = 0.2*(logS - 4.6051702)*
G4Exp(-logS*0.15);
1137 HadrTot = 10.6+1.8*logE + 9.0*
G4Exp(-logE*0.55);
1138 if(HadrEnergy>100) { HadrSlope = 15.0; }
1139 else { HadrSlope = 1.0+1.76*logS - 2.84/sqrS; }
1141 HadrReIm = 0.4*(sHadr-20)*(sHadr-150)*
G4Exp(-
G4Log(sHadr+50)*2.1);
1148 HadrTot = 10+1.8*logE + 25./sqrS;
1149 HadrSlope = 6.98+0.127*logS;
1150 HadrReIm = 0.4*(sHadr-20)*(sHadr-20)*
G4Exp(-
G4Log(sHadr+50)*2.1);
1157 G4cout <<
"HadrTot= " << HadrTot <<
" HadrSlope= " << HadrSlope
1158 <<
" HadrReIm= " << HadrReIm <<
" DDSect2= " << DDSect2
1159 <<
" DDSect3= " << DDSect3 <<
G4endl;
1165 Coeff0 = Coeff1 = Coeff2 = 0.0;
1166 Slope0 = Slope1 = 1.0;
1170 static const G4double EnP0[6]={1.5,3.0,5.0,9.0,14.0,19.0};
1171 static const G4double C0P0[6]={0.15,0.02,0.06,0.08,0.0003,0.0002};
1172 static const G4double C1P0[6]={0.05,0.02,0.03,0.025,0.0,0.0};
1173 static const G4double B0P0[6]={1.5,2.5,3.0,4.5,1.4,1.25};
1174 static const G4double B1P0[6]={5.0,1.0,3.5,4.0,4.8,4.8};
1177 static const G4double EnN[5]={1.5,5.0,10.0,14.0,20.0};
1178 static const G4double C0N[5]={0.0,0.0,0.02,0.02,0.01};
1179 static const G4double C1N[5]={0.06,0.008,0.0015,0.001,0.0003};
1180 static const G4double B0N[5]={1.5,2.5,3.8,3.8,3.5};
1181 static const G4double B1N[5]={1.5,2.2,3.6,4.5,4.8};
1184 static const G4double EnP[2]={1.5,4.0};
1185 static const G4double C0P[2]={0.001,0.0005};
1186 static const G4double C1P[2]={0.003,0.001};
1187 static const G4double B0P[2]={2.5,4.5};
1188 static const G4double B1P[2]={1.0,4.0};
1191 static const G4double EnPP[4]={1.0,2.0,3.0,4.0};
1192 static const G4double C0PP[4]={0.0,0.0,0.0,0.0};
1193 static const G4double C1PP[4]={0.15,0.08,0.02,0.01};
1194 static const G4double B0PP[4]={1.5,2.8,3.8,3.8};
1195 static const G4double B1PP[4]={0.8,1.6,3.6,4.6};
1198 static const G4double EnPPN[4]={1.0,2.0,3.0,4.0};
1199 static const G4double C0PPN[4]={0.0,0.0,0.0,0.0};
1200 static const G4double C1PPN[4]={0.0,0.0,0.0,0.0};
1201 static const G4double B0PPN[4]={1.5,2.8,3.8,3.8};
1202 static const G4double B1PPN[4]={0.8,1.6,3.6,4.6};
1205 static const G4double EnK[4]={1.4,2.33,3.0,5.0};
1206 static const G4double C0K[4]={0.0,0.0,0.0,0.0};
1207 static const G4double C1K[4]={0.01,0.007,0.005,0.003};
1208 static const G4double B0K[4]={1.5,2.0,3.8,3.8};
1209 static const G4double B1K[4]={1.6,1.6,1.6,1.6};
1212 static const G4double EnKM[2]={1.4,4.0};
1213 static const G4double C0KM[2]={0.006,0.002};
1214 static const G4double C1KM[2]={0.00,0.00};
1215 static const G4double B0KM[2]={2.5,3.5};
1216 static const G4double B1KM[2]={1.6,1.6};
1221 if(hLabMomentum <BoundaryP[0]) {
1222 InterpolateHN(6,EnP0,C0P0,C1P0,B0P0,B1P0);
1224 Coeff2 = 0.8/hLabMomentum2;
1229 if(hLabMomentum < BoundaryP[1]) {
1230 InterpolateHN(5,EnN,C0N,C1N,B0N,B1N);
1232 Coeff2 = 0.8/hLabMomentum2;
1237 if(hLabMomentum < BoundaryP[2]) {
1238 InterpolateHN(2,EnP,C0P,C1P,B0P,B1P);
1244 if(hLabMomentum < BoundaryP[3]) {
1245 InterpolateHN(4,EnPP,C0PP,C1PP,B0PP,B1PP);
1247 Coeff2 = 0.02/hLabMomentum;
1252 if(hLabMomentum < BoundaryP[4]) {
1253 InterpolateHN(4,EnPPN,C0PPN,C1PPN,B0PPN,B1PPN);
1255 Coeff2 = 0.02/hLabMomentum;
1260 if(hLabMomentum < BoundaryP[5]) {
1261 InterpolateHN(4,EnK,C0K,C1K,B0K,B1K);
1263 if(hLabMomentum < 1) { Coeff2 = 0.34; }
1264 else { Coeff2 = 0.34/(hLabMomentum2*hLabMomentum); }
1268 if(hLabMomentum < BoundaryP[6]) {
1269 InterpolateHN(2,EnKM,C0KM,C1KM,B0KM,B1KM);
1271 if(hLabMomentum < 1) { Coeff2 = 0.01; }
1272 else { Coeff2 = 0.01/(hLabMomentum2*hLabMomentum); }
1277 G4cout<<
" HadrVal : Plasb "<<hLabMomentum
1278 <<
" iHadron "<<iHadron<<
" HadrTot "<<HadrTot<<
G4endl;
1289 Fdistr = (1-Coeff1-Coeff0) / HadrSlope*(1-
G4Exp(-HadrSlope*Q2))
1290 + Coeff0*(1-
G4Exp(-Slope0*Q2))
1291 + Coeff2/Slope2*
G4Exp(Slope2*ConstU)*(
G4Exp(Slope2*Q2)-1)
1292 + 2*Coeff1/Slope1*(1/Slope1-(1/Slope1+SqrQ2)*
G4Exp(-Slope1*SqrQ2));
1295 G4cout<<
"Old: Coeff0 Coeff1 Coeff2 "<<Coeff0<<
" "
1296 <<Coeff1<<
" "<<Coeff2<<
" Slope Slope0 Slope1 Slope2 "
1297 <<HadrSlope<<
" "<<Slope0<<
" "<<Slope1<<
" "<<Slope2
1298 <<
" Fdistr "<<Fdistr<<
G4endl;
1308 hLabMomentum = plab;
1309 hLabMomentum2 = hLabMomentum*hLabMomentum;
1310 HadrEnergy = std::sqrt(hMass2 + hLabMomentum2);
1311 DefineHadronValues(1);
1316 BoundaryTL[0] = tmax;
1317 BoundaryTL[1] = tmax;
1318 BoundaryTL[3] = tmax;
1319 BoundaryTL[4] = tmax;
1320 BoundaryTL[5] = tmax;
1322 G4double MaxTR = (plab < BoundaryP[iHadron1]) ?
1323 BoundaryTL[iHadron1] : BoundaryTG[iHadron1];
1326 G4cout<<
"3 GetKin. : iHadron1 "<<iHadron1
1327 <<
" Bound.P[iHadron1] "<<BoundaryP[iHadron1]
1328 <<
" Bound.TL[iHadron1] "<<BoundaryTL[iHadron1]
1329 <<
" Bound.TG[iHadron1] "<<BoundaryTG[iHadron1]
1330 <<
" MaxT MaxTR "<<tmax<<
" "<<MaxTR<<
G4endl;
1335 G4double DDD0=MaxTR*0.5, DDD1=0.0, DDD2=MaxTR;
1338 G4double delta = GetFt(DDD0)*norm - rand;
1340 static const G4int maxNumberOfLoops = 10000;
1341 G4int loopCounter = -1;
1342 while ( (std::abs(delta) > 0.0001) &&
1343 ++loopCounter < maxNumberOfLoops )
1348 DDD0 = (DDD0+DDD1)*0.5;
1353 DDD0 = (DDD0+DDD2)*0.5;
1355 delta = GetFt(DDD0)*norm - rand;
1357 return (loopCounter >= maxNumberOfLoops) ? 0.0 : DDD0;
1362void G4ElasticHadrNucleusHE::Binom()
1368 if (
N > 0 &&
N >
M &&
M > 0 ) {
1372 fBinom[
N][
M] = Fact1;
1380G4ElasticHadrNucleusHE::InFileName(std::ostringstream& ss,
1386 ss << fDirectory <<
"/";
1389 OutFileName(ss, p,
Z);
1395G4ElasticHadrNucleusHE::OutFileName(std::ostringstream& ss,
1403G4bool G4ElasticHadrNucleusHE::ReadLine(std::ifstream& infile,
1404 std::vector<G4double>& v)
1408 if (infile.fail()) {
return false; }
1412 for(
G4int i=0; i<
n; ++i) {
1414 if (infile.fail()) {
return false; }
1423void G4ElasticHadrNucleusHE::WriteLine(std::ofstream& outfile,
1424 std::vector<G4double>& v)
1426 std::size_t
n = v.size();
1429 for(std::size_t i=0; i<
n; ++i) {
1430 outfile << v[i] <<
" ";
G4double Y(G4double density)
const char * G4FindDataDir(const char *)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4ElasticData(const G4ParticleDefinition *h, G4int Z, G4int A, const G4double *e)
~G4ElasticHadrNucleusHE() override
G4ElasticHadrNucleusHE(const G4String &name="hElasticGlauber")
void ModelDescription(std::ostream &) const override
void InitialiseModel() override
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
static G4NistManager * Instance()
G4double GetAtomicMassAmu(const G4String &symb) const
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double GetPDGMass() const
G4int GetPDGEncoding() const
const G4String & GetParticleName() const
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
static G4Proton * Proton()