248{
250 static const G4double mPro2= mProt*mProt;
252 static const G4double mNeu2= mNeut*mNeut;
272 static const G4int nCh=26;
274
275
276 static G4bool CWinit =
true;
277 if(CWinit)
278 {
279 CWinit=false;
281 }
282
285#ifdef pdebug
286 G4cout<<
"G4QLowEnergy::PostStepDoIt: *** Called *** In4M="
289#endif
290
291
292#ifdef debug
293 G4cout<<
"G4QLowEnergy::PostStepDoIt: After GetMeanFreePath is called"<<
G4endl;
294#endif
295 std::vector<G4Track*> result;
299 if(std::fabs(Momentum-momentum)>.000001)
300 G4cerr<<
"-Warning-G4QLowEnergy::PostStepDoIt:P_IU="<<Momentum<<
"#"<<momentum<<
G4endl;
301#ifdef debug
302 G4cout<<
"G4QLowEnergy::PostStepDoIt: pP(IU)="<<Momentum<<
"="<<momentum<<
",proj4M,m="
304#endif
306 {
307 G4cerr<<
"G4QLowEnergy::PostStepDoIt: Only NA is implemented."<<
G4endl;
308 return 0;
309 }
313#ifdef debug
314 G4cout<<
"G4QLowEnergy::PostStepDoIt: "<<nE<<
" elements in the material."<<
G4endl;
315#endif
317
325 else if (particle ==
G4He3::He3() ) projPDG= 1000020030;
327 {
329#ifdef debug
330 G4int prPDG=1000000000+10000*Z+10*A;
331 G4cout<<
"G4QLowEnergy::PostStepDoIt: PDG="<<prPDG<<
"="<<projPDG<<
G4endl;
332#endif
333 }
334 else G4cout<<
"-Warning-G4QLowEnergy::PostStepDoIt:Unknown projectile Ion"<<
G4endl;
335#ifdef pdebug
337 G4cout<<
"G4QLowEnergy::PostStepDoIt: projPDG="<<projPDG<<
", stPDG="<<prPDG<<
G4endl;
338#endif
339 if(!projPDG)
340 {
341 G4cerr<<
"-Warning-G4QLowEnergy::PostStepDoIt:UndefProjHadron(PDG=0) ->ret 0"<<
G4endl;
342 return 0;
343 }
344
345 G4int EPIM=ElProbInMat.size();
346#ifdef debug
347 G4cout<<
"G4QLowEn::PostStDoIt: m="<<EPIM<<
", n="<<nE<<
",T="<<ElProbInMat[EPIM-1]<<
G4endl;
348#endif
350 if(EPIM>1)
351 {
353 for(i=0; i<nE; ++i)
354 {
355#ifdef debug
356 G4cout<<
"G4QLowEn::PostStepDoIt: EPM["<<i<<
"]="<<ElProbInMat[i]<<
", r="<<rnd<<
G4endl;
357#endif
358 if (rnd<ElProbInMat[i]) break;
359 }
360 if(i>=nE) i=nE-1;
361 }
362 G4Element* pElement=(*theElementVector)[i];
364#ifdef debug
365 G4cout<<
"G4QLowEnergy::PostStepDoIt: i="<<i<<
", Z(element)="<<tZ<<
G4endl;
366#endif
367 if(tZ<=0)
368 {
369 G4cerr<<
"-Warning-G4QLowEnergy::PostStepDoIt: Element with Z="<<tZ<<
G4endl;
370 if(tZ<0) return 0;
371 }
372 std::vector<G4double>* SPI = IsoProbInEl[i];
373 std::vector<G4int>* IsN = ElIsoN[i];
374 G4int nofIsot=SPI->size();
375#ifdef debug
376 G4cout<<
"G4QLowEnergy::PostStepDoIt: nI="<<nofIsot<<
", T="<<(*SPI)[nofIsot-1]<<
G4endl;
377#endif
379 if(nofIsot>1)
380 {
382 for(j=0; j<nofIsot; ++j)
383 {
384#ifdef debug
385 G4cout<<
"G4QLowEnergy::PostStepDoIt: SP["<<j<<
"]="<<(*SPI)[j]<<
",r="<<rndI<<
G4endl;
386#endif
387 if(rndI < (*SPI)[j]) break;
388 }
389 if(j>=nofIsot) j=nofIsot-1;
390 }
391 G4int tN =(*IsN)[j]; ;
392#ifdef debug
393 G4cout<<
"G4QLowEnergy::PostStepDoIt: j="<<i<<
", N(isotope)="<<tN<<
", MeV="<<MeV<<
G4endl;
394#endif
395 if(tN<0)
396 {
397 G4cerr<<
"-Warning-G4QLowEnergy::PostStepDoIt: Isotope Z="<<tZ<<
" has 0>N="<<tN<<
G4endl;
398 return 0;
399 }
400 nOfNeutrons=tN;
401#ifdef debug
402 G4cout<<
"G4QLowEnergy::PostStepDoIt: N="<<tN<<
" for element with Z="<<tZ<<
G4endl;
403#endif
404 if(tN<0)
405 {
406 G4cerr<<
"***Warning***G4QLowEnergy::PostStepDoIt: Element with N="<<tN<<
G4endl;
407 return 0;
408 }
410#ifdef debug
411 G4cout<<
"G4QLowEnergy::PostStepDoIt: track is initialized"<<
G4endl;
412#endif
413 G4double weight = track.GetWeight();
414 G4double localtime = track.GetGlobalTime();
416#ifdef debug
417 G4cout<<
"G4QLowEnergy::PostStepDoIt: before Touchable extraction"<<
G4endl;
418#endif
420#ifdef debug
421 G4cout<<
"G4QLowEnergy::PostStepDoIt: Touchable is extracted"<<
G4endl;
422#endif
423 G4int targPDG=90000000+tZ*1000+tN;
429 G4double pM=targQPDG.GetNuclMass(pZ,pN,0);
430 G4double cosp=-14*Momentum*(tM-pM)/tM/pM;
431#ifdef debug
432 G4cout<<
"G4QLowEnergy::PoStDoIt: Proj("<<pZ<<
","<<pN<<
","<<pL<<
")p="<<pM<<
",Targ=("<<tZ
433 <<
","<<tN<<
"), cosp="<<cosp<<
G4endl;
434#endif
439#ifdef pdebug
440 G4cout<<
"G4QLowEnergy::PostStepDoIt: tM="<<tM<<
",p4M="<<proj4M<<
",t4M="<<tot4M<<
G4endl;
441#endif
442 EnMomConservation=tot4M;
443
448#ifdef debug
449 G4cout<<
"G4QLowEnergy::PoStDoIt: Proj("<<pZ<<
","<<pN<<
","<<pL<<
")p="<<pM<<
",Targ=("<<tZ
450 <<
","<<tN<<
"), dE="<<dER<<
", CB="<<CBE<<
G4endl;
451#endif
452 if(dER<CBE)
453 {
454#ifdef debug
455 G4cerr<<
"-Warning-G4QLowEnergy::PSDoIt: *Below Coulomb barrier* PDG="<<projPDG
456 <<
",Z="<<tZ<<
",tN="<<tN<<
",P="<<Momentum<<
G4endl;
457#endif
458
463 }
464
465
466#ifdef debug
467 G4cout<<
"G4QLE::PSDI:false,P="<<Momentum<<
",Z="<<pZ<<
",N="<<pN<<
",PDG="<<projPDG<<
G4endl;
468#endif
469 G4double xSec=CalculateXS(Momentum, tZ, tN, projPDG);
470#ifdef pdebug
471 G4cout<<
"G4QLowEn::PSDI:PDG="<<projPDG<<
",P="<<Momentum<<
",tZ="<<tZ<<
",N="<<tN<<
",XS="
473#endif
474#ifdef nandebug
475 if(xSec>0. || xSec<0. || xSec==0);
476 else G4cout<<
"-Warning-G4QLowEnergy::PostSDI: *NAN* xSec="<<xSec/millibarn<<
G4endl;
477#endif
478
479 if(xSec <= 0.)
480 {
481#ifdef debug
482 G4cerr<<
"-Warning-G4QLowEnergy::PSDoIt: *Zero cross-section* PDG="<<projPDG
483 <<
",Z="<<tZ<<
",tN="<<tN<<
",P="<<Momentum<<
G4endl;
484#endif
485
490 }
491
496#ifdef pdebug
497 G4cout<<
"G4QLowEn::PSDI: Projectile track is killed"<<
", tA="<<tB<<
", pA="<<pB<<
G4endl;
498#endif
499
500 tA=tB;
501 pA=pB;
503 if(tB > 1) tR*=std::pow(tA,third);
505 if(pB > 1) pR*=std::pow(pA,third);
515#ifdef edebug
519#endif
520 while((!tD && !pD && ++nAt<nAtM) || tcM<tnM)
521 {
522#ifdef edebug
523 totChg=tZ+pZ;
524 totBaN=tB+pB;
525 tch4M =tot4M;
526 G4cout<<
">G4QLEn::PSDI:#"<<nAt<<
",tC="<<totChg<<
",tA="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
527#endif
529 G4int resultSize=result.size();
530 if(resultSize)
531 {
532 for(i=0; i<resultSize; ++i) delete result[i];
533 result.clear();
534 }
536#ifdef pdebug
537 G4cout<<
"G4QLowEn::PSDI: D="<<D<<
", tR="<<tR<<
", pR="<<pR<<
G4endl;
538#endif
539 if(D > std::fabs(tR-pR))
540 {
541 nSec = 0;
546
548
553
555
557 G4double tF=tA*(6*tR2*(pR2-DtR2)-4*D*(tR3-DpR3)+3*(tR4-DpR4))/HD/tR3;
559 tD=
static_cast<G4int>(tF);
560 pD=
static_cast<G4int>(pF);
561
562
563
564 if(std::fabs(tF-4.) < 1.) tD=4;
566 if(std::fabs(pF-4.) < 1.) pD=4;
568 if(tD > tB) tD=tB;
569 if(pD > pB) pD=tB;
570
571 if(tD < 1) tD=1;
572 if(pD < 1) pD=1;
573#ifdef pdebug
574 G4cout<<
"G4QLE::PSDI:#"<<nAt<<
",pF="<<pF<<
",tF="<<tF<<
",pD="<<pD<<
",tD="<<tD<<
G4endl;
575#endif
578 if((tD || pD) && tD<tB && pD<pB)
579 {
580 if(!tD || !pD)
581 {
587 if (!tD)
588 {
589 if(pD > 1) pD=1;
591 {
592 pPDG=2212;
593 prM=mProt;
594 prM2=mPro2;
595 pC=1;
596 }
602 if(pD==pB)
603 {
605 com4M += proj4M;
606 rNM=prM;
607 }
608 else
609 {
612 G4double rNE=std::sqrt(fm*fm+rNM*rNM);
615 rNuc4M.boost(boostV);
617 com4M += qfN4M;
619 if(rNE >= prM) Mom = std::sqrt(pNE*pNE-prM2);
620 else break;
621 }
622 xSec=0.;
623 if(pPDG==2212) xSec=PCSmanager->
GetCrossSection(
false, Mom, tZ, tN, pPDG);
625 if( xSec <= 0. ) break;
627 if(pPDG==2212) mint=PCSmanager->
GetExchangeT(tZ,tN,pPDG);
630 if(pPDG==2212) maxt=PCSmanager->
GetHMaxT();
633 if(cost>1. || cost<-1.) break;
637 if(!
G4QHadron(com4M).RelDecayIn2(scat4M, reco4M, dir4M, cost, cost))
638 {
639 G4cout<<
"G4QLE::Pt="<<com4M.
m()<<
",p="<<prM<<
",r="<<rNM<<
",c="<<cost<<
G4endl;
640 break;
641 }
644 if(pB > pD)
645 {
649 if(rA==1)
650 {
651 if(!rZ) theDefinition = aNeutron;
652 else theDefinition = aProton;
653 }
659#ifdef pdebug
660 G4cout<<
"G4QLowEn::PSDI:-->ProjQFSA="<<rA<<
",rZ="<<rZ<<
",4M="<<rNuc4M<<
G4endl;
661#endif
662 ++nSec;
663 }
670#ifdef pdebug
671 G4cout<<
"G4QLowEn::PSDI:-->TgQFNPDG="<<pPDG<<
", 4M="<<scat4M<<
G4endl;
672#endif
673 ++nSec;
675 if(tA==1)
676 {
677 if(!tZ) theDefinition = aNeutron;
678 else theDefinition = aProton;
679 }
680 else if(tA==8 && tC==4)
681 {
682 theDefinition = anAlpha;
685 if(!
G4QHadron(reco4M).DecayIn2(f4M, s4M))
686 {
687 G4cout<<
"*G4QLE::TS->A+A,t="<<reco4M.
m()<<
" >? 2*MAlpha="<<2*mAlph<<
G4endl;
688 }
693#ifdef pdebug
695#endif
696 ++nSec;
697 reco4M=s4M;
698 }
699 else if(tA==5 && (tC==2 || tC==3))
700 {
701 theDefinition = aProton;
703 if(tC==2)
704 {
705 theDefinition = aNeutron;
706 mNuc = mNeut;
707 }
710 if(!
G4QHadron(reco4M).DecayIn2(f4M, s4M))
711 {
712 G4cout<<
"*G4QLE::TS->N+A,t="<<reco4M.
m()<<
" >? MA+MN="<<mAlph+mNuc<<
G4endl;
713 }
718#ifdef pdebug
720#endif
721 ++nSec;
722 theDefinition = anAlpha;
723 reco4M=s4M;
724 }
726 ++nSec;
727#ifdef pdebug
729#endif
738#ifdef pdebug
739 G4cout<<
"G4QLowEn::PSDI:-->TgR4M="<<reco4M<<
", checkNSec="<<nSec<<
G4endl;
740#endif
742 }
743 else
744 {
745 if(tD > 1) tD=1;
747 {
748 pPDG=2212;
749 prM=mProt;
750 prM2=mPro2;
751 tC=1;
752 }
758 if(tD==tB)
759 {
760 Mom=prM*proj4M.
rho()/proj4M.
m();
761 com4M += targ4M;
762 rNM=prM;
763 }
764 else
765 {
768 G4double rNE=std::sqrt(fm*fm+rNM*rNM);
771 com4M += qfN4M;
773 qfN4M.
boost(-boostV);
775 if(rNE >= prM) Mom = std::sqrt(tNE*tNE-prM2);
776 else break;
777 }
778 xSec=0.;
779 if(pPDG==2212) xSec=PCSmanager->
GetCrossSection(
false, Mom, tZ, tN, pPDG);
781 if( xSec <= 0. ) break;
783 if(pPDG==2212) mint=PCSmanager->
GetExchangeT(tZ,tN,pPDG);
786 if(pPDG==2212) maxt=PCSmanager->
GetHMaxT();
789 if(cost>1. || cost<-1.) break;
793 if(!
G4QHadron(com4M).RelDecayIn2(scat4M, reco4M, dir4M, cost, cost))
794 {
795 G4cout<<
"G4QLE::Tt="<<com4M.
m()<<
",p="<<prM<<
",r="<<rNM<<
",c="<<cost<<
G4endl;
796 break;
797 }
800 if(tB > tD)
801 {
805 if(rA==1)
806 {
807 if(!rZ) theDefinition = aNeutron;
808 else theDefinition = aProton;
809 }
815#ifdef pdebug
816 G4cout<<
"G4QLowEn::PSDI:-->TargQFSA="<<rA<<
",rZ="<<rZ<<
",4M="<<rNuc4M<<
G4endl;
817#endif
818 ++nSec;
819 }
826#ifdef pdebug
827 G4cout<<
"G4QLowEn::PSDI:-->PrQFNPDG="<<pPDG<<
", 4M="<<scat4M<<
G4endl;
828#endif
829 ++nSec;
831 if(pA==1)
832 {
833 if(!pZ) theDefinition = aNeutron;
834 else theDefinition = aProton;
835 }
836 else if(pA==8 && pC==4)
837 {
838 theDefinition = anAlpha;
841 if(!
G4QHadron(reco4M).DecayIn2(f4M, s4M))
842 {
843 G4cout<<
"*G4QLE::PS->A+A,t="<<reco4M.
m()<<
" >? 2*MAlpha="<<2*mAlph<<
G4endl;
844 }
849#ifdef pdebug
851#endif
852 ++nSec;
853 reco4M=s4M;
854 }
855 else if(pA==5 && (pC==2 || pC==3))
856 {
857 theDefinition = aProton;
859 if(pC==2)
860 {
861 theDefinition = aNeutron;
862 mNuc = mNeut;
863 }
866 if(!
G4QHadron(reco4M).DecayIn2(f4M, s4M))
867 {
868 G4cout<<
"*G4QLE::PS->N+A,t="<<reco4M.
m()<<
" >? MA+MN="<<mAlph+mNuc<<
G4endl;
869 }
874#ifdef pdebug
876#endif
877 ++nSec;
878 theDefinition = anAlpha;
879 reco4M=s4M;
880 }
882 ++nSec;
883#ifdef pdebug
885#endif
894#ifdef pdebug
895 G4cout<<
"G4QLowEn::PSDI:-->TgR4M="<<reco4M<<
", checkNSec="<<nSec<<
G4endl;
896#endif
898 }
899#ifdef debug
900 G4cout<<
"G4QLowEnergy::PostStepDoIt:***PostStepDoIt is done:Quasi-El***"<<
G4endl;
901#endif
903 }
904 else
905 {
906
907 if (!pZ) pC = 0;
908 else if(!pN) pC = pD;
909 else
910 {
911#ifdef pdebug
912 G4cout<<
"G4QLowEn::PSDI: pD="<<pD<<
", pZ="<<pZ<<
", pA="<<pA<<
G4endl;
913#endif
915 pC=
static_cast<G4int>(C);
917 }
918 if(!tZ) tC=0;
919 else if(!tN) tC=tD;
920 else
921 {
922#ifdef pdebug
923 G4cout<<
"G4QLowEn::PSDI: tD="<<tD<<
", tZ="<<tZ<<
", tA="<<tA<<
G4endl;
924#endif
926 tC=
static_cast<G4int>(C);
928 }
929
931 if(pD < pB)
932 {
934 if(pD+pD>pB) nc=pB-pD;
936 for(i=1; i < nc; ++i)
938 }
940 if(tD<tB)
941 {
943 if(tD+tD>tB) nc=tB-tD;
945 for(i=1; i < nc; ++i)
947 }
948#ifdef pdebug
949 G4cout<<
"G4QLE::PSDI:pC="<<pC<<
", tC="<<tC<<
", pFM="<<pFM<<
", tFM="<<tFM<<
G4endl;
950#endif
951
953 G4int pF_value=pD-pC;
954 G4int rpN=pN-pF_value;
957 G4double rpE=std::sqrt(rpNM*rpNM+pFM.mag2());
959#ifdef pdebug
960 G4cout<<
"G4QLE::PSDI: boostV="<<boostV<<
",rp4M="<<rp4M<<
",pr4M="<<proj4M<<
G4endl;
961#endif
962 rp4M.boost(boostV);
963#ifdef pdebug
964 G4cout<<
"G4QLE::PSDI: After boost, rp4M="<<rp4M<<
G4endl;
965#endif
969 theDefinition = 0;
970 if(rpA==1)
971 {
974#ifdef pdebug
976#endif
977 }
978 else if(rpA==2 && rpZ==0)
979 {
980 theDefinition = aNeutron;
983#ifdef pdebug
984 G4cout<<
"G4QLE::CPS->n+n,nn="<<rp4M.m()<<
" >? 2*MNeutron="<<2*mNeutron<<
G4endl;
985#endif
987 {
988 G4cout<<
"*W*G4QLE::CPS->n+n,t="<<rp4M.m()<<
" >? 2*Neutron="<<2*mAlph<<
G4endl;
989 }
994 tt4M-=f4M;
995#ifdef edebug
996 totBaN-=2;
997 tch4M -=f4M;
998 G4cout<<
">>G4QLEn::PSDI:n,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
999#endif
1000#ifdef pdebug
1001 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectA4M="<<f4M<<
G4endl;
1002#endif
1003 rp4M=s4M;
1004 }
1005 else if(rpA>2 && rpZ==0)
1006 {
1007 theDefinition = aNeutron;
1009#ifdef pdebug
1010 G4cout<<
"G4QLE::CPS->Nn,M="<<rp4M.m()<<
" >? N*MNeutron="<<rpA*mNeutron<<
G4endl;
1011#endif
1012 for(
G4int it=1; it<rpA; ++it)
1013 {
1018 result.push_back(aNTrack);
1019 }
1021 tt4M-=f4M*nesc;
1022#ifdef edebug
1023 totBaN-=nesc;
1024 tch4M -=f4M*nesc;
1025 G4cout<<
">G4QLEn::PSDI:Nn,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1026#endif
1027#ifdef pdebug
1028 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectA4M="<<f4M<<
G4endl;
1029#endif
1030 rp4M=f4M;
1031 }
1032 else if(rpA==8 && rpZ==4)
1033 {
1034 theDefinition = anAlpha;
1037#ifdef pdebug
1038 G4cout<<
"G4QLE::CPS->A+A,mBe8="<<rp4M.m()<<
" >? 2*MAlpha="<<2*mAlph<<
G4endl;
1039#endif
1041 {
1042 G4cout<<
"*W*G4QLE::CPS->A+A,t="<<rp4M.m()<<
" >? 2*MAlpha="<<2*mAlph<<
G4endl;
1043 }
1048 tt4M-=f4M;
1049#ifdef edebug
1050 totChg-=2;
1051 totBaN-=4;
1052 tch4M -=f4M;
1053 G4cout<<
">>G4QLEn::PSDI:1,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1054#endif
1055#ifdef pdebug
1056 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectA4M="<<f4M<<
G4endl;
1057#endif
1058 rp4M=s4M;
1059 }
1060 else if(rpA==5 && (rpZ==2 || rpZ==3))
1061 {
1062 theDefinition = aProton;
1064 if(rpZ==2)
1065 {
1066 theDefinition = aNeutron;
1067 mNuc = mNeut;
1068 }
1071#ifdef pdebug
1072 G4cout<<
"G4QLowE::CPS->N+A, tM5="<<rp4M.m()<<
" >? MA+MN="<<mAlph+mNuc<<
G4endl;
1073#endif
1075 {
1076 G4cout<<
"*W*G4QLE::CPS->N+A,t="<<rp4M.m()<<
" >? MA+MN="<<mAlph+mNuc<<
G4endl;
1077 }
1082 tt4M-=f4M;
1083#ifdef edebug
1084 if(theDefinition == aProton) totChg-=1;
1085 totBaN-=1;
1086 tch4M -=f4M;
1087 G4cout<<
">>G4QLEn::PSDI:2,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1088#endif
1089#ifdef pdebug
1090 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectN4M="<<f4M<<
G4endl;
1091#endif
1092 theDefinition = anAlpha;
1093 rp4M=s4M;
1094 }
1096 if(!theDefinition)
1097 {
1098
1099
1101 ed << "Particle definition is a null pointer: pDef=0, Z= " << rpZ
1102 <<
", A=" << rpA <<
G4endl;
1103 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0000",
1105 }
1106#ifdef edebug
1107 if(theDefinition == anAlpha)
1108 {
1109 totChg-=2;
1110 totBaN-=4;
1111 }
1112 else
1113 {
1114 totChg-=rpZ;
1115 totBaN-=rpA;
1116 }
1117 tch4M -=rp4M;
1118 G4cout<<
">>G4QLEn::PSDI:3, tZ="<<totChg<<
",tB="<<totBaN<<
", t4M="<<tch4M<<
G4endl;
1119#endif
1124 tt4M-=rp4M;
1125#ifdef pdebug
1126 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectR4M="<<rp4M<<
",Z="<<rpZ<<
",A="<<rpA<<
G4endl;
1127#endif
1128
1129
1131 G4int tF_value=tD-tC;
1132 G4int rtN=tN-tF_value;
1134 G4double rtE=std::sqrt(rtNM*rtNM+tFM.mag2());
1138 theDefinition = 0;
1139 if(rtA==1)
1140 {
1143#ifdef pdebug
1145#endif
1146 }
1147 else if(rtA==2 && rtZ==0)
1148 {
1149 theDefinition = aNeutron;
1152#ifdef pdebug
1153 G4cout<<
"G4QLE::CPS->n+n,nn="<<rptM.m()<<
" >? 2*MNeutron="<<2*mNeutron<<
G4endl;
1154#endif
1156 G4cout<<
"*W*G4QLE::CPS->n+n,t="<<rt4M.m()<<
" >? 2*Neutron="<<2*mAlph<<
G4endl;
1161 tt4M-=f4M;
1162#ifdef edebug
1163 totBaN-=2;
1164 tch4M -=f4M;
1165 G4cout<<
">>G4QLEn::PSDI:n,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1166#endif
1167#ifdef pdebug
1168 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectA4M="<<f4M<<
G4endl;
1169#endif
1170 rt4M=s4M;
1171 }
1172 else if(rtA>2 && rtZ==0)
1173 {
1174 theDefinition = aNeutron;
1176#ifdef pdebug
1177 G4cout<<
"G4QLE::CPS->Nn,M="<<rt4M.m()<<
" >? N*MNeutron="<<rtA*mNeutron<<
G4endl;
1178#endif
1179 for(
G4int it=1; it<rtA; ++it)
1180 {
1185 result.push_back(aNTrack);
1186 }
1188 tt4M-=f4M*nesc;
1189#ifdef edebug
1190 totBaN-=nesc;
1191 tch4M -=f4M*nesc;
1192 G4cout<<
">G4QLEn::PSDI:Nn,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1193#endif
1194#ifdef pdebug
1195 G4cout<<
"G4QLowEn::PSDI:-->ProjSpectA4M="<<f4M<<
G4endl;
1196#endif
1197 rt4M=f4M;
1198 }
1199 else if(rtA==8 && rtZ==4)
1200 {
1201 theDefinition = anAlpha;
1204#ifdef pdebug
1205 G4cout<<
"G4QLE::CPS->A+A,mBe8="<<rt4M.m()<<
" >? 2*MAlpha="<<2*mAlph<<
G4endl;
1206#endif
1208 {
1209 G4cout<<
"*W*G4QLE::CTS->A+A,t="<<rt4M.m()<<
" >? 2*MAlpha="<<2*mAlph<<
G4endl;
1210 }
1215 tt4M-=f4M;
1216#ifdef edebug
1217 totChg-=2;
1218 totBaN-=4;
1219 tch4M -=f4M;
1220 G4cout<<
">>G4QLEn::PSDI:4,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1221#endif
1222#ifdef pdebug
1223 G4cout<<
"G4QLowEn::PSDI:-->TargSpectA4M="<<f4M<<
G4endl;
1224#endif
1225 rt4M=s4M;
1226 }
1227 else if(rtA==5 && (rtZ==2 || rtZ==3))
1228 {
1229 theDefinition = aProton;
1231 if(rpZ==2)
1232 {
1233 theDefinition = aNeutron;
1234 mNuc = mNeut;
1235 }
1238#ifdef pdebug
1239 G4cout<<
"G4QLowE::CPS->N+A, tM5="<<rt4M.m()<<
" >? MA+MN="<<mAlph+mNuc<<
G4endl;
1240#endif
1242 {
1243 G4cout<<
"*W*G4QLE::CTS->N+A,t="<<rt4M.m()<<
" >? MA+MN="<<mAlph+mNuc<<
G4endl;
1244 }
1249 tt4M-=f4M;
1250#ifdef edebug
1251 if(theDefinition == aProton) totChg-=1;
1252 totBaN-=1;
1253 tch4M -=f4M;
1254 G4cout<<
">>G4QLEn::PSDI:5,tZ="<<totChg<<
",tB="<<totBaN<<
",t4M="<<tch4M<<
G4endl;
1255#endif
1256#ifdef pdebug
1257 G4cout<<
"G4QLowEn::PSDI:-->TargSpectN4M="<<f4M<<
G4endl;
1258#endif
1259 theDefinition = anAlpha;
1260 rt4M=s4M;
1261 }
1263 if(!theDefinition)
1264 {
1265
1266
1268 ed << "Particle definition is a null pointer: tDef=0, Z= " << rtZ
1269 <<
", A=" << rtA <<
G4endl;
1270 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0000",
1272 }
1273#ifdef edebug
1274 if(theDefinition == anAlpha)
1275 {
1276 totChg-=2;
1277 totBaN-=4;
1278 }
1279 else
1280 {
1281 totChg-=rtZ;
1282 totBaN-=rtA;
1283 }
1284 tch4M -=rt4M;
1285 G4cout<<
">>G4QLEn::PSDI:6, tZ="<<totChg<<
",tB="<<totBaN<<
", t4M="<<tch4M<<
G4endl;
1286#endif
1291 tt4M-=rt4M;
1292#ifdef pdebug
1293 G4cout<<
"G4QLowEn::PSDI:-->TargSpectR4M="<<rt4M<<
",Z="<<rtZ<<
",A="<<rtA<<
G4endl;
1294#endif
1295 if(aFraPTrack) result.push_back(aFraPTrack);
1296 if(aNewPTrack) result.push_back(aNewPTrack);
1297 if(aFraTTrack) result.push_back(aFraTTrack);
1298 if(aNewTTrack) result.push_back(aNewTTrack);
1300 G4int sN=tF_value+pF_value;
1302 tnM = targQPDG.GetNuclMass(sZ,sN,0);
1303#ifdef pdebug
1304 G4cout<<
"G4QLEn::PSDI:At#"<<nAt<<
",totM="<<tcM<<
",gsM="<<tnM<<
",Z="<<sZ<<
",N="
1306#endif
1307 if(tcM > tnM)
1308 {
1309 pZ=pC;
1310 pN=pF_value;
1311 tZ=tC;
1312 tN=tF_value;
1313 tot4M=tt4M;
1314 }
1315
1316
1317
1318
1319
1320 }
1321 }
1322 else if(tD==tB || pD==pB)
1323 {
1324 tD=tZ+tN;
1325 pD=pZ+pN;
1326 tcM=tnM+1.;
1327 }
1328 }
1329 else
1330 {
1331 tD=tZ+tN;
1332 pD=pZ+pN;
1333 tcM=tnM+1.;
1334 }
1335 }
1339#ifdef edebug
1340 G4cout<<
">>>G4QLEn::PSDI: dZ="<<totChg-totZ<<
", dB="<<totBaN-totN-totZ<<
", d4M="
1341 <<tch4M-tot4M<<
",N="<<totN<<
",Z="<<totZ<<
G4endl;
1342#endif
1343
1344 G4double mass[nCh]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
1345 0.,0.,0.,0.,0.,0.};
1346 mass[0] = tM = targQPDG.GetNuclMass(totZ, totN, 0);
1347#ifdef pdebug
1348 G4cout<<
"G4QLEn::PSDI:TotM="<<totM<<
",NucM="<<tM<<
",totZ="<<totZ<<
",totN="<<totN<<
G4endl;
1349#endif
1350 if (totN>0 && totZ>0)
1351 {
1352 mass[1] = targQPDG.GetNuclMass(totZ,totN-1,0);
1353 mass[2] = targQPDG.GetNuclMass(totZ-1,totN,0);
1354 }
1355 if ( totZ > 1 && totN > 1 ) mass[3] = targQPDG.GetNuclMass(totZ-1,totN-1,0);
1356 if ( totZ > 1 && totN > 2 ) mass[4] = targQPDG.GetNuclMass(totZ-1,totN-2,0);
1357 if ( totZ > 2 && totN > 1 ) mass[5] = targQPDG.GetNuclMass(totZ-2,totN-1,0);
1358 if ( totZ > 2 && totN > 2 ) mass[6] = targQPDG.GetNuclMass(totZ-2,totN-2,0);
1359 if ( totZ > 0 && totN > 2 ) mass[7] = targQPDG.GetNuclMass(totZ ,totN-2,0);
1360 mass[ 8] = mass[3];
1361 if ( totZ > 2 ) mass[9] = targQPDG.GetNuclMass(totZ-2,totN ,0);
1362 mass[10] = mass[5];
1363 mass[11] = mass[4];
1364 mass[12] = mass[6];
1365 mass[13] = mass[6];
1366 if ( totZ > 1 && totN > 3 ) mass[14] = targQPDG.GetNuclMass(totZ-1,totN-3,0);
1367 if ( totZ > 3 && totN > 1 ) mass[15] = targQPDG.GetNuclMass(totZ-3,totN-1,0);
1368 mass[16] = mass[6];
1369 if ( totZ > 3 && totN > 2 ) mass[17] = targQPDG.GetNuclMass(totZ-3,totN-2,0);
1370 if ( totZ > 2 && totN > 3 ) mass[18] = targQPDG.GetNuclMass(totZ-2,totN-3,0);
1371 if(pL>0)
1372 {
1374 if(totN>0||totZ>0) mass[19] = targQPDG.GetNuclMass(totZ ,totN ,pL1);
1375 if( (totN > 0 && totZ > 0) || totZ > 1 )
1376 mass[20]=targQPDG.GetNuclMass(totZ-1,totN ,pL1);
1377 if( (totN > 0 && totZ > 0) || totN > 0 )
1378 mass[21]=targQPDG.GetNuclMass(totZ ,totN-1,pL1);
1379 if( (totN > 1 && totZ > 0) || (totN > 0 && totZ > 1) )
1380 mass[22]=targQPDG.GetNuclMass(totZ-1,totN-1,pL1);
1381 if( (totN > 2 && totZ > 0) || (totN > 1 && totZ > 1) )
1382 mass[23]=targQPDG.GetNuclMass(totZ-1,totN-2,pL1);
1383 if( (totN > 0 && totZ > 2) || (totN > 1 && totZ > 1) )
1384 mass[24]=targQPDG.GetNuclMass(totZ-2,totN-1,pL1);
1385 if( (totN > 1 && totZ > 2) || (totN > 2 && totZ > 1) )
1386 mass[25]=targQPDG.GetNuclMass(totZ-2,totN-2,pL1);
1387 }
1388#ifdef debug
1389 G4cout<<
"G4QLowEn::PSDI: Residual masses are calculated"<<
G4endl;
1390#endif
1391 tA=tZ+tN;
1392 pA=pZ+pN;
1401 if(pL>0) prL=pL/pA;
1402 G4double qval[nCh]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
1403 0.,0.,0.,0.,0.,0.};
1404 qval[ 0] = (totM - mass[ 0])/137./137.;
1405 qval[ 1] = (totM - mass[ 1] - mNeut)*prN/137.;
1406 qval[ 2] = (totM - mass[ 2] - mProt)*prZ/137.;
1407 qval[ 3] = (totM - mass[ 3] - mDeut)*prD/3./137.;
1408 qval[ 4] = (totM - mass[ 4] - mTrit)*prT/6./137.;
1409 qval[ 5] = (totM - mass[ 5] - mHel3)*prH/fhe3/137.;
1410 qval[ 6] = (totM - mass[ 6] - mAlph)*prA/9./137.;
1411 qval[ 7] = (totM - mass[ 7] - mNeut - mNeut)*prN*prN;
1412 qval[ 8] = (totM - mass[ 8] - mNeut - mProt)*prD;
1413 qval[ 9] = (totM - mass[ 9] - mProt - mProt)*prZ*prZ;
1414 qval[10] = (totM - mass[10] - mProt - mDeut)*prH/3.;
1415 qval[11] = (totM - mass[11] - mNeut - mDeut)*prT/3.;
1416 qval[12] = (totM - mass[12] - mDeut - mDeut)*prA/3./3.;
1417 qval[13] = (totM - mass[13] - mProt - mTrit)*prA/6.;
1418 qval[14] = (totM - mass[14] - mNeut - mTrit)*prT*prN/6.;
1419 qval[15] = (totM - mass[15] - mProt - mHel3)*prH*prZ/fhe3;
1420 qval[16] = (totM - mass[16] - mNeut - mHel3)*prA/fhe3;
1421 qval[17] = (totM - mass[17] - mProt - mAlph)*prZ*prA/9.;
1422 qval[18] = (totM - mass[18] - mNeut - mAlph)*prN*prA/9.;
1423 if(pZ>0)
1424 {
1425 qval[19] = (totM - mass[19] - mLamb)*prL;
1426 qval[20] = (totM - mass[20] - mProt - mLamb)*prL*prZ;
1427 qval[21] = (totM - mass[21] - mNeut - mLamb)*prL*prN;
1428 qval[22] = (totM - mass[22] - mDeut - mLamb)*prL*prD/2.;
1429 qval[23] = (totM - mass[23] - mTrit - mLamb)*prL*prT/3.;
1430 qval[24] = (totM - mass[24] - mHel3 - mLamb)*prL*prH/fhe3;
1431 qval[25] = (totM - mass[25] - mAlph - mLamb)*prL*prA/4;
1432 }
1433#ifdef debug
1434 G4cout<<
"G4QLowEn::PSDI: Q-values are calculated, tgA="<<tA<<
", prA="<<pA<<
G4endl;
1435#endif
1436
1438 for(i=0; i<nCh; ++i )
1439 {
1440#ifdef sdebug
1441 G4cout<<
"G4QLowEn::PSDI: i="<<i<<
", q="<<qval[i]<<
",m="<<mass[i]<<
G4endl;
1442#endif
1443 if( mass[i] < 500.*MeV ) qval[i] = 0.0;
1444 if( qval[i] < 0.0 ) qval[i] = 0.0;
1445 qv += qval[i];
1446 }
1447
1451 for( index=0; index<nCh; ++index ) if( qval[index] > 0.0 )
1452 {
1453 qv1 += qval[index];
1454 if( ran <= qv1 ) break;
1455 }
1456#ifdef debug
1457 G4cout<<
"G4QLowEn::PSDI: index="<<index<<
" < "<<nCh<<
G4endl;
1458#endif
1459 if(index == nCh)
1460 {
1461 G4cout<<
"***G4QLowEnergy::PoStDI:Decay is impossible,totM="<<totM<<
",GSM="<<tM<<
G4endl;
1462 G4cout<<
"G4QLowEn::PoStDI:Reaction "<<projPDG<<
"+"<<targPDG<<
", P="<<Momentum<<
G4endl;
1463 G4int nRes=result.size();
1464 if(nRes)
G4cout<<
"G4QLowEnergy::PoStDI: result exists with N="<<nRes<<
" tracks"<<
G4endl;
1465
1466 else {
1467 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0000",
1469 }
1477 for(
G4int it=0; it<nRes; ++it)
1478 {
1484 G4cout<<
" G4QLowEn::PoStDI: H["<<it<<
"] = [ "<<iPDG<<
", "<<ih4M<<
" ]"<<
G4endl;
1488 G4int ntN=totN + iB-iC;
1489 G4int ntZ=totZ + iC;
1490 G4double ntM = targQPDG.GetNuclMass(ntZ, ntN, 0);
1492 if(ttM > ntM)
1493 {
1495 if(found && nEx < minEx)
1496 {
1497 cInd = it;
1498 minEx= nEx;
1499 ctN = ntN;
1500 ctZ = ntZ;
1501 c4M = new4M;
1502 ctM = ttM;
1503 mass[0] = ntM;
1504 }
1505 found = true;
1506 }
1507 }
1508 if(found)
1509 {
1510 tot4M = c4M;
1511 totM = ctM;
1512 totN = ctN;
1513 totZ = ctZ;
1514 delete result[cInd];
1515 G4int nR1 = nRes -1;
1516 if(cInd < nR1) result[cInd] = result[nR1];
1517 result.pop_back();
1518
1519 index = 0;
1520 }
1521 else
1522 {
1523 G4cout<<
"***G4QLowEnergy::PoStDI: One hadron coddection did not succeed***"<<
G4endl;
1524 if(nRes>1)
G4cout<<
"***G4QLowEnergy::PoStDI:nRes's big enough to use 2PtCor"<<
G4endl;
1525
1526 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0000",
1528 }
1529 }
1530
1534#ifdef debug
1535 G4cout<<
"G4QLowEn::PSDI: Dynamic particles are created pL="<<pL<<
G4endl;
1536#endif
1537
1546 switch( index )
1547 {
1548 case 0:
1549 if(!evaporate || rA<2)
1550 {
1551 if(!rZ) theDefinition=aNeutron;
1553 if(!theDefinition)
1554 {
1555
1556
1558 ed << "Particle definition is a null pointer: notDef(0), Z= " << rZ
1559 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1560 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0000",
1562 }
1566 }
1567 else
1568 {
1569 delete ResSec;
1570 delete FstSec;
1571 delete SecSec;
1572 complete=0;
1573 }
1574 break;
1575 case 1:
1576 rA-=1;
1577 if(!evaporate || rA<2)
1578 {
1579 if(!rZ) theDefinition=aNeutron;
1581 if(!theDefinition)
1582 {
1583
1584
1586 ed << "Particle definition is a null pointer: notDef(1), Z= " << rZ
1587 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1588 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0001",
1590 }
1593 }
1594 else
1595 {
1596 delete ResSec;
1597 delete SecSec;
1598 complete=1;
1599 }
1601 mF=mNeut;
1602 break;
1603 case 2:
1604 rA-=1;
1605 rZ-=1;
1606 if(!evaporate || rA<2)
1607 {
1608 if(!rZ) theDefinition=aNeutron;
1610 if(!theDefinition)
1611 {
1612
1613
1615 ed << "Particle definition is a null pointer: notDef(2), Z= " << rZ
1616 <<
", A=" << rA <<
", L="<< rL <<
G4endl;
1617 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0002",
1619 }
1622 }
1623 else
1624 {
1625 delete ResSec;
1626 delete SecSec;
1627 complete=1;
1628 }
1630 mF=mProt;
1631 break;
1632 case 3:
1633 rA-=2;
1634 rZ-=1;
1635 if(!evaporate || rA<2)
1636 {
1637 if(!rZ) theDefinition=aNeutron;
1639 if(!theDefinition)
1640 {
1641
1642
1644 ed << "Particle definition is a null pointer: notDef(3), Z= " << rZ
1645 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1646 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0003",
1648 }
1651 }
1652 else
1653 {
1654 delete ResSec;
1655 delete SecSec;
1656 complete=1;
1657 }
1659 mF=mDeut;
1660 break;
1661 case 4:
1662 rA-=3;
1663 rZ-=1;
1664 if(!evaporate || rA<2)
1665 {
1666 if(!rZ) theDefinition=aNeutron;
1668 if(!theDefinition)
1669 {
1670
1671
1673 ed << "Particle definition is a null pointer: notDef(4), Z= " << rZ
1674 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1675 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0004",
1677 }
1680 }
1681 else
1682 {
1683 delete ResSec;
1684 delete SecSec;
1685 complete=1;
1686 }
1688 mF=mTrit;
1689 break;
1690 case 5:
1691 rA-=3;
1692 rZ-=2;
1693 if(!evaporate || rA<2)
1694 {
1695 if(!rZ) theDefinition=aNeutron;
1697 if(!theDefinition)
1698 {
1699
1700
1702 ed << "Particle definition is a null pointer: notDef(5), Z= " << rZ
1703 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1704 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0005",
1706 }
1709 }
1710 else
1711 {
1712 delete ResSec;
1713 delete SecSec;
1714 complete=1;
1715 }
1717 mF=mHel3;
1718 break;
1719 case 6:
1720 rA-=4;
1721 rZ-=2;
1722 if(!evaporate || rA<2)
1723 {
1724 if(!rZ) theDefinition=aNeutron;
1726 if(!theDefinition)
1727 {
1728
1729
1731 ed << "Particle definition is a null pointer: notDef(6), Z= " << rZ
1732 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1733 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0006",
1735 }
1738 }
1739 else
1740 {
1741 delete ResSec;
1742 delete SecSec;
1743 complete=1;
1744 }
1746 mF=mAlph;
1747 break;
1748 case 7:
1749 rA-=2;
1750 if(rA==1 && !rZ) theDefinition=aNeutron;
1752 if(!theDefinition)
1753 {
1754
1755
1757 ed << "Particle definition is a null pointer: notDef(7), Z= " << rZ
1758 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1759 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0007",
1761 }
1765 mF=mNeut;
1766 mS=mNeut;
1767 break;
1768 case 8:
1769 rZ-=1;
1770 rA-=2;
1771 if(rA==1 && !rZ) theDefinition=aNeutron;
1772 else if(rA==2 && !rZ)
1773 {
1774 index=7;
1778 mF=mNeut;
1779 mS=mNeut;
1780 break;
1781 }
1783 if(!theDefinition)
1784 {
1785
1786
1788 ed << "Particle definition is a null pointer: notDef(8), Z= " << rZ
1789 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1790 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0008",
1792 }
1796 mF=mNeut;
1797 mS=mProt;
1798 break;
1799 case 9:
1800 rZ-=2;
1801 rA-=2;
1802 if(rA==1 && !rZ) theDefinition=aNeutron;
1804 if(!theDefinition)
1805 {
1806
1807
1809 ed << "Particle definition is a null pointer: notDef(9), Z= " << rZ
1810 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1811 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0009",
1813 }
1817 mF=mProt;
1818 mS=mProt;
1819 break;
1820 case 10:
1821 rZ-=2;
1822 rA-=3;
1823 if(rA==1 && !rZ) theDefinition=aNeutron;
1825 if(!theDefinition)
1826 {
1827
1828
1830 ed << "Particle definition is a null pointer: notDef(10), Z= " << rZ
1831 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1832 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0010",
1834 }
1838 mF=mProt;
1839 mS=mDeut;
1840 break;
1841 case 11:
1842 rZ-=1;
1843 rA-=3;
1844 if(rA==1 && !rZ) theDefinition=aNeutron;
1846 if(!theDefinition)
1847 {
1848
1849
1851 ed << "Particle definition is a null pointer: notDef(0), Z= " << rZ
1852 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1853 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0011",
1855 }
1859 mF=mNeut;
1860 mS=mDeut;
1861 break;
1862 case 12:
1863 rZ-=2;
1864 rA-=4;
1865 if(rA==1 && !rZ) theDefinition=aNeutron;
1867 if(!theDefinition)
1868 {
1869
1870
1872 ed << "Particle definition is a null pointer: notDef(12), Z= " << rZ
1873 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1874 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0012",
1876 }
1880 mF=mDeut;
1881 mS=mDeut;
1882 break;
1883 case 13:
1884 rZ-=2;
1885 rA-=4;
1886 if(rA==1 && !rZ) theDefinition=aNeutron;
1888 if(!theDefinition)
1889 {
1890
1891
1893 ed << "Particle definition is a null pointer: notDef(13), Z= " << rZ
1894 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1895 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0013",
1897 }
1901 mF=mProt;
1902 mS=mTrit;
1903 break;
1904 case 14:
1905 rZ-=1;
1906 rA-=4;
1907 if(rA==1 && !rZ) theDefinition=aNeutron;
1909 if(!theDefinition)
1910 {
1911
1912
1914 ed << "Particle definition is a null pointer: notDef(14), Z= " << rZ
1915 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1916 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0014",
1918 }
1922 mF=mNeut;
1923 mS=mTrit;
1924 break;
1925 case 15:
1926 rZ-=3;
1927 rA-=4;
1928 if(rA==1 && !rZ) theDefinition=aNeutron;
1930 if(!theDefinition)
1931 {
1932
1933
1935 ed << "Particle definition is a null pointer: notDef(15), Z= " << rZ
1936 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1937 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0015",
1939 }
1943 mF=mProt;
1944 mS=mHel3;
1945 break;
1946 case 16:
1947 rZ-=2;
1948 rA-=4;
1949 if(rA==1 && !rZ) theDefinition=aNeutron;
1951 if(!theDefinition)
1952 {
1953
1954
1956 ed << "Particle definition is a null pointer: notDef(16), Z= " << rZ
1957 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1958 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0016",
1960 }
1964 mF=mNeut;
1965 mS=mHel3;
1966 break;
1967 case 17:
1968 rZ-=3;
1969 rA-=5;
1970 if(rA==1 && !rZ) theDefinition=aNeutron;
1972 if(!theDefinition)
1973 {
1974
1975
1977 ed << "Particle definition is a null pointer: notDef(17), Z= " << rZ
1978 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
1979 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0017",
1981 }
1985 mF=mProt;
1986 mS=mAlph;
1987 break;
1988 case 18:
1989 rZ-=2;
1990 rA-=5;
1991 if(rA==1 && !rZ) theDefinition=aNeutron;
1993 if(!theDefinition)
1994 {
1995
1996
1998 ed << "Particle definition is a null pointer: notDef(18), Z= " << rZ
1999 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2000 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0018",
2002 }
2006 mF=mNeut;
2007 mS=mAlph;
2008 break;
2009 case 19:
2010 rL-=1;
2011 rA-=1;
2012 if(rA==1 && !rZ) theDefinition=aNeutron;
2014 if(!theDefinition)
2015 {
2016
2017
2019 ed << "Particle definition is a null pointer: notDef(19), Z= " << rZ
2020 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2021 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0019",
2023 }
2027 mF=mLamb;
2028 break;
2029 case 20:
2030 rL-=1;
2031 rZ-=1;
2032 rA-=2;
2033 if(rA==1 && !rZ) theDefinition=aNeutron;
2035 if(!theDefinition)
2036 {
2037
2038
2040 ed << "Particle definition is a null pointer: notDef(20), Z= " << rZ
2041 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2042 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0020",
2044 }
2048 mF=mProt;
2049 mS=mLamb;
2050 break;
2051 case 21:
2052 rL-=1;
2053 rA-=2;
2054 if(rA==1 && !rZ) theDefinition=aNeutron;
2056 if(!theDefinition)
2057 {
2058
2059
2061 ed << "Particle definition is a null pointer: notDef(21), Z= " << rZ
2062 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2063 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0021",
2065 }
2069 mF=mNeut;
2070 mS=mLamb;
2071 break;
2072 case 22:
2073 rL-=1;
2074 rZ-=1;
2075 rA-=3;
2076 if(rA==1 && !rZ) theDefinition=aNeutron;
2078 if(!theDefinition)
2079 {
2080
2081
2083 ed << "Particle definition is a null pointer: notDef(22), Z= " << rZ
2084 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2085 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0022",
2087 }
2091 mF=mDeut;
2092 mS=mLamb;
2093 break;
2094 case 23:
2095 rL-=1;
2096 rZ-=1;
2097 rA-=4;
2098 if(rA==1 && !rZ) theDefinition=aNeutron;
2100 if(!theDefinition)
2101 {
2102
2103
2105 ed << "Particle definition is a null pointer: notDef(23), Z= " << rZ
2106 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2107 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0023",
2109 }
2113 mF=mTrit;
2114 mS=mLamb;
2115 break;
2116 case 24:
2117 rL-=1;
2118 rZ-=2;
2119 rA-=4;
2120 if(rA==1 && !rZ) theDefinition=aNeutron;
2122 if(!theDefinition)
2123 {
2124
2125
2127 ed << "Particle definition is a null pointer: notDef(24), Z= " << rZ
2128 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2129 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0024",
2131 }
2135 mF=mHel3;
2136 mS=mLamb;
2137 break;
2138 case 25:
2139 rL-=1;
2140 rZ-=2;
2141 rA-=5;
2142 if(rA==1 && !rZ) theDefinition=aNeutron;
2144 if(!theDefinition)
2145 {
2146
2147
2149 ed << "Particle definition is a null pointer: notDef(25), Z= " << rZ
2150 <<
", A=" << rA <<
", L=" << rL <<
G4endl;
2151 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0025",
2153 }
2157 mF=mAlph;
2158 mS=mLamb;
2159 break;
2160 }
2161#ifdef debug
2162 G4cout<<
"G4QLowEn::PSDI:F="<<mF<<
",S="<<mS<<
",com="<<complete<<
",ev="<<evaporate<<
G4endl;
2163#endif
2167 dir4Mom.
setE(tot4M.
e()/2.);
2168
2169 if(!
G4QHadron(tot4M).CopDecayIn3(fst4Mom,snd4Mom,res4Mom,dir4Mom,cosp))
2170 {
2171
2172
2173
2175 ed << "Can't decay the Compound: i=" << index << ",tM=" << totM << "->M1="
2176 << res4Mom.m() << "+M2=" << fst4Mom.m() << "+M3=" << snd4Mom.m() << "=="
2177 << res4Mom.m()+fst4Mom.m()+snd4Mom.m() <<
G4endl;
2178 G4Exception(
"G4QLowEnergy::PostStepDoIt()",
"HAD_CHPS_0000",
2180 }
2181#ifdef debug
2182 G4cout<<
"G4QLowEn::PSDI:r4M="<<res4Mom<<
",f4M="<<fst4Mom<<
",s4M="<<snd4Mom<<
G4endl;
2183#endif
2185 if(complete)
2186 {
2191 result.push_back( aNewTrack );
2192 EnMomConservation-=fst4Mom;
2193#ifdef debug
2194 G4cout<<
"G4QLowEn::PSDI: ***Filled*** 1stH4M="<<fst4Mom
2196#endif
2197 if(complete>2)
2198 {
2203 result.push_back( aNewTrack );
2204 EnMomConservation-=res4Mom;
2205#ifdef debug
2206 G4cout<<
"G4QLowEn::PSDI: ***Filled*** rA4M="<<res4Mom<<
",rZ="<<rZ<<
",rA="<<rA<<
",rL="
2208#endif
2213 result.push_back( aNewTrack );
2214 EnMomConservation-=snd4Mom;
2215#ifdef debug
2216 G4cout<<
"G4QLowEn::PSDI: ***Filled*** 2ndH4M="<<snd4Mom
2218#endif
2219 }
2220 else res4Mom+=snd4Mom;
2221 }
2222 else res4Mom=tot4M;
2223 if(complete<3)
2224 {
2228 G4int nOut=evaHV->size();
2229 for(i=0; i<nOut; i++)
2230 {
2234 EnMomConservation-=h4Mom;
2235#ifdef debug
2236 G4cout<<
"G4QLowEn::PSDI: ***FillingCand#"<<i<<
"*** evaH="<<hPDG<<h4Mom<<
G4endl;
2237#endif
2238 if (hPDG==90000001 || hPDG==2112) theDefinition = aNeutron;
2239 else if(hPDG==90001000 || hPDG==2212) theDefinition = aProton;
2240 else if(hPDG==91000000 || hPDG==3122) theDefinition = aLambda;
2241 else if(hPDG== 22 ) theDefinition = aGamma;
2242 else if(hPDG== 111) theDefinition = aPiZero;
2243 else if(hPDG== 211) theDefinition = aPiPlus;
2244 else if(hPDG== -211) theDefinition = aPiMinus;
2245 else
2246 {
2251 }
2252 if(theDefinition)
2253 {
2258 result.push_back( evaQH );
2259 }
2260 else G4cerr<<
"-Warning-G4QLowEnergy::PostStepDoIt: Bad secondary PDG="<<hPDG<<
G4endl;
2261 }
2262 }
2263
2264 G4int nres=result.size();
2267#ifdef debug
2268 G4cout<<
"G4QLowEnergy::PostStepDoIt:*** PostStepDoIt is done ***"<<
G4endl;
2269#endif
2271}
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4QHadron * > G4QHadronVector
G4ThreeVector G4RandomDirection()
HepLorentzVector & boost(double, double, double)
const G4ThreeVector & GetMomentumDirection() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
static G4Lambda * Lambda()
void AddSecondary(G4Track *aSecondary)
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual void Initialize(const G4Track &)
const G4String & GetParticleType() const
G4int GetQuarkContent(G4int flavor) const
const G4String & GetParticleSubType() const
G4int GetAntiQuarkContent(G4int flavor) const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4ParticleTable * GetParticleTable()
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
static G4PionZero * PionZero()
G4LorentzVector Get4Momentum() const
G4int GetBaryonNumber() const
G4int GetStrangeness() const
static G4VQCrossSection * GetPointer()
G4double CoulombBarGen(const G4double &rZ, const G4double &rA, const G4double &cZ, const G4double &cA)
void EvaporateNucleus(G4QHadron *hA, G4QHadronVector *oHV)
G4double GetNuclMass(G4int Z, G4int N, G4int S)
static G4VQCrossSection * GetPointer()
void SetWeight(G4double aValue)
void SetTouchableHandle(const G4TouchableHandle &apValue)
const G4DynamicParticle * GetDynamicParticle() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
virtual G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG)
virtual G4double GetHMaxT()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription