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,
104 G4double mass2GeV2= massGeV*massGeV;
119 G4double plab2= e[kk]*(e[kk] + 2.0*massGeV);
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; }
267#ifdef G4MULTITHREADED
290 G4cout <<
"### G4ElasticHadrNucleusHE: energy points in GeV" <<
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";
344 for(
G4int i=0; i<2; ++i) {
352 for(
size_t j=0; j<numOfCouples; ++j) {
355 size_t numOfElem = mat->GetNumberOfElements();
356 for(
size_t k=0; k<numOfElem; ++k) {
359 if(1 == i &&
Z > 1) {
378 G4double kine = sqrt(inLabMom*inLabMom + mass*mass) - mass;
393 G4cout<<
"G4ElasticHadrNucleusHE::SampleT: "
395 <<
" at Z= " <<
Z <<
" A= " <<
A
396 <<
" plab(GeV)= " << plab
410 if(0 >
iHadron) {
return 0.0; }
425 if(!ElD1) {
return 0.0; }
432 G4cout<<
" SampleT: Q2(GeV^2)= "<<Q2<<
" t/tmax= "
444#ifdef G4MULTITHREADED
451 std::ostringstream ss;
453 std::ifstream infile(ss.str(), std::ios::in);
471 <<
" Z= " <<
Z <<
" idx= " << idx <<
" iHadron= " <<
iHadron
473 <<
"\n R1= " <<
R1 <<
" R2= " <<
R2 <<
" Aeff= " <<
Aeff
487 (pElD->
fCumProb[i]).reserve(length);
491 G4cout <<
"### i= " << i <<
" Z= " <<
Z <<
" A= " <<
A
492 <<
" length= " << length <<
" Q2max= " <<
Q2max <<
G4endl;
496 for(
G4int ii=1; ii<length-1; ++ii) {
499 G4cout <<
" ii= " << ii <<
" val= "
508 std::ostringstream ss;
510 std::ofstream fileout(ss.str());
518 G4cout <<
" G4ElasticHadrNucleusHE::FillData done for idx= " << idx
524#ifdef G4MULTITHREADED
539 if(i ==
n) { i =
n - 1; }
559 G4cout<<
"Q2_2: ekin(GeV)= " << ekin <<
" plab(GeV/c)= " << plab
560 <<
" tmax(GeV2)= " << tmax <<
G4endl;
564 for(idx=0; idx<
NENERGY-1; ++idx) {
578 for(iNumbQ2=1; iNumbQ2<length; ++iNumbQ2) {
579 if(Rand <= (pElD->
fCumProb[idx])[iNumbQ2]) {
break; }
581 iNumbQ2 =
std::min(iNumbQ2, length - 1);
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);
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; }
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; }
696 xx = (xx > 20.) ? 0.0 :
G4Exp(-xx);
698 totSum += curSec*(1.0 - xx)/
R1;
702 G4cout <<
"### FillFq2 done curQ2= " << curQ2 <<
" Q2max= "<<
Q2max
703 <<
" sumG= " <<
fLineF[
ONQ2-2] <<
" totSum= " << totSum
704 <<
" Nbins= " << ii + 1 <<
G4endl;
741 G4cout <<
"GetFq2: Stot= " << Stot <<
" Bhad= " << Bhad
743 <<
" Asq= " << Asq <<
G4endl;
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)
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;
857 G4double R12ApdR22Ap = 0.5*(R12Apd+R22Apd);
861 std::sqrt((R12+R22)*0.5)));
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;
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;
969 <<
" E(GeV)= " <<
HadrEnergy <<
" sqrS= " << sqrS
983 TotP = TotN = 7.5*logE - 40.12525 + 103*
G4Exp(-logS*0.165);
994 TotN = 33.0 + 25.5*A0*A0;
997 TotN = 33.0 + 30.*A0*A0*A0*A0;
1005 TotP = 23.0 + 40.*A0*A0;
1055 HadrTot = 5.2+5.2*logE + 123.2/sqrS;
1092 TotP = 10.6+2.*logE + 25.*
G4Exp(-logE*0.43);
1100 TotP = 88*(logE+0.2877)*(logE+0.2877)+14.0;
1109 TotN = 10.6 + 2.*logE + 30.*
G4Exp(-logE*0.43);
1113 TotN = 36.1+0.079 - 4.313*logE + 3.*
G4Exp(-x*x) + 1.5*
G4Exp(-y*y);
1117 TotN = 36.1 + 10.*
G4Exp(-x*x) + 24*
G4Exp(-y*y);
1120 TotN = 26. + 110.*x*x;
1123 TotN = 28.0 + 40.*
G4Exp(-x*x);
1139 else {
HadrSlope = 1.0+1.76*logS - 2.84/sqrS; }
1148 HadrTot = 10+1.8*logE + 25./sqrS;
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};
1298 <<
" Fdistr "<<Fdistr<<
G4endl;
1330 <<
" MaxT MaxTR "<<tmax<<
" "<<MaxTR<<
G4endl;
1335 G4double DDD0=MaxTR*0.5, DDD1=0.0, DDD2=MaxTR;
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;
1364 for(
G4int N = 0; N < 240; ++N) {
1368 if (N > 0 && N >
M &&
M > 0 ) {
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; }
1424 std::vector<G4double>& v)
1429 for(
G4int i=0; i<
n; ++i) {
1430 outfile << v[i] <<
" ";
G4double Y(G4double density)
static const G4int NHADRONS
static const G4int NENERGY
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
static constexpr double twopi
static constexpr double pi
#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)
std::vector< G4double > fCumProb[NENERGY]
void DefineNucleusParameters(G4int A)
void FillData(const G4ParticleDefinition *p, G4int idx, G4int Z)
~G4ElasticHadrNucleusHE() override
void InterpolateHN(G4int n, const G4double EnP[], const G4double C0P[], const G4double C1P[], const G4double B0P[], const G4double B1P[])
G4double LineInterpol(G4double p0, G4double p2, G4double c1, G4double c2, G4double p)
G4NistManager * nistManager
static const G4int fHadronType1[NHADRONS]
static G4bool fRetrieveFromFile
G4ElasticHadrNucleusHE(const G4String &name="hElasticGlauber")
G4double GetQ2_2(G4int N, G4int Nmax, const std::vector< G4double > &F, G4double rand)
G4double HadronProtonQ2(G4double plab, G4double tmax)
static const G4int fHadronType[NHADRONS]
static G4double fEnergy[NENERGY]
static const G4int fHadronCode[NHADRONS]
G4double HadrNucDifferCrSec(G4int A, G4double Q2)
void ModelDescription(std::ostream &) const override
void InitialiseModel() override
void DefineHadronValues(G4int Z)
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A) override
G4double GetFt(G4double Q2)
static G4double fBinom[240][240]
void InFileName(std::ostringstream &, const G4ParticleDefinition *p, G4int Z)
void WriteLine(std::ofstream &, std::vector< G4double > &)
void OutFileName(std::ostringstream &, const G4ParticleDefinition *p, G4int Z)
G4double GetLightFq2(G4int Z, G4int A, G4double Q)
G4double HadronNucleusQ2_2(const G4ElasticData *pElD, G4double plabGeV, G4double tmax)
static G4double fLowEdgeEnergy[NENERGY]
G4double GetBinomCof(G4int n, G4int m)
static G4bool fStoreToFile
static G4ElasticData * fElasticData[NHADRONS][ZMAX]
static G4double fLineF[ONQ2]
G4bool ReadLine(std::ifstream &, std::vector< G4double > &)
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()
static constexpr double proton_mass_c2
static constexpr double GeV
static constexpr double MeV
static constexpr double pi
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
const char * name(G4int ptype)