59 static const G4double mN=.5*(mNeut+mProt);
63 static const G4int nps=100;
64 static const G4int mps=nps+1;
67 static const G4int nls=150;
68 static const G4int mls=nls+1;
71 static const G4double mi=std::exp(lsi);
72 static const G4double max_s=std::exp(lsa);
73 static const G4double dl=(lsa-lsi)/nls;
74 static const G4double edl=std::exp(dl);
79 static std::vector<G4int> vA;
84 static std::vector<G4double*> vT;
85 static std::vector<G4double*> vL;
97 if(pIU<toler || A<1)
return 1.;
100 G4cout<<
"-*-Warning-*-G4QuasiFreeRatio::GetRatio: A="<<A<<
">238, return zero"<<
G4endl;
108 G4double s_value=std::sqrt(mN2+pM2+dmN*std::sqrt(pM2+mom*mom));
110 if(nDB && lastA==A && std::fabs(s_value-lastS)<toler)
return lastR;
113 lastR=CalcDiff2Prod_Ratio(s_value,A);
118 if(nDB)
for (i=0; i<nDB; i++)
if(A==vA[i])
137 for(
G4int j=1; j<=nps; j++)
140 lastT[j]=CalcDiff2Prod_Ratio(sv,A);
153 for(
G4int j=0; j<=nls; j++)
155 lastL[j]=CalcDiff2Prod_Ratio(sv,A);
230 G4int n=
static_cast<int>(s_value/ds);
233 lastR=v+d*(lastT[n+1]-v)/ds;
238 G4int n=
static_cast<int>(ls/dl);
241 lastR=v+d*(lastL[n+1]-v)/dl;
243 if(lastR<0.) lastR=0.;
244 if(lastR>1.) lastR=1.;
260 if(s_value<=0. || A<=1)
return 0.;
276 p1=(.023*std::pow(a,0.37)+3.5/a3+2.1e6/a12+4.e-14*a5)/(1.+7.6e-4*a*sa+2.15e7/a11);
277 p2=(1.42*std::pow(a,0.61)+1.6e5/a8+4.5e-8*a4)/(1.+4.e-8*a4+1.2e4/a6);
279 p4=(.036/q+.0009*q)/(1.+6./a3+1.e-7*a3);
280 p5=1.3*std::pow(a,0.1168)/(1.+1.2e-8*a3);
281 p6=.00046*(a+11830./a2);
282 p7=1./(1.+6.17/a2+.00406*a);
284 else if(A==1 && mA!=1)
294 else if(std::fabs(s_value-S)/S<.0001)
return R;
298 R=1./(1.+1./(p1+p2/s4+p4*dl*dl/(1.+p6*std::pow(s_value,p7))));
308 static const G4double pFm2= pFm*pFm;
312 static const G4double mNeut2=mNeut*mNeut;
313 static const G4double dmNeut=mNeut+mNeut;
315 static const G4double mProt2=mProt*mProt;
316 static const G4double dmProt=mProt+mProt;
317 static const G4double maxDM=mProt*12.;
329 ResHV->push_back(hadron);
332 G4int tPDG=90000000+tgZ*1000+tgN;
369 G4cerr<<
"-Warning-G4DifR::TFra:<NegativeEnergy>E="<<E<<
",E2="<<E2<<
"<M2="<<mP2<<
G4endl;
383 if(mMax>maxDM) mMax=maxDM;
387 G4cerr<<
"-Warning-G4DifR::TFra:ZeroDiffractionMRange, mi="<<mMin<<
",ma="<<mMax<<
G4endl;
392 G4double mDif=std::exp(R*std::log(mMax)+(1.-R)*std::log(mMin));
398 G4cout<<
"G4QDiffR::TargFrag:Before XS, P="<<P<<
",Z="<<Z<<
",N="<<N<<
",PDG="<<pPDG<<
G4endl;
401 if(pPDG>3400 || pPDG<-3400)
G4cout<<
"-Warning-G4QDifR::Fragment: pPDG="<<pPDG<<
G4endl;
402 G4double maxt=(ds*ds-4*mP2*mDif2)/s_value;
406 G4cout<<
"G4QDifR::TFra:ph="<<pPDG<<
",P="<<P<<
",t="<<t<<
"<"<<maxt<<
G4endl;
410 else G4cout<<
"******G4QDiffractionRatio::TargFragment: -t="<<mint<<
G4endl;
415 G4cout<<
"G4QDiffraRatio::TargFragment: -t="<<t<<
", maxt="<<maxt<<
", cost="<<cost<<
G4endl;
417 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
419 if (cost>1.) cost=1.;
420 else if(cost<-1.) cost=-1.;
423 G4cerr<<
"G4QDiffRat::TargFragm: *NAN* cost="<<cost<<
",t="<<t<<
",tmax="<<maxt<<
G4endl;
430 if(!
G4QHadron(tot4M).RelDecayIn2(r4M, d4M, dir4M, cost, cost))
432 G4cerr<<
"G4QDifR::TFr:M="<<tot4M.
m()<<
",T="<<mT<<
",D="<<mDif<<
",T+D="<<mT+mDif<<
G4endl;
437 G4cout<<
"G4QDifRat::TargFragm:d4M="<<d4M<<
"+r4M="<<r4M<<
"="<<d4M+r4M<<
"="<<tot4M<<
G4endl;
443 ResHV->push_back(hadron);
445 G4cout<<
"G4QDiffractionRatio::TargFragm: *Filled* LeadingNuc="<<r4M<<pPDG<<
G4endl;
451 G4cout<<
"G4QDiffRatio::TgFrag:tPDG="<<tPDG<<
",rPDG="<<rPDG<<
",d4M="<<d4M<<
G4endl;
456 G4cout<<
"G4QDiffractionRatio::TargFragment: EnvPDG="<<tPDG<<
G4endl;
465 G4cerr<<
"***G4QDiffractionRatio::TargFrag: G4QException is catched"<<
G4endl;
468 G4Exception(
"G4QDiffractionRatio::TargFragment()",
"HAD_CHPS_0027",
472 G4int qNH=leadhs->size();
473 if(qNH)
for(
G4int iq=0; iq<qNH; iq++)
476 ResHV->push_back(loh);
488 static const G4double pFm2= pFm*pFm;
492 static const G4double mNeut2=mNeut*mNeut;
493 static const G4double dmNeut=mNeut+mNeut;
495 static const G4double mProt2=mProt*mProt;
496 static const G4double dmProt=mProt+mProt;
497 static const G4double maxDM=mProt*12.;
508 ResHV->push_back(hadron);
511 G4int tPDG=90000000+tgZ*1000+tgN;
548 G4cerr<<
"-Warning-G4DifR::PFra:<NegativeEnergy>E="<<E<<
",E2="<<E2<<
"<M2="<<mP2<<
G4endl;
557 if(mMax>maxDM) mMax=maxDM;
561 G4cerr<<
"-Warning-G4DifR::PFra:ZeroDiffractionMRange, mi="<<mMin<<
",ma="<<mMax<<
G4endl;
566 G4double mDif=std::exp(R*std::log(mMax)+(1.-R)*std::log(mMin));
572 G4cout<<
"G4QDiffR::PFra: Before XS, P="<<P<<
", Z="<<Z<<
", N="<<N<<
", PDG="<<pPDG<<
G4endl;
575 if(pPDG>3400 || pPDG<-3400)
G4cout<<
"-Warning-G4QDifR::Fragment: pPDG="<<pPDG<<
G4endl;
578 G4double maxt=(ds*ds-4*mT2*mDif2)/s_value;
580 G4cout<<
"G4QDifR::PFra:ph="<<pPDG<<
",P="<<P<<
",t="<<mint<<
"<"<<maxt<<
G4endl;
584 else G4cout<<
"******G4QDiffractionRatio::ProjFragment: -t="<<mint<<
G4endl;
589 G4cout<<
"G4QDiffRatio::ProjFragment: -t="<<t<<
", maxt="<<maxt<<
", cost="<<cost<<
G4endl;
591 if(cost>1. || cost<-1. || !(cost>-1. || cost<=1.))
593 if (cost>1.) cost=1.;
594 else if(cost<-1.) cost=-1.;
597 G4cerr<<
"G4QDiffRat::ProjFragm: *NAN* cost="<<cost<<
",t="<<t<<
",tmax="<<maxt<<
G4endl;
604 if(!
G4QHadron(tot4M).RelDecayIn2(d4M, r4M, dir4M, cost, cost))
606 G4cerr<<
"G4QDifR::PFr:M="<<tot4M.
m()<<
",T="<<mT<<
",D="<<mDif<<
",T+D="<<mT+mDif<<
G4endl;
611 G4cout<<
"G4QDiffR::ProjFragm:d4M="<<d4M<<
"+r4M="<<r4M<<
"="<<d4M+r4M<<
"="<<tot4M<<
G4endl;
617 ResHV->push_back(hadron);
619 G4cout<<
"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleus="<<t4M<<tPDG<<
G4endl;
622 ResHV->push_back(hadron);
624 G4cout<<
"G4QDiffractionRatio::ProjFragment: *Filled* RecNucleon="<<r4M<<rPDG<<
G4endl;
638 G4cerr<<
"***G4QDiffractionRatio::ProjFragment: G4Quasmon Exception"<<
G4endl;
640 G4Exception(
"G4QDiffractionRatio::ProjFragment()",
"HAD_CHPS_0072",
644 G4int qNH=leadhs->size();
645 if(qNH)
for(
G4int iq=0; iq<qNH; iq++)
658 G4cout<<
"G4QDR::PF:"<<oPDG<<
",M="<<qM<<
",B="<<nB<<
",S="<<nL<<
",C="<<nC<<
G4endl;
676 if(std::fabs(qM-mSigM)<eps)
681 else if(qM>mLamb+mPi)
774 else if(nL>1 && nB==nL)
792 else G4cout<<
"*?*G4QDiffractionRatio::ProjFragment: (1) oPDG="<<oPDG<<
G4endl;
806 else if(nL && nC<nB-nL)
815 else if(nL && nB==nL)
819 if(std::fabs(qM-mSigP)<eps)
824 else if(qM>mLamb+mPi)
829 else if(qM>mNeut+mPi)
877 else if(nL && nC>nB-nL)
910 else if(nB==nC && nC>1)
919 else if(nC<=nB||!nB)
G4cout<<
"*?*G4QDR::ProjFragm: (2) oPDG="<<oPDG<<
G4endl;
932 if(std::fabs(qM-sum)<eps)
936 if(nL) t4Mom=q4M*(ttM/sum);
941 G4cout<<
"***G4QDR::PrFragm:fPDG="<<fPDG<<
"*"<<nB<<
"(fM="<<fMass<<
")+sPDG="<<sPDG
942 <<
"*"<<qPN<<
"(sM="<<sMass<<
")"<<
"="<<sum<<
" > TM="<<qM<<q4M<<oPDG<<
G4endl;
946 ed <<
"***G4QDR::PrFragm:fPDG=" << fPDG <<
"*" << nB <<
"(fM="
947 << fMass <<
")+sPDG=" << sPDG <<
"*" << qPN <<
"(sM=" << sMass
948 <<
")" <<
"=" << sum <<
" > TM=" << qM << q4M << oPDG <<
G4endl;
949 G4Exception(
"G4QDiffractionRatio::ProjFragment()",
"HAD_CHPS_0002",
952 else if(nL && (qM<sum || !
G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom)))
955 G4cout<<
"***G4DF::PrFrag: "<<fPDG<<
"*"<<nB<<
"("<<fMass<<
")+"<<sPDG<<
"*"<<qPN<<
"("
956 <<sMass<<
")+Lamb*"<<nL<<
"="<<sum<<
" > TotM="<<qM<<q4M<<oPDG<<
G4endl;
960 ed <<
"***G4DF::PrFrag: " << fPDG <<
"*" << nB <<
"(" << fMass <<
")+"
961 << sPDG <<
"*" << qPN <<
"(" << sMass <<
")+Lamb*" << nL <<
"="
962 << sum <<
" > TotM=" << qM << q4M << oPDG <<
G4endl;
963 G4Exception(
"G4QDiffractionRatio::ProjFragment()",
"HAD_CHPS_0003",
967 G4cout<<
"G4QDF::ProjFragm: *DONE* n="<<nB<<f4Mom<<fPDG<<
", m="<<qPN<<s4Mom<<sPDG
968 <<
", l="<<nL<<t4Mom<<
G4endl;
977 if(nB>1)
for(
G4int ih=1; ih<nB; ih++)
980 ResHV->push_back(Hi);
983 G4cout<<
"G4QDR::ProjFrag: *additional Nucleon*="<<f4Mom<<fPDG<<
G4endl;
998 if(qPN>min)
for(
G4int ip=min; ip<qPN; ip++)
1001 ResHV->push_back(Hj);
1004 G4cout<<
"G4QDR::ProjFragm: *additional Pion*="<<f4Mom<<fPDG<<
G4endl;
1019 if(nL>min)
for(
G4int il=min; il<nL; il++)
1022 ResHV->push_back(Hk);
1025 G4cout<<
"G4QDR::ProjFragm: *additional Hyperon*="<<f4Mom<<fPDG<<
G4endl;
1031 else if( (nL > 0 && nB > 1) || (nL < 0 && nB < -1) )
1041 G4int hPDG = 90000000+nL*999999+nC*999+nB;
1074 G4cout<<
"G4QDiffRatio::PrFrag:oPDG=="<<oPDG<<
",hPDG="<<hPDG<<
",M="<<reM<<
G4endl;
1076 G4int rlPDG=hPDG-nL*1000000-nSP*1000999-nSM*999001;
1080 G4cout<<
"G4QDiffRatio::PrFrag:*G4*nS+="<<nSP<<
",nS-="<<nSM<<
",nL="<<nL<<
G4endl;
1086 G4cout<<
"***G4QDR::PFr:HypN="<<hPDG<<
": bothSigm&Lamb -> ImproveIt"<<
G4endl;
1106 G4cout<<
"G4QDiffRat::ProjFrag:*G4*mS="<<MLa<<
",sPDG="<<sPDG<<
",nL="<<nL<<
G4endl;
1115 G4int rnPDG = hPDG-nL*999999;
1121 if(nL>1) r4M=r4M/nL;
1122 for(
G4int il=0; il<nL; il++)
1124 if(anti) sPDG=-sPDG;
1126 ResHV->push_back(theLam);
1129 G4cout<<
"G4QDR::ProjFrag: *additional Lambda*="<<r4M<<sPDG<<
G4endl;
1133 else if(reM>rlM+MLa-eps)
1138 if(std::fabs(reM-sum)<eps)
1145 G4cerr<<
"***G4QDF::PF:HypN,M="<<reM<<
"<A+n*L="<<sum<<
",d="<<sum-reM<<
G4endl;
1147 G4Exception(
"G4QDiffractionRatio::ProjFragment()",
"HAD_CHPS_0100",
1151 G4cout<<
"*G4QDR::PF:HypN="<<r4M<<
"->A="<<rlPDG<<n4M<<
",n*L="<<nL<<h4M<<
G4endl;
1154 if(anti && rlPDG==90000001) rlPDG=-2112;
1155 if(anti && rlPDG==90001000) rlPDG=-2212;
1164 ResHV->push_back(secHadr);
1167 G4cout<<
"G4QDR::ProgFrag: *additional Neutron*="<<r4M<<sPDG<<
G4endl;
1170 else if(rlPDG==90002000)
1177 ResHV->push_back(secHadr);
1180 G4cout<<
"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<
G4endl;
1187 if(nL>1) h4M=h4M/nL;
1188 for(
G4int il=0; il<nL; il++)
1190 if(anti) sPDG=-sPDG;
1192 ResHV->push_back(theLamb);
1195 G4cout<<
"G4QDR::ProjFrag: *additional Hyperon*="<<r4M<<sPDG<<
G4endl;
1199 else if(reM>rnM+mPi0-eps&&!nSP&&!nSM)
1201 G4int nPi=
static_cast<G4int>((reM-rnM)/mPi0);
1207 if(std::fabs(reM-sum)<eps)
1214 G4cerr<<
"*G4QDR::PF:HypN,M="<<reM<<
"<A+n*Pi0="<<sum<<
",d="<<sum-reM<<
G4endl;
1216 G4Exception(
"G4QDiffractionRatio::ProjFragment()",
"HAD_CHPS_0101",
1220 if(anti && rnPDG==90000001) rnPDG=-2112;
1221 if(anti && rnPDG==90001000) rnPDG=-2212;
1224 G4cout<<
"*G4QDR::PF:R="<<r4M<<
"->A="<<rnPDG<<n4M<<
",n*Pi0="<<nPi<<h4M<<
G4endl;
1226 if(nPi>1) h4M=h4M/nPi;
1227 for(
G4int ihn=0; ihn<nPi; ihn++)
1230 ResHV->push_back(thePion);
1233 G4cout<<
"G4QDR::ProjFrag: *additional Pion*="<<r4M<<sPDG<<
G4endl;
1243 ResHV->push_back(secHadr);
1246 G4cout<<
"G4QDR::ProjFrag: *additional Neutron*="<<r4M<<sPDG<<
G4endl;
1249 else if(rnPDG==90002000)
1256 ResHV->push_back(secHadr);
1259 G4cout<<
"G4QDR::ProjFrag: *additional Proton*="<<r4M<<sPDG<<
G4endl;
1267 G4cerr<<
"G4QDR::PF:R="<<rlM<<
",S+="<<nSP<<
",S-="<<nSM<<
",L="<<nL<<
",d="<<d<<
G4endl;
1269 G4cerr<<
"G4QDR::PF:"<<oPDG<<
","<<hPDG<<
",M="<<reM<<
"<"<<rnM+mPi0<<
",d="<<d<<
G4endl;
1271 G4Exception(
"G4QDiffractionRatio::ProjFragment()",
"HAD_CHPS_0102",
1275 ResHV->push_back(loh);
1284 G4cout<<
"G4QDiffractionRatio::ProjFragment: *End* Sum="<<sum4M<<
" =?= d4M="<<d4M<<
G4endl;
1293 if ( mom < 1. || (pPDG != 2212 && pPDG != 2112) )
1294 G4cerr<<
"G4QDiffractionRatio::GetTargSingDiffXS isn't applicable p="<<mom<<
" GeV, PDG="
1298 return 3.7*std::pow(A,.364)*millibarn;
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4QHadron * > G4QHadronVector
G4ThreeVector G4RandomDirection()
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4QHadronVector * ProjFragment(G4int pPDG, G4LorentzVector p4M, G4int tgZ, G4int tgN)
static G4QDiffractionRatio * GetPointer()
G4QHadronVector * TargFragment(G4int pPDG, G4LorentzVector p4M, G4int tgZ, G4int tgN)
G4double GetTargSingDiffXS(G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)
G4double GetRatio(G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)
void AddQuasmon(G4Quasmon *Q)
G4QHadronVector * Fragment()
G4LorentzVector Get4Momentum() const
G4int GetBaryonNumber() const
G4bool DecayIn2(G4LorentzVector &f4Mom, G4LorentzVector &s4Mom)
void SetQPDG(const G4QPDGCode &QPDG)
void Set4Momentum(const G4LorentzVector &aMom)
G4int GetStrangeness() const
G4QContent GetQuarkContent() const
G4QHadronVector * Fragment(G4QNucleus &nucEnviron, G4int nQ=1)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription