52std::vector<G4int> G4QInelastic::ElementZ;
53std::vector<G4double> G4QInelastic::ElProbInMat;
54std::vector<std::vector<G4int>*> G4QInelastic::ElIsoN;
55std::vector<std::vector<G4double>*>G4QInelastic::IsoProbInEl;
75G4bool G4QInelastic::manualFlag=
false;
76G4double G4QInelastic::Temperature=140.;
77G4double G4QInelastic::SSin2Gluons=0.3;
78G4double G4QInelastic::EtaEtaprime=0.3;
85G4int G4QInelastic::nPartCWorld=85;
86G4double G4QInelastic::SolidAngle=0.5;
87G4bool G4QInelastic::EnergyFlux=
false;
88G4double G4QInelastic::PiPrThresh=141.4;
89G4double G4QInelastic::M2ShiftVir=20000.;
90G4double G4QInelastic::DiNuclMass=1870.;
91G4double G4QInelastic::photNucBias=1.;
92G4double G4QInelastic::weakNucBias=1.;
110 nPartCWorld = nParCW;
131 G4int IPIE=IsoProbInEl.size();
132 if(IPIE)
for(
G4int ip=0; ip<IPIE; ++ip)
134 std::vector<G4double>* SPI=IsoProbInEl[ip];
137 std::vector<G4int>* IsN=ElIsoN[ip];
150 return EnMomConservation;
164 G4cout<<
"G4QInelastic::GetMeanFreePath: Called Fc="<<*Fc<<
G4endl;
168 G4cout<<
"G4QInelastic::GetMeanFreePath: Before GetDynPart"<<
G4endl;
172 G4cout<<
"G4QInelastic::GetMeanFreePath: Before GetDef"<<
G4endl;
177 G4cout<<
"-W-G4QInelastic::GetMeanFreePath called for not implemented particle"<<
G4endl;
183 G4cout<<
"G4QInelastic::GetMeanFreePath: BeforeGetMaterial"<<
G4endl;
190 G4cout<<
"G4QInelastic::GetMeanFreePath:"<<nE<<
" Elem's in theMaterial"<<
G4endl;
204 G4cout<<
"G4QInelastic::GetMeanFreePath: CSmanager is defined for the neutron"<<
G4endl;
247 else if(pZ > 0 && pA > 1)
249 G4cout<<
"-Warning-G4QInelastic::GetMeanFreePath: G4QInelastic called for ions"<<
G4endl;
251 pPDG=90000000+999*pZ+pA;
384 G4cout<<
"-Warning-G4QInelastic::GetMeanFreePath:Particle "
390 G4int IPIE=IsoProbInEl.size();
391 if(IPIE)
for(
G4int ip=0; ip<IPIE; ++ip)
393 std::vector<G4double>* SPI=IsoProbInEl[ip];
396 std::vector<G4int>* IsN=ElIsoN[ip];
404 for(
G4int i=0; i<nE; ++i)
406 G4Element* pElement=(*theElementVector)[i];
408 ElementZ.push_back(Z);
412 if(isoVector) isoSize=isoVector->size();
414 G4cout<<
"G4QInelastic::GetMeanFreePath: isovectorLength="<<isoSize<<
G4endl;
421 std::vector<std::pair<G4int,G4double>*>* newAbund =
422 new std::vector<std::pair<G4int,G4double>*>;
424 for(
G4int j=0; j<isoSize; j++)
430 std::pair<G4int,G4double>* pr=
new std::pair<G4int,G4double>(N,abund);
432 G4cout<<
"G4QInelastic::GetMeanFreePath: p#="<<j<<
",N="<<N<<
",ab="<<abund<<
G4endl;
434 newAbund->push_back(pr);
437 G4cout<<
"G4QInelastic::GetMeanFreePath: pairVectLength="<<newAbund->size()<<
G4endl;
440 for(
G4int k=0; k<isoSize; k++)
delete (*newAbund)[k];
444 std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->
GetCSVector(Z,indEl);
445 std::vector<G4double>* SPI =
new std::vector<G4double>;
446 IsoProbInEl.push_back(SPI);
447 std::vector<G4int>* IsN =
new std::vector<G4int>;
448 ElIsoN.push_back(IsN);
449 G4int nIs=cs->size();
452 G4cout<<
"G4QInelastic::GetMeanFreePath: Before Loop nIs="<<nIs<<
G4endl;
454 if(nIs)
for(
G4int j=0; j<nIs; j++)
456 std::pair<G4int,G4double>* curIs=(*cs)[j];
457 G4int N=curIs->first;
460 G4cout<<
"G4QInel::GetMeanFrP: Before CS, P="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
G4endl;
462 if(!pPDG)
G4cout<<
"-Warning-G4QInelastic::GetMeanFrP: (1) projectile PDG=0"<<
G4endl;
464 if(CSmanager2)CSI+=CSmanager2->
GetCrossSection(
true,Momentum,Z,N,pPDG);
465 if(capMan) CSI*=(1.-capMan->
GetRatio(Momentum, Z, N));
467 G4cout<<
"GQC::GMF:X="<<CSI<<
",M="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
",P="<<pPDG<<
G4endl;
471 SPI->push_back(susi);
474 ElProbInMat.push_back(sigma);
477 G4cout<<
"G4QInel::GetMeanFrPa:S="<<sigma<<
",e="<<photNucBias<<
",w="<<weakNucBias<<
G4endl;
480 if(photNucBias!=1.)
if(incidentParticleDefinition ==
G4Gamma::Gamma() ||
495 if(sigma > 0.)
return 1./sigma;
550 static const G4double third = 1./3.;
559 static const G4double mNeut2= mNeut*mNeut;
561 static const G4double mProt2= mProt*mProt;
562 static const G4double dM=mProt+mNeut;
567 static const G4double mPi0s= mPi0*mPi0;
574 static const G4double tmPi = mPi+mPi;
575 static const G4double stmPi= tmPi*tmPi;
576 static const G4double mPPi = mPi+mProt;
577 static const G4double mPPi2= mPPi*mPPi;
580 static const G4double meN = mNeut+me;
581 static const G4double meN2= meN*meN;
582 static const G4double fmeN= 4*mNeut2*me2;
583 static const G4double mesN= mNeut2+me2;
584 static const G4double meP = mProt+me;
585 static const G4double meP2= meP*meP;
586 static const G4double fmeP= 4*mProt2*me2;
587 static const G4double mesP= mProt2+me2;
589 static const G4double meD = mPPi+me;
590 static const G4double meD2= meD*meD;
592 static const G4double muN = mNeut+mu;
593 static const G4double muN2= muN*muN;
594 static const G4double fmuN= 4*mNeut2*mu2;
595 static const G4double musN= mNeut2+mu2;
596 static const G4double muP = mProt+mu;
597 static const G4double muP2= muP*muP;
598 static const G4double fmuP= 4*mProt2*mu2;
599 static const G4double musP= mProt2+mu2;
601 static const G4double muD = mPPi+mu;
602 static const G4double muD2= muD*muD;
617 static G4bool CWinit =
true;
627 G4cout<<
"G4QInelastic::PostStepDoIt: Before the GetMeanFreePath is called"<<
G4endl;
632 G4cout<<
"G4QInelastic::PostStepDoIt: After the GetMeanFreePath is called"<<
G4endl;
640 if(std::fabs(Momentum-momentum)>.001)
641 G4cerr<<
"*G4QInelastic::PostStepDoIt: P="<<Momentum<<
"#"<<momentum<<
G4endl;
644 G4cout<<
"-->G4QInel::PostStDoIt:*called*, 4M="<<proj4M<<
", P="<<Momentum<<
"="<<momentum
649 G4cerr<<
"G4QInelastic::PostStepDoIt:Only gam,e+,e-,mu+,mu-,t+,t-,p are implemented."
658 G4cout<<
"G4QInelastic::PostStepDoIt: "<<nE<<
" elements in the material."<<
G4endl;
677 else if ( pZ > 0 && pA > 1 ) projPDG = 90000000+999*pZ+pA;
707 G4int aProjPDG=std::abs(projPDG);
710 G4cout<<
"G4QInelastic::PostStepDoIt: projPDG="<<projPDG<<
", stPDG="<<prPDG<<
G4endl;
714 G4cerr<<
"---Warning---G4QInelastic::PostStepDoIt:Undefined interacting hadron"<<
G4endl;
717 G4int EPIM=ElProbInMat.size();
719 G4cout<<
"G4QInel::PostStDoIt: m="<<EPIM<<
",n="<<nE<<
",T="<<ElProbInMat[EPIM-1]<<
G4endl;
728 G4cout<<
"G4QInelastic::PostStepDoIt:E["<<i<<
"]="<<ElProbInMat[i]<<
",r="<<rnd<<
G4endl;
730 if (rnd<ElProbInMat[i])
break;
734 G4Element* pElement=(*theElementVector)[i];
737 G4cout<<
"G4QInelastic::PostStepDoIt: i="<<i<<
", Z(element)="<<Z<<
G4endl;
741 G4cerr<<
"---Warning---G4QInelastic::PostStepDoIt: Element with Z="<<Z<<
G4endl;
744 std::vector<G4double>* SPI = IsoProbInEl[i];
745 std::vector<G4int>* IsN = ElIsoN[i];
746 G4int nofIsot=SPI->size();
748 G4cout<<
"G4QInel::PosStDoIt:n="<<nofIsot<<
",T="<<(*SPI)[nofIsot-1]<<
G4endl;
754 for(j=0; j<nofIsot; ++j)
757 G4cout<<
"G4QInelastic::PostStepDoIt: SP["<<j<<
"]="<<(*SPI)[j]<<
", r="<<rndI<<
G4endl;
759 if(rndI < (*SPI)[j])
break;
761 if(j>=nofIsot) j=nofIsot-1;
763 G4int N =(*IsN)[j]; ;
765 G4cout<<
"G4QInelastic::PostStepDoIt: Z="<<Z<<
", j="<<i<<
", N(isotope)="<<N<<
G4endl;
769 if(projPDG==22 && Z==1 && !N && Momentum<150.)
772 G4cerr<<
"---LowPHOTON---G4QInelastic::PSDoIt: Called for zero Cross-section"<<
G4endl;
783 G4cerr<<
"-Warning-G4QInelastic::PostStepDoIt: Isotope with Z="<<Z<<
", 0>N="<<N<<
G4endl;
803 G4cout<<
"G4QInelastic::PostStepDoIt: N="<<N<<
" for element with Z="<<Z<<
G4endl;
808 G4cout<<
"G4QInelastic::PostStepDoIt: weight="<<weight<<
G4endl;
810 if(photNucBias!=1.) weight/=photNucBias;
811 else if(weakNucBias!=1.) weight/=weakNucBias;
814 G4cout<<
"G4QInelastic::PostStepDoIt: localtime="<<localtime<<
G4endl;
822 G4int targPDG=90000000+Z*1000+N;
831 G4cout<<
"G4QInelastic::PostStepDoIt: projPDG="<<aProjPDG<<
", targPDG="<<targPDG<<
G4endl;
837 if (aProjPDG == 11 || aProjPDG == 13 || aProjPDG == 15)
858 if(!aProjPDG)
G4cout<<
"-Warning-G4QInelast::PostStepDoIt:(2) projectile PDG=0"<<
G4endl;
861 if(Z==1 && !N && Momentum<150.) xSec=0.;
863 G4cout<<
"-Forse-G4QInel::PStDoIt:P="<<Momentum<<
",PDG="<<projPDG<<
",xS="<<xSec<<
G4endl;
868 G4cerr<<
"---OUT---G4QInelastic::PSDoIt: Called for zero Cross-section"<<
G4endl;
880 G4cout<<
"G4QInel::PStDoIt:kE="<<kinEnergy<<
",dir="<<dir<<
",phE="<<photonEnergy<<
G4endl;
882 if( kinEnergy < photonEnergy || photonEnergy < 0.)
885 G4cerr<<
"--G4QInelastic::PSDoIt: photE="<<photonEnergy<<
">leptE="<<kinEnergy<<
G4endl;
894 G4double W=photonEnergy-photonQ2/dM;
895 if(tM<999.) W-=mPi0+mPi0s/dM;
900 G4cout<<
"--G4QInelastic::PostStepDoIt:(lN) negative equivalent energy W="<<W<<
G4endl;
918 G4cout<<
"-DoNoth-G4QInelastic::PostStepDoIt: probab. correction - DoNothing"<<
G4endl;
930 G4cout<<
"G4QInelastic::PoStDoIt:E="<<iniE<<
",lE="<<finE<<
"-"<<ml<<
"="<<finE-ml<<
G4endl;
941 G4double iniP=std::sqrt(iniE*iniE-ml2);
942 G4double finP=std::sqrt(finE*finE-ml2);
943 G4double cost=(iniE*finE-ml2-photonQ2/2)/iniP/finP;
945 G4cout<<
"G4QI::PSDoIt:Q2="<<photonQ2<<
",ct="<<cost<<
",Pi="<<iniP<<
",Pf="<<finP<<
G4endl;
948 if(cost<-1.) cost=-1.;
954 if(am>1 && absEn < photonEnergy)
960 G4double phEn2 = photonEnergy*photonEnergy;
963 absMom = std::sqrt(abMo2);
966 G4double dEn = photonEnergy - absEn;
970 G4cout<<
"-PhotoAbsorption-G4QIn::PStDoIt: sF="<<sF<<
",phEn="<<photonEnergy<<
G4endl;
974 photonEnergy = absEn;
975 photonQ2=abMo2-absEn*absEn;
988 G4double sint=std::sqrt(1.-cost*cost);
1003 G4cout<<
"-Absorption-G4QInelastic::PostStepDoIt: ph3M="<<photon3M<<
", eIn3M="
1004 <<iniP*dir<<
", eFin3M="<<finP*findir<<
", abs3M="<<absMom<<
"<ptm="<<ptm<<
G4endl;
1010 G4cout<<
"-->G4QI::PoStDoIt: new sF="<<proj4M.
m2()<<
", lead4M="<<proj4M<<
G4endl;
1016 if(leadhs)
delete leadhs;
1022 G4cerr<<
"***G4QInelastic::PostStepDoIt: G4Quasmon Exception is catched"<<
G4endl;
1024 G4Exception(
"G4QInelastic::PostStepDoIt()",
"HAD_CHPS_0072",
1029 G4cout<<
"G4QInel::PStDoIt: l4M="<<proj4M<<proj4M.
m2()<<
", N="<<leadhs->size()<<
",pt="
1030 <<ptm<<
",pa="<<absMom<<
",El="<<absEn<<
",Pl="<<ptm-absMom<<
G4endl;
1036 if(leadhs) qNH=leadhs->size();
1037 if(qNH)
for(
G4int iq=0; iq<qNH; iq++)
delete (*leadhs)[iq];
1038 if(leadhs)
delete leadhs;
1045 <<proj4M<<
", lE="<<finE<<
", lP="<<finP*findir<<
", d="<<findir.
mag2()<<
G4endl;
1052 else if (aProjPDG == 12 || aProjPDG == 14)
1055 G4double dKinE=kinEnergy+kinEnergy;
1057 G4cout<<
"G4QInelastic::PostStDoIt: 2*nuEnergy="<<dKinE<<
"(MeV), PDG="<<projPDG<<
G4endl;
1101 else if(projPDG==12)
1106 else if(projPDG==-12)
1114 if(!projPDG)
G4cout<<
"-Warning-G4QInelastic::PostStepDoIt:(3)projectile PDG=0"<<
G4endl;
1121 G4cerr<<
"G4QInelastic::PSDoIt:nuE="<<kinEnergy<<
",X1="<<xSec1<<
",X2="<<xSec2<<
G4endl;
1133 if(scatPDG>0) scatPDG++;
1141 if(std::fabs(xSec-totCS*millibarn)/xSec>.0001)
1142 G4cout<<
"-Warning-G4QInelastic::PostStepDoIt: xS="<<xSec<<
"# CS="<<totCS<<
G4endl;
1146 if(totCS - qelCS < 0.)
1186 targQPDG = temporary_targQPDG;
1195 targQPDG = temporary_targQPDG;
1212 targQPDG = temporary_targQPDG;
1227 G4cout<<
"G4QInelastic::PostStDoIt: s="<<s_value<<
" >? OT="<<OT<<
", mlD2="<<mlD2<<
G4endl;
1232 G4cout<<
"G4QInelastic::PostStepDoIt: tooSmallFinalMassOfCompound: DoNothing"<<
G4endl;
1241 G4cout<<
"G4QInelastic::PostStDoIt: Stop and kill the projectile neutrino"<<
G4endl;
1246 if ( ((secnu || !nuanu || N) && totCS*
G4UniformRand() < qelCS) || s_value < mlD2 )
1252 G4cout<<
"G4QInelastic::PostStDoIt:QuasiEl(nu="<<secnu<<
"),s="<<s_value<<
",Q2="<<Q2<<
G4endl;
1257 G4double p_init=(s_value-mIN*mIN)/dsqs;
1262 G4double cost=(dpi*std::sqrt(qo2+ml2)-Q2-ml2)/dpi/qo;
1267 if(!
G4QHadron(c4M).RelDecayIn2(scat4M, t4M, proj4M, cost, cost))
1269 G4cerr<<
"G4QIn::PStD:c4M="<<c4M<<sqs<<
",mM="<<ml<<
",tM="<<mOT<<
",c="<<cost<<
G4endl;
1271 G4Exception(
"G4QInelastic::PostStepDoIt()",
"HAD_CHPS_0000",
1272 FatalException,
"Hadronize quasmon: Can't dec QE nu,lept Compound");
1279 if ( (secnu && projPDG == 2212) || (!secnu && projPDG == 2112) ) targPDG+=1;
1280 else if ( (secnu && projPDG == 2112) || (!secnu && projPDG == 2212) ) targPDG+=1000;
1285 G4cout<<
"G4QInel::PStDoIt: MultiPeriferal s="<<s_value<<
",Q2="<<Q2<<
",T="<<targPDG<<
G4endl;
1293 if(r<0.5) r1=std::sqrt(r+r)*(.5+.1579*(r-.5));
1294 else if(r>0.5) r1=1.-std::sqrt(2.-r-r)*(.5+.1579*(.5-r));
1301 if(we>=kinEnergy-ml-.001) we=kinEnergy-ml-.0001;
1304 G4double cost=(pot-mlQ2/dKinE)/std::sqrt(pot*pot-ml2);
1305 if(std::fabs(cost)>1)
1308 G4cout<<
"*G4QInelastic::PostStDoIt: cost="<<cost<<
", Q2="<<Q2<<
", nu="<<we<<
", mx="
1309 <<mx<<
", pot="<<pot<<
", 2KE="<<dKinE<<
G4endl;
1311 if(cost>1.) cost=1.;
1313 pot=mlQ2/dKinE+dKinE*ml2/mlQ2;
1315 G4double lEn=std::sqrt(pot*pot+ml2);
1317 G4double lPt=pot*std::sqrt(1.-cost*cost);
1318 std::pair<G4double,G4double> d2d=Random2DDirection();
1330 G4cout<<
"G4QInelastic::PostStDoIt: proj4M="<<proj4M<<
", ml="<<ml<<
G4endl;
1333 G4int fintPDG=targPDG;
1336 if(projPDG<0) fintPDG-= 999;
1344 G4cout<<
"G4QInelastic::PSDI:fM2="<<fM2<<
"<? mc4M="<<c4M.
m2()<<
",dM="<<fM-tgM<<
G4endl;
1352 G4double hQ2max=(fs*fs/2-fMl-fMl)/s_value;
1355 G4cout<<
"G4QI::PSDI:ct="<<cost<<
",Q2="<<Q2<<
",hQ2="<<hQ2max<<
",4M="<<tot4M<<
G4endl;
1360 if(acost>1.001)
G4cout<<
"-Warning-G4QInelastic::PostStDoIt: cost="<<cost<<
G4endl;
1361 if (cost> 1.) cost= 1.;
1362 else if(cost<-1.) cost=-1.;
1367 if(!
G4QHadron(tot4M).RelDecayIn2(scat4M, reco4M, dir4M, cost, cost))
1369 G4cerr<<
"G4QI::PSDI:t4M="<<tot4M<<
",lM="<<ml<<
",rM="<<fM<<
",cost="<<cost<<
G4endl;
1373 G4cout<<
"G4QIn::PStDoI:l4M="<<scat4M<<
"+r4M="<<reco4M<<
"="<<scat4M+reco4M<<
G4endl;
1390 else G4cout<<
"-Warning-G4QInelastic::PostStDoIt: UnknownLepton="<<scatPDG<<
G4endl;
1401 G4int fm=
static_cast<G4int>(fintPDG/1000000);
1402 G4int ZN=fintPDG-1000000*fm;
1423 if(momentum<500. && projPDG == 2112)
1429 if(projPDG == 2212) tZ++;
1443 if(totM2 < minM*minM)
1455 std::pair<G4double,G4double> fief=qfMan->
GetRatios(momentum, projPDG, Z, N);
1456 G4double qepart=fief.first*fief.second;
1459 G4double clProb[lCl]={.65,.85,.95};
1460 if(qepart>0.45) qepart=.45;
1462 qepart=qepart/clProb[0]-qepart;
1466 if(momentum > thresh) pickup*=50./momentum/
G4QThd(Z+N);
1468 if (N) pickup+=qepart;
1469 else pickup =qepart;
1472 G4cout<<
"-->G4QInelastic::PSD:QE[p("<<proj4M<<
")+(Z="<<Z<<
",N="<<N<<
")]="<<qepart
1473 <<
", pickup="<<pickup<<
G4endl;
1479 if(Z>1||N>1) dmom=fmm*std::pow(-std::log(
G4UniformRand()),third);
1483 G4int nPDG=90000001;
1484 G4int restPDG=targPDG;
1498 if(Z<2 || N<2 || A < 6) base = clProb[--max];
1499 if((Z > 1 && N < 2) || (Z < 2 && N > 1)) base=(clProb[max]+clProb[max-1])/2;
1500 if ( (Z < 2 && N < 2) || A < 5) base=clProb[--max];
1501 if(A<3) base=clProb[--max];
1510 if(max>1)
while(ic<max)
if(ran>clProb[ic++]) cln=ic;
1519 if ( ((!cln || cln == 2) &&
G4UniformRand()*(A-cln) > (N-nln)) ||
1520 ((cln == 3 || cln == 1) && Z > N) )
1533 G4double nM=std::sqrt(rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom));
1536 G4cout<<
"G4QInel::PStDoIt:QE,p="<<dmom<<
",tM="<<tM<<
",R="<<rM<<
",N="<<nM<<
G4endl;
1543 G4cerr<<
"-W-G4QInel::PoStDoI:M="<<tM<<
"<rM="<<rM<<
"+nM="<<nM<<
"="<<rM+nM<<
G4endl;
1632 G4double nM=std::sqrt(rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom));
1635 G4cout<<
"G4QInel::PStDoIt:QEC, p="<<dmom<<
",T="<<tM<<
",R="<<rM<<
",N="<<nM<<
G4endl;
1642 G4cerr<<
"-W-G4QInel::PoStDoI:M="<<tM<<
"<rM="<<rM<<
"+cM="<<nM<<
"="<<rM+nM<<
G4endl;
1662 G4cout<<
"G4QInel::PStDoIt:***Enter***,cmM2="<<cmM2<<
" > minM2="<<minM*minM<<
G4endl;
1672 G4cout<<
"G4QIn::PStDoIt:-Enter, P="<<projPDG<<
",cln="<<cln<<
",cp1="<<cp1<<
G4endl;
1677 G4int tresPDG=restPDG+999;
1684 tresPDG=restPDG-999;
1687 G4double efE=(cmM2-tprM2-qM*qM)/(qM+qM);
1688 G4double efP=std::sqrt(efE*efE-tprM2);
1691 G4cout<<
"G4QInel::PStDoIt:chl="<<chl<<
",P="<<efP<<
",nZ="<<nZ<<
",nA="<<nA<<
G4endl;
1704 std::pair<G4LorentzVector,G4LorentzVector> sctout=qfMan->
Scatter(nPDG, n4M,
1707 G4cout<<
"G4QInelastic::PStDoIt:QElS,proj="<<prjM<<sctout.second<<
",qfCl="<<qM
1708 <<sctout.first<<
",chex="<<chex<<
",nA="<<nA<<
",nZ="<<nZ<<
G4endl;
1726 G4double ldT=(sctout.second).e()-prjM;
1736 else if(nZ>0 && nA>1)
1739 else G4cout<<
"-Warning_G4QIn::PSD:scatqfPDG="<<nPDG<<
", Z="<<nZ<<
",A="<<nA<<
G4endl;
1753 else if(rZ>0 && rA>1)
1756 else G4cout<<
"-Warning_G4QIn::PSD: resPDG="<<restPDG<<
",Z="<<rZ<<
",A="<<rA<<
G4endl;
1770 else G4cout<<
"G4QInel::PSD:OUT,M2="<<s4M.
m2()<<
"<"<<minM*minM<<
", N="<<nPDG<<
G4endl;
1775 if(projPDG==2212) restPDG--;
1789 if(N>2 && frn > 0.95)
1832 if(Z>1 && frn > 0.99)
1835 if((din && projPDG==2212) || (pin && projPDG==2112))
1840 else if((pin && projPDG==2212) || (dip && projPDG==2112)) restPDG--;
1841 else G4cout<<
"-Warning-G4QIn::PSD: PickUp logic error, proj="<<projPDG<<
G4endl;
1854 G4double nM2=rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom);
1860 G4cout<<
"G4QInel::PStDoIt:PiU, p="<<dmom<<
",tM="<<tM<<
", R="<<rM<<
",N="<<nM<<
G4endl;
1865 if(projPDG == 2112) mNucl2=mNeut2;
1866 G4double cost=(nM2+mNucl2+srm+srm-mPUF2)/(qp+qp);
1868 while(std::fabs(cost)>1. && ict<3)
1871 if(Z>1||N>1) dmom=fmm*std::pow(-std::log(
G4UniformRand()),third);
1872 if(din || pin || dip)
1880 nM2=rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom);
1883 den2=(dmom*dmom+nM2);
1884 den=std::sqrt(den2);
1887 cost=(nM2+mNucl2+srm+srm-mPUF2)/(qp+qp);
1890 if(ict>2)
G4cout<<
"G4QInelast::PStDoIt:i="<<ict<<
",d="<<dmom<<
",ct="<<cost<<
G4endl;
1893 if(std::fabs(cost)<=1.)
1899 if(vdir.
mag2() > 0.)
1907 G4double tdom=dmom*std::sqrt(1-cost*cost);
1909 G4ThreeVector vedm=vx*dmom*cost+vy*tdom*std::sin(phi)+vz*tdom*std::cos(phi);
1913 if(std::fabs(r4M.
m()-rM)>.001)
G4cout<<
"G4QIn::PSD: rM="<<rM<<
"#"<<r4M.
m()<<
G4endl;
1917 if(std::fabs(f4M.
m()-mPUF)>.001)
G4cout<<
"G4QI::PSD:m="<<mPUF<<
"#"<<f4M.
m()<<
G4endl;
1929 G4cout<<
"G4QInelastic::PStDoIt: f="<<theDefinition<<
",f4M="<<f4M.
m()<<f4M<<
G4endl;
1942 G4cout<<
"G4QInelastic::PStDoIt:rZ="<<rZ<<
",rA="<<rA<<
",r4M="<<r4M.
m()<<r4M<<
G4endl;
1951 if(absMom) EnMomConservation+=lead4M;
1961 G4cout<<
"^^G4QInelastic::PostStepDoIt: projPDG="<<projPDG<<
", targPDG="<<targPDG<<
G4endl;
1970 G4cout<<
"G4QInel::PStDoIt: ProjNuc="<<projPDG<<proj4M<<
", TargNuc="<<targPDG<<
G4endl;
1975 G4cerr<<
"***G4QInelastic::PostStepDoIt: G4QE Exception is catched in hA"<<
G4endl;
1977 G4Exception(
"G4QInelastic::PostStepDoIt()",
"HAD_CHPS_0027",
1992 G4cout<<
"G4QInelastic::PStDoIt: atCn="<<atCn<<
" <= maxCn="<<maxCn<<
G4endl;
1994 G4int outN=output->size();
1997 std::for_each(output->begin(), output->end(),
DeleteQHadron());
2003 G4cout<<
"G4QInelastic::PStDoIt: Before Fragmentation"<<
G4endl;
2017 G4cout<<
"G4QInelastic::PStDoIt:Proj="<<projPDG<<proj4M<<
",TgNuc="<<targPDG<<
G4endl;
2022 G4cerr<<
"***G4QInelastic::PostStepDoIt: G4QE Exception is catched in hA"<<
G4endl;
2024 G4Exception(
"G4QInelastic::PostStepDoIt()",
"HAD_CHPS_0027",
2028 outN=output->size();
2030 G4cout<<
"G4QInelastic::PostStepDoIt: At# "<<atCn<<
", nSec="<<outN<<
", fPDG="
2031 <<(*output)[0]->GetPDGCode()<<
", pPDG="<< projPDG<<
G4endl;
2036 G4cout<<
"-Warning-G4QInelastic::PostStepDoIt: nSec="<<outN<<
", At# "<<atCn<<
G4endl;
2041 if(atCn==maxCn)
G4cout<<
"-Warning-G4QI::PostStDoIt:mAt="<<atCn<<
" is reached"<<
G4endl;
2050 output->push_back(scatHadron);
2053 if(leadhs) qNH=leadhs->size();
2056 if(qNH)
for(
G4int iq=0; iq<qNH; iq++)
2059 output->push_back(loh);
2061 if(leadhs)
delete leadhs;
2066 if(qNH)
for(
G4int iq=0; iq<qNH; iq++)
delete (*leadhs)[iq];
2067 if(leadhs)
delete leadhs;
2071 G4int tNH = output->size();
2075 G4cout<<
"G4QInelastic::PostStepDoIt: "<<tNH<<
" particles are generated"<<
G4endl;
2078 if(absMom)
G4cout<<
"G4QInelastic::PostStepDoIt: t="<<tNH<<
", q="<<qNH<<
G4endl;
2080 G4int nOut=output->size();
2083 G4cout<<
"-Warning-G4QInelastic::PostStepDoIt: 1 secondary! absMom="<<absMom;
2084 if(absMom)
G4cout<<
", qNH="<<qNH;
2085 G4cout<<
", PDG0="<<(*output)[0]->GetPDGCode();
2088 delete output->operator[](0);
2091 if(tNH==2&&2!=nOut)
G4cout<<
"--Warning--G4QInelastic::PostStepDoIt: 2 # "<<nOut<<
G4endl;
2094 if(tNH)
for(i=0; i<tNH; i++)
2103 G4cout<<
"G4QInelastic::PostStepDoIt: H#"<<i<<
",PDG="<<PDGCode<<
",nF="<<nFrag
2109 G4cout<<
"G4QInelastic::PostStepDoIt: Intermediate particle is found i="<<i<<
G4endl;
2119 else if(PDGCode==311 || PDGCode==-311)
2129 else if(PDGCode==90000000)
2132 G4cout<<
"-Warning-G4QInelastic::PostStepDoIt:Vacuum PDG="<<PDGCode
2137 if(std::fabs(hM2)>.01)
G4cout<<
"-Warning-G4QInel::PoStDoIt:90000000M2="<<hM2<<
G4endl;
2144 else if(PDGCode >80000000)
2149 G4cout<<
"G4QInelastic::PostStepDoIt:Ion Z="<<aZ<<
", A="<<aA<<
G4endl;
2154 else if(PDGCode==89999998 || PDGCode==89998000 || PDGCode==88000000)
2159 if (PDGCode==89998000)
2165 else if(PDGCode==88000000)
2175 G4cout<<
"G4QInel::PStDoIt:AntiDiBar,t4M="<<tM<<
",m="<<rM<<
",PDG="<<PDGCode<<
G4endl;
2179 G4cerr<<
"G4QIn::PostStDoIt: ADB, M="<<t4M.
m()<<
" < 2*rM="<<rM<<
" = "<<2*rM<<
G4endl;
2181 G4Exception(
"G4QInelastic::PostStepDoIt()",
"HAD_CHPS_0004",
2186 G4cout<<
"G4QInelastic::PStDoIt: ADB, H1="<<rM<<f4M<<
", H2="<<rM<<s4M<<
G4endl;
2191 theDefinition=BarDef;
2193 G4cout<<
"G4QInel::PostStDoIt:Anti-DiBar, DecayIn2, h1="<<rPDG<<f4M<<
G4endl;
2196 output->push_back(sH);
2199 G4cout<<
"G4QInel::PostStDoIt:Anti-DiBar, DecayIn2, h2="<<rPDG<<s4M<<
G4endl;
2202 else if(PDGCode==90000997 || PDGCode==89997001)
2209 if(PDGCode==90000997)
2221 G4cout<<
"G4QInel::PStDoIt:AntiNDelta, t4M="<<tM<<
",m="<<rM<<
",PDG="<<PDGCode<<
G4endl;
2223 if(!
G4QHadron(t4M).DecayIn3(f4M, s4M, u4M))
2225 G4cerr<<
"G4QIn::PostStDoIt: AND, tM="<<t4M.
m()<<
" < 2*mB+mPi="<<2*rM+iM<<
G4endl;
2227 G4Exception(
"G4QInelastic::PostStepDoIt()",
"HAD_CHPS_0005",
2232 G4cout<<
"G4QInel::PStDoI:AND,B1="<<rM<<f4M<<
",B2="<<rM<<s4M<<
",Pi="<<iM<<u4M<<
G4endl;
2237 theDefinition=BarDef;
2239 G4cout<<
"G4QInel::PostStDoIt:Anti-NDelta, DecayIn2, h1="<<rPDG<<f4M<<
G4endl;
2242 output->push_back(sH);
2245 G4cout<<
"G4QInel::PostStDoIt:Anti-NDelta, DecayIn2, h2="<<rPDG<<s4M<<
G4endl;
2248 output->push_back(uH);
2251 G4cout<<
"G4QInel::PostStDoIt:Anti-NDelta, DecayIn2, h2="<<rPDG<<s4M<<
G4endl;
2257 G4cout<<
"G4QInelastic::PostStepDoIt:Define particle with PDG="<<PDGCode<<
G4endl;
2261 G4cout<<
"G4QInelastic::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<
G4endl;
2266 if(PDGCode!=90000000 || hadr->
Get4Momentum()!=vacuum4M)
2267 G4cout<<
"---Warning---G4QInelastic::PostStepDoIt: drop PDG="<<PDGCode<<
", 4Mom="
2277 EnMomConservation-=h4M;
2279 G4cout<<
"G4QInelast::PSDI: "<<i<<
","<<PDGCode<<h4M<<h4M.
m()<<EnMomConservation<<
G4endl;
2282 G4cout<<
"G4QInelastic::PostStepDoIt:#"<<i<<
",PDG="<<PDGCode<<
",4M="<<h4M<<
G4endl;
2290 G4cout<<
"G4QInelast::PSDoIt:p="<<curD<<curD.
mag()<<
",e="<<curE<<
",m="<<curM<<
G4endl;
2297 G4cout<<
"G4QInelastic::PostStepDoIt:#"<<i<<
" is done."<<
G4endl;
2304 if(qNH)
for(
G4int iq=0; iq<qNH; iq++)
delete (*leadhs)[iq];
2311 if(aProjPDG!=11 && aProjPDG!=13 && aProjPDG!=15)
2318 G4cout<<
"G4QInelastic::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG<<
", St="
2324std::pair<G4double,G4double> G4QInelastic::Random2DDirection()
2329 while(r2>1. || r2<.0001)
2334 cp=1.-cosine-cosine;
2338 return std::make_pair(sp/norm,cp/norm);
std::vector< G4Element * > G4ElementVector
#define G4HadronicDeprecate(name)
std::vector< G4Isotope * > G4IsotopeVector
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4QHadron * > G4QHadronVector
G4ThreeVector G4RandomDirection()
CLHEP::Hep3Vector G4ThreeVector
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
static G4AntiKaonZero * AntiKaonZero()
static G4AntiLambda * AntiLambda()
static G4AntiNeutrinoE * AntiNeutrinoE()
static G4AntiNeutrinoMu * AntiNeutrinoMu()
static G4AntiNeutrinoTau * AntiNeutrinoTau()
static G4AntiNeutron * AntiNeutron()
static G4AntiOmegaMinus * AntiOmegaMinus()
static G4AntiProton * AntiProton()
static G4AntiSigmaMinus * AntiSigmaMinus()
static G4AntiSigmaPlus * AntiSigmaPlus()
static G4AntiSigmaZero * AntiSigmaZero()
static G4AntiXiMinus * AntiXiMinus()
static G4AntiXiZero * AntiXiZero()
static G4Deuteron * Deuteron()
const G4ThreeVector & GetMomentumDirection() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleDefinition * GetDefinition() const
G4LorentzVector Get4Momentum() const
G4double GetKineticEnergy() const
void Set4Momentum(const G4LorentzVector &momentum)
G4double GetTotalMomentum() const
static G4Electron * Electron()
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
G4IsotopeVector * GetIsotopeVector() const
static G4GenericIon * GenericIon()
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4KaonZeroLong * KaonZeroLong()
static G4KaonZeroShort * KaonZeroShort()
static G4KaonZero * KaonZero()
static G4Lambda * Lambda()
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
static G4MuonMinus * MuonMinus()
static G4MuonPlus * MuonPlus()
static G4NeutrinoE * NeutrinoE()
static G4NeutrinoMu * NeutrinoMu()
static G4NeutrinoTau * NeutrinoTau()
static G4Neutron * Neutron()
static G4OmegaMinus * OmegaMinus()
void AddSecondary(G4Track *aSecondary)
G4double GetEnergy() const
const G4ThreeVector * GetMomentumDirection() const
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual void Initialize(const G4Track &)
G4int GetAtomicNumber() const
G4double GetPDGMass() const
G4int GetAtomicMass() const
G4int GetPDGEncoding() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4ParticleTable * GetParticleTable()
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
static G4Positron * Positron()
static G4Proton * Proton()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4QCHIPSWorld * Get()
G4QParticleVector * GetParticles(G4int nOfParts=0)
static G4VQCrossSection * GetPointer()
static void SetParameters(G4double solAn=0.4, G4bool efFlag=false, G4double piThresh=141.4, G4double mpisq=20000., G4double dinum=1880.)
G4QHadronVector * Fragment()
G4LorentzVector Get4Momentum() const
G4int GetBaryonNumber() const
void SetQPDG(const G4QPDGCode &QPDG)
G4int GetNFragments() const
void Set4Momentum(const G4LorentzVector &aMom)
G4QPDGCode GetQPDG() const
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static void SetStandard()
G4int GetNumberOfNeutronsInTarget()
G4QInelastic(const G4String &processName="CHIPS_Inelastic")
static void SetPhotNucBias(G4double phnB=1.)
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
static void SetParameters(G4double temper=180., G4double ssin2g=.1, G4double etaetap=.3, G4double fN=0., G4double fD=0., G4double cP=1., G4double mR=1., G4int npCHIPSWorld=234, G4double solAn=.5, G4bool efFlag=false, G4double piTh=141.4, G4double mpi2=20000., G4double dinum=1880.)
static void SetWeakNucBias(G4double ccnB=1.)
G4double GetMeanFreePath(const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
G4bool IsApplicable(const G4ParticleDefinition &particle)
G4LorentzVector GetEnegryMomentumConservation()
G4QHadronVector * Fragment()
std::vector< std::pair< G4int, G4double > * > * GetCSVector(G4int Z, G4int index=0)
G4bool IsDefined(G4int Z, G4int Ind)
G4double GetMeanCrossSection(G4int Z, G4int index=0)
static G4QIsotope * Get()
G4int InitElement(G4int Z, G4int index, std::vector< std::pair< G4int, G4double > * > *abund)
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
G4double GetRatio(G4double pIU, G4int tgZ, G4int tgN)
static G4QNeutronCaptureRatio * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static void SetParameters(G4double fN=.1, G4double fD=.05, G4double cP=4., G4double mR=1., G4double nD=.8 *CLHEP::fermi)
G4double GetNuclMass(G4int Z, G4int N, G4int S)
G4ParticleDefinition * GetParticleDefinition(G4int PDGCode)
static G4QPDGToG4Particle * Get()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
G4double ChExElCoef(G4double p, G4int Z, G4int N, G4int pPDG)
std::pair< G4LorentzVector, G4LorentzVector > Scatter(G4int NPDG, G4LorentzVector N4M, G4int pPDG, G4LorentzVector p4M)
static G4QuasiFreeRatios * GetPointer()
std::pair< G4double, G4double > GetRatios(G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)
G4QHadronVector * Fragment(G4QNucleus &nucEnviron, G4int nQ=1)
static void SetParameters(G4double temper=180., G4double ssin2g=.3, G4double etaetap=.3)
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
static G4SigmaZero * SigmaZero()
static G4TauMinus * TauMinus()
static G4TauPlus * TauPlus()
G4double GetWeight() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
static G4Triton * Triton()
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4TrackStatus GetTrackStatus() const
G4ParticleChange aParticleChange
const G4String & GetProcessName() const
virtual G4double GetExchangeEnergy()
virtual G4double GetQEL_ExchangeQ2()
virtual G4double GetNQE_ExchangeQ2()
virtual G4double GetLastQELCS()
virtual G4double GetLastTOTCS()
virtual G4double GetVirtualFactor(G4double nu, G4double Q2)
virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0)
virtual G4int GetExchangePDGCode()
virtual G4double GetExchangeQ2(G4double nu=0)
static G4XiMinus * XiMinus()
static G4XiZero * XiZero()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)