Changeset 1055 for trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QCollision.cc
- Timestamp:
- May 28, 2009, 4:26:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QCollision.cc
r1007 r1055 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4QCollision.cc,v 1. 28 2008/10/02 21:10:07 dennisExp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4QCollision.cc,v 1.32 2009/04/17 15:22:31 mkossov Exp $ 27 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $ 28 28 // 29 29 // ---------------- G4QCollision class ----------------- … … 34 34 // ********** This CLASS is temporary moved from the photolepton_hadron directory ********* 35 35 // **************************************************************************************** 36 36 // Short description: This is a universal class for the incoherent (inelastic) 37 // nuclear interactions in the CHIPS model. 38 // --------------------------------------------------------------------------- 37 39 //#define debug 38 40 //#define pdebug 41 //#define ldebug 39 42 //#define ppdebug 40 43 //#define qedebug … … 250 253 G4cout<<"G4QCollision::GetMeanFreePath: isovectorLength="<<isoSize<<G4endl; // Result 251 254 #endif 252 if(isoSize) // The Element has non-trivial abu mdance set255 if(isoSize) // The Element has non-trivial abundance set 253 256 { 254 257 indEl=pElement->GetIndex()+1; // Index of the non-trivial element … … 262 265 G4int N=pElement->GetIsotope(j)->GetN()-Z; // N means A=N+Z ! 263 266 if(pElement->GetIsotope(j)->GetZ()!=Z)G4cerr<<"G4QCollision::GetMeanFreePath" 264 267 <<": Z="<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl; 265 268 G4double abund=abuVector[j]; 266 269 std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund); 267 270 #ifdef debug 268 271 G4cout<<"G4QCollision::GetMeanFreePath: p#="<<j<<",N="<<N<<",ab="<<abund<<G4endl; 269 272 #endif 270 273 newAbund->push_back(pr); 271 274 } 272 275 #ifdef debug 273 276 G4cout<<"G4QCollision::GetMeanFreePath: pairVectLength="<<newAbund->size()<<G4endl; … … 384 387 static const G4double mPi0s= mPi0*mPi0; 385 388 static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);// Mass of deuteron 389 //static const G4double mDeut2=mDeut*mDeut; // SquaredMassOfDeuteron 386 390 static const G4double mTrit= G4QPDGCode(2112).GetNuclMass(1,2,0);// Mass of tritium 387 391 static const G4double mHel3= G4QPDGCode(2112).GetNuclMass(2,1,0);// Mass of Helium3 … … 432 436 static G4bool CWinit = true; // CHIPS Warld needs to be initted 433 437 if(CWinit) 434 438 { 435 439 CWinit=false; 436 440 G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World (234 part.max) … … 457 461 #ifdef debug 458 462 G4double mp=proj4M.m(); 459 G4cout<<" G4QCollis::PostStepDoIt:called,P="<<Momentum<<"="<<momentum<<",m="<<mp<<G4endl;463 G4cout<<"-->G4QCollis::PostStDoIt:called,P="<<Momentum<<"="<<momentum<<",m="<<mp<<G4endl; 460 464 #endif 461 465 if (!IsApplicable(*particle)) // Check applicability … … 507 511 #ifdef debug 508 512 G4int prPDG=particle->GetPDGEncoding(); 509 513 G4cout<<"G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl; 510 514 #endif 511 515 if(!projPDG) … … 516 520 G4int EPIM=ElProbInMat.size(); 517 521 #ifdef debug 518 522 G4cout<<"G4QCollis::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl; 519 523 #endif 520 524 G4int i=0; … … 523 527 G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand(); 524 528 for(i=0; i<nE; ++i) 525 526 #ifdef debug 527 529 { 530 #ifdef debug 531 G4cout<<"G4QCollision::PostStepDoIt:E["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl; 528 532 #endif 529 533 if (rnd<ElProbInMat[i]) break; … … 534 538 Z=static_cast<G4int>(pElement->GetZ()); 535 539 #ifdef debug 536 540 G4cout<<"G4QCollision::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl; 537 541 #endif 538 542 if(Z<=0) … … 545 549 G4int nofIsot=SPI->size(); // #of isotopes in the element i 546 550 #ifdef debug 547 551 G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl; 548 552 #endif 549 553 G4int j=0; … … 554 558 { 555 559 #ifdef debug 556 560 G4cout<<"G4QCollision::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl; 557 561 #endif 558 562 if(rndI < (*SPI)[j]) break; … … 562 566 G4int N =(*IsN)[j]; ; // Randomized number of neutrons 563 567 #ifdef debug 564 G4cout<<"G4QCollision::PostStepDoIt:j="<<i<<", N(isotope)="<<N<<G4endl;568 G4cout<<"G4QCollision::PostStepDoIt: Z="<<Z<<", j="<<i<<", N(isotope)="<<N<<G4endl; 565 569 #endif 566 570 if(N<0) … … 576 580 if(dsr<dd)dsr=dd; 577 581 if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // ManualP 578 582 else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars 579 583 else if(projPDG==-211) G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.);//Pi- ClustPars 580 584 #ifdef debug … … 607 611 // Lepto-nuclear case with the equivalent photon algorithm. @@InFuture + NC (?) 608 612 // 609 if (aProjPDG == 11 || aProjPDG == 13 || aProjPDG == 15) {610 613 if (aProjPDG == 11 || aProjPDG == 13 || aProjPDG == 15) 614 { 611 615 #ifdef debug 612 616 G4cout<<"G4QCollision::PostStDoIt:startSt="<<aParticleChange.GetTrackStatus()<<G4endl; … … 646 650 G4double photonEnergy = CSmanager->GetExchangeEnergy(); // Energy of EqivExchangePart 647 651 #ifdef debug 648 652 G4cout<<"G4QCol::PStDoIt: kE="<<kinEnergy<<",dir="<<dir<<",phE="<<photonEnergy<<G4endl; 649 653 #endif 650 654 if( kinEnergy < photonEnergy || photonEnergy < 0.) … … 708 712 G4double cost=(iniE*finE-ml2-photonQ2/2)/iniP/finP; // cos(scat_ang_of_lepton) 709 713 #ifdef pdebug 710 714 G4cout<<"G4QC::PSDoIt:Q2="<<photonQ2<<",ct="<<cost<<",Pi="<<iniP<<",Pf="<<finP<<G4endl; 711 715 #endif 712 716 if(cost>1.) cost=1.; // To avoid the accuracy of calculation problem … … 717 721 G4double absEn = std::pow(am,third)*GeV; // @@(b) Mean Energy Absorbed by a Nucleus 718 722 //if(am>1 && absEn < photonEnergy) // --> the absorption of energy can happen 719 723 if(absEn < photonEnergy) // --> the absorption of energy can happen 720 724 { 721 725 G4double abtEn = absEn+hdM; // @@(b) MeanEnergyAbsorbed by a nucleus (+M_N) … … 727 731 absMom = std::sqrt(abMo2); // Absorbed Momentum 728 732 if(absMom < phMo) // --> the absorption of momentum can happen 729 733 { 730 734 G4double dEn = photonEnergy - absEn; // Leading energy 731 735 G4double dMo = phMo - absMom; // Leading momentum 732 736 G4double sF = dEn*dEn - dMo*dMo;// s of leading particle 733 737 #ifdef ppdebug 734 738 G4cout<<"-PhotoAbsorption-G4QCol::PStDoIt:sF="<<sF<<",phEn="<<photonEnergy<<G4endl; 735 739 #endif 736 740 if(sF > stmPi) // --> Leading fragmentation is possible 737 741 { 738 742 photonEnergy = absEn; // New value of the photon energy 739 743 photonQ2=abMo2-absEn*absEn; // New value of the photon Q2 … … 757 761 aParticleChange.ProposeMomentumDirection(findir); // new direction for the lepton 758 762 #ifdef pdebug 759 763 G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()<<"="<<finE<<"-" 760 764 <<ml<<", d="<<*aParticleChange.GetMomentumDirection()<<","<<findir<<G4endl; 761 765 #endif … … 765 769 G4double ptm=photon3M.mag(); // 3M of the virtual photon 766 770 #ifdef ppdebug 767 771 G4cout<<"-Absorption-G4QCollision::PostStepDoIt: ph3M="<<photon3M<<", eIn3M=" 768 772 <<iniP*dir<<", eFin3M="<<finP*findir<<", abs3M="<<absMom<<"<ptm="<<ptm<<G4endl; 769 773 #endif … … 772 776 proj4M=G4LorentzVector(lead3M,absEn); // 4-momentum of leading System 773 777 #ifdef ppdebug 774 778 G4cout<<"-->G4QC::PoStDoIt: new sF="<<proj4M.m2()<<", lead4M="<<proj4M<<G4endl; 775 779 #endif 776 780 lead4M=proj4M; // Remember 4-mom for the total 4-momentum 777 781 G4Quasmon* pan= new G4Quasmon(G4QContent(1,1,0,1,1,0),proj4M);// ---> DELETED -->---+ 778 782 try // | 779 780 783 { // | 784 delete leadhs; // | 781 785 G4QNucleus vac(90000000); // | 782 786 leadhs=pan->Fragment(vac,1); // DELETED after it is copied to output vector | 783 787 } // | 784 788 catch (G4QException& error) // | 785 789 { // | 786 790 G4cerr<<"***G4QCollision::PostStepDoIt: G4Quasmon Exception is catched"<<G4endl;//| 787 791 G4Exception("G4QCollision::PostStepDoIt:","72",FatalException,"QuasmonCrash"); //| … … 789 793 delete pan; // Delete the Nuclear Environment <----<---+ 790 794 #ifdef ppdebug 791 795 G4cout<<"G4QCol::PStDoIt: l4M="<<proj4M<<proj4M.m2()<<", N="<<leadhs->size()<<",pt=" 792 796 <<ptm<<",pa="<<absMom<<",El="<<absEn<<",Pl="<<ptm-absMom<<G4endl; 793 797 #endif … … 796 800 proj4M=G4LorentzVector(photon3M,photonEnergy); 797 801 #ifdef debug 798 802 G4cout<<"G4QCollision::PostStDoIt: St="<<aParticleChange.GetTrackStatus()<<", g4m=" 799 803 <<proj4M<<", lE="<<finE<<", lP="<<finP*findir<<", d="<<findir.mag2()<<G4endl; 800 804 #endif … … 803 807 // neutrinoNuclear interactions (nu_e, nu_mu only) 804 808 // 805 } else if (aProjPDG == 12 || aProjPDG == 14) { 806 809 } 810 else if (aProjPDG == 12 || aProjPDG == 14) 811 { 807 812 G4double kinEnergy= projHadron->GetKineticEnergy()/MeV; // Total energy of the neutrino 808 813 G4double dKinE=kinEnergy+kinEnergy; // doubled energy for s calculation 809 814 #ifdef debug 810 815 G4cout<<"G4QCollision::PostStDoIt: 2*nuEnergy="<<dKinE<<"(MeV), PDG="<<projPDG<<G4endl; 811 816 #endif 812 817 G4ParticleMomentum dir = projHadron->GetMomentumDirection(); // unit vector 813 818 G4double ml = mu; 814 G4double ml2 = 815 //G4double mlN = 816 G4double mlN2= 817 G4double fmlN= 818 G4double mlsN= 819 //G4double mlP = 820 G4double mlP2= 821 G4double fmlP= 822 G4double mlsP= 823 G4double mldM= 824 //G4double mlD = 825 G4double mlD2= 819 G4double ml2 = mu2; 820 //G4double mlN = muN; 821 G4double mlN2= muN2; 822 G4double fmlN= fmuN; 823 G4double mlsN= musN; 824 //G4double mlP = muP; 825 G4double mlP2= muP2; 826 G4double fmlP= fmuP; 827 G4double mlsP= musP; 828 G4double mldM= mudM; 829 //G4double mlD = muD; 830 G4double mlD2= muD2; 826 831 if(aProjPDG==12) 827 832 { 828 833 ml = me; 829 ml2 = 830 //mlN = 831 mlN2= 832 fmlN= 833 mlsN= 834 //mlP = 835 mlP2= 836 fmlP= 837 mlsP= 838 mldM= 839 //mlD = 840 mlD2= 834 ml2 = me2; 835 //mlN = meN; 836 mlN2= meN2; 837 fmlN= fmeN; 838 mlsN= mesN; 839 //mlP = meP; 840 mlP2= meP2; 841 fmlP= fmeP; 842 mlsP= mesP; 843 mldM= medM; 844 //mlD = meD; 845 mlD2= meD2; 841 846 } 842 847 G4VQCrossSection* CSmanager =G4QNuMuNuclearCrossSection::GetPointer(); // (nu,l) … … 881 886 G4bool secnu=false; 882 887 if(xSec*G4UniformRand()>xSec1) // recover neutrino/antineutrino 883 888 { 884 889 if(scatPDG>0) scatPDG++; 885 890 else scatPDG--; … … 900 905 totCS1 = qelCS1; 901 906 totCS2 = qelCS2; 902 907 } 903 908 // make different definitions for neutrino and antineutrino 904 909 G4double mIN=mProt; // Just a prototype (for anu, Z=1, N=0) … … 956 961 { 957 962 if(Z>1||N>0) // Calculate the splitted mass 958 963 { 959 964 targPDG-=1000; // Anti-Neutrino -> subtract proton 960 965 G4QPDGCode targQPDG(targPDG); … … 973 978 G4double s=mIN*(mIN+dKinE); // s=(M_cm)^2=m2+2mE (m=targetMass,E=E_nu) 974 979 #ifdef debug 975 980 G4cout<<"G4QCollision::PostStDoIt: s="<<s<<" >? OT="<<OT<<", mlD2="<<mlD2<<G4endl; 976 981 #endif 977 982 if(s<=OT) // *** Do nothing solution *** … … 986 991 } 987 992 #ifdef debug 988 993 G4cout<<"G4QCollision::PostStDoIt: Stop and kill the projectile neutrino"<<G4endl; 989 994 #endif 990 995 aParticleChange.ProposeEnergy(0.); … … 998 1003 else Q2=CSmanager->GetQEL_ExchangeQ2(); 999 1004 #ifdef debug 1000 1005 G4cout<<"G4QCollision::PostStDoIt:QuasiEl(nu="<<secnu<<"),s="<<s<<",Q2="<<Q2<<G4endl; 1001 1006 #endif 1002 1007 //G4double ds=s+s; // doubled s … … 1032 1037 else Q2=CSmanager2->GetNQE_ExchangeQ2(); 1033 1038 #ifdef debug 1034 1039 G4cout<<"G4QColl::PStDoIt: MultiPeriferal s="<<s<<",Q2="<<Q2<<",T="<<targPDG<<G4endl; 1035 1040 #endif 1036 1041 if(secnu) projPDG=CSmanager2->GetExchangePDGCode();// PDG Code of the effective gamma … … 1055 1060 { 1056 1061 #ifdef debug 1057 1062 G4cout<<"*G4QCollision::PostStDoIt: cost="<<cost<<", Q2="<<Q2<<", nu="<<we<<", mx=" 1058 1063 <<mx<<", pot="<<pot<<", 2KE="<<dKinE<<G4endl; 1059 1064 #endif … … 1077 1082 proj4M-=scat4M; // 4mom of the W/Z (effective pion/gamma) 1078 1083 #ifdef debug 1079 1084 G4cout<<"G4QCollision::PostStDoIt: proj4M="<<proj4M<<", ml="<<ml<<G4endl; 1080 1085 #endif 1081 1086 // Check that the en/mom transfer is possible, if not -> elastic … … 1162 1167 } 1163 1168 } 1164 1165 1169 // 1166 // quasi-elastic for p+A(Z,N)1170 // quasi-elastic (& pickup process) for p+A(Z,N) 1167 1171 // 1168 } else if (aProjPDG == 2212 && Z > 0 && N > 0) { 1169 //else if(2>3) 1170 1172 } 1173 else if (aProjPDG == 2212 && Z > 0 && N > 0) 1174 //else if(2>3) 1175 { 1171 1176 G4QuasiFreeRatios* qfMan=G4QuasiFreeRatios::GetPointer(); 1172 1177 std::pair<G4double,G4double> fief=qfMan->GetRatios(momentum, aProjPDG, Z, N); 1173 1178 G4double qepart=fief.first*fief.second; 1174 #ifdef qedebug 1175 G4cout<<"G4QCol::PSD:QE[p("<<proj4M<<")+(Z="<<Z<<",N="<<N<<",)="<<qepart<<G4endl; 1176 #endif 1177 if(G4UniformRand()<qepart) // Make a quasi free scattering (out:A-1,h,N) @@ KinLim 1178 { 1179 // First decay a nucleus in a nucleon and a residual (A-1) nucleus 1180 G4double dmom=91.; // Fermi momentum (proto default for a deuteron) 1181 if(Z>1||N>1) dmom=286.2*std::pow(-std::log(G4UniformRand()),third);// p_max=250 MeV/c 1182 1179 // Keep QE part for the quasi-free nucleons 1180 const G4int lCl=3; // The last clProb[lCl]==1. by definition, MUST be increasing 1181 G4double clProb[lCl]={.65,.85,.95};// N/P,D,t/He3,He4, integratedProb for .65,.2,.1,.05 1182 if(qepart>0.45) qepart=.45; // Quasielastic part is too large - shrink 1183 else qepart/=clProb[0]; // Add corresponding number of 2N, 3N, & 4N clusters 1184 G4double pickup=1.-qepart; // Estimate the rest of the cross-section 1185 G4double thresh=100.; 1186 if(momentum > thresh) pickup*=50./momentum/std::pow(Z+N,third); // 50. is a par(!) 1187 // pickup = 0.; // To exclude the pickup process 1188 if (N) pickup+=qepart; 1189 else pickup =qepart; 1190 G4double rnd=G4UniformRand(); 1191 #ifdef ldebug 1192 G4cout<<"-->G4QCol::PSD:QE[p("<<proj4M<<")+(Z="<<Z<<",N="<<N<<")]="<<qepart 1193 <<", pickup="<<pickup<<G4endl; 1194 #endif 1195 if(rnd<pickup) // Make a quasi free scattering (out:A-1,h,N) @@ KinLim,CoulBar,PauliBl 1196 { 1197 G4double dmom=91.; // Fermi momentum (proto default for a deuteron) 1198 G4double fmm=287.; // @@ Can be A-dependent 1199 if(Z>1||N>1) dmom=fmm*std::pow(-std::log(G4UniformRand()),third); 1200 // Values to be redefined for quasi-elastic 1201 G4LorentzVector r4M(0.,0.,0.,0.); // Prototype of 4mom of the residual nucleus 1202 G4LorentzVector n4M(0.,0.,0.,0.); // Prototype of 4mom of the quasi-cluster 1203 G4int nPDG=90000001; // Prototype for quasi-cluster mass calculation 1204 G4int restPDG=targPDG; // Prototype should be reduced by quasi-cluster 1205 G4int rA=Z+N-1; // Prototype for the residualNucl definition 1206 G4int rZ=Z; // residZ: OK for the quasi-free neutron 1207 G4int nA=1; // Prototype for the quasi-cluster definition 1208 G4int nZ=0; // nA=1,nZ=0: OK for the quasi-free neutron 1209 G4double qM=mNeut; // Free mass of the quasi-free cluster 1210 G4int A = Z + N; // Baryon number of the nucleus 1211 if(rnd<qepart) 1212 { 1213 // ===> First decay a nucleus in a nucleon and a residual (A-1) nucleus 1183 1214 // Calculate cluster probabilities (n,p,d,t,he3,he4 now only, can use UpdateClusters) 1184 const G4int lCl=3; // The last clProb[lCl]==1. by definition, MUST be increasing1185 G4double clProb[lCl]={0.6,0.7,0.8}; // N/P,D,t/He3,Alpha, integrated prob for .6,.1,.1,.21186 1215 G4double base=1.; // Base for randomization (can be reduced by totZ & totN) 1187 G4int max=lCl; // Number of boundaries (can be reduced by totZ & totN) 1188 1216 G4int max=lCl; // Number of boundaries (can be reduced by totZ & totN) 1189 1217 // Take into account that at least one nucleon must be left ! 1190 // Change max-- to --max - DHW 05/081191 G4int A = Z + N; // Baryon number of the nucleus1192 1218 if (Z<2 || N<2 || A<5) base = clProb[--max]; // Alpha cluster is impossible 1193 1219 if ( (Z > 1 && N < 2) || (Z < 2 && N > 1) ) 1194 1220 base=(clProb[max]+clProb[max-1])/2; // t or He3 is impossible 1195 1196 if ( (Z < 2 && N < 2) || A < 4) base=clProb[--max]; // Both He3 and t clusters are impossible 1197 1221 if ( (Z < 2 && N < 2) || A < 4) base=clProb[--max];// He3 & t clusters are impossible 1198 1222 if(A<3) base=clProb[--max]; // Deuteron cluster is impossible 1199 1223 G4int cln=0; // Cluster#0 (Default for the selected nucleon) … … 1207 1231 G4ParticleDefinition* theDefinition; // Prototype for qfNucleon 1208 1232 G4bool cp1 = cln+2==A; // A=ClusterBN+1 condition 1209 // Values to be defined in the following IF/ELSE1210 G4LorentzVector r4M(0.,0.,0.,0.); // Prototype of 4mom of the residual nucleus1211 G4LorentzVector n4M(0.,0.,0.,0.); // Prototype of 4mom of the quasi-cluster1212 G4int nPDG=90000001; // Prototype for quasi-cluster mass calculation1213 G4int restPDG=targPDG; // Prototype should be reduced by quasi-cluster1214 G4int rA=Z+N-1; // Prototype for the residualNucl definition1215 G4int rZ=Z; // residZ: OK for the quasi-free neutron1216 G4int nA=1; // Prototype for the quasi-cluster definition1217 G4int nZ=0; // nA=1,nZ=0: OK for the quasi-free neutron1218 G4double qM=mNeut; // Free mass of the quasi-free cluster1219 1233 if(!cln || cp1) // Split in nucleon + (A-1) with Fermi momentum 1220 1234 { … … 1239 1253 n4M=G4LorentzVector(0.,0.,0.,nM); // 4mom of the quasi-nucleon 1240 1254 #ifdef qedebug 1241 1255 G4cout<<"G4QCollis::PStDoIt:QE,p="<<dmom<<",tM="<<tM<<",R="<<rM<<",N="<<nM<<G4endl; 1242 1256 #endif 1243 1257 if(!G4QHadron(t4M).DecayIn2(r4M, n4M)) … … 1247 1261 } 1248 1262 #ifdef qedebug 1249 1263 G4cout<<"G4QCol::PStDoIt:QE-N,RA="<<r4M.rho()<<r4M<<",QN="<<n4M.rho()<<n4M<<G4endl; 1250 1264 #endif 1251 1265 if(cp1 && cln) // Quasi-cluster case: swap the output … … 1266 1280 } 1267 1281 } 1268 else // Split a cluster (wor w/o "Fermi motion" and "Fermi decay")1282 else // Split the cluster (with or w/o "Fermi motion" and "Fermi decay") 1269 1283 { 1270 1284 if(cln==1) … … 1275 1289 nZ=1; 1276 1290 restPDG-=1001; 1291 // Recalculate dmom 1292 G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) + 1293 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1294 dmom=sumv.mag(); 1277 1295 } 1278 1296 else if(cln==2) 1279 1297 { 1280 1298 nA=3; 1281 1299 if(G4UniformRand()*(A-2)>(N-1)) // He3 1282 1300 { 1283 1301 nPDG=90002001; … … 1293 1311 restPDG-=1002; 1294 1312 } 1313 // Recalculate dmom 1314 G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) + 1315 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection()+ 1316 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1317 dmom=sumv.mag(); 1295 1318 } 1296 1319 else … … 1301 1324 nZ=2; 1302 1325 restPDG-=2002; 1326 G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) + 1327 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection()+ 1328 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection()+ 1329 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1330 dmom=sumv.mag(); 1303 1331 } 1304 1332 rA=A-nA; … … 1317 1345 n4M=G4LorentzVector(0.,0.,0.,nM); // 4mom of the quasi-nucleon 1318 1346 #ifdef qedebug 1319 1347 G4cout<<"G4QCollis::PStDoIt:QEC,p="<<dmom<<",T="<<tM<<",R="<<rM<<",N="<<nM<<G4endl; 1320 1348 #endif 1321 1349 if(!G4QHadron(t4M).DecayIn2(r4M, n4M)) … … 1326 1354 // --- End of the moving cluster implementation --- 1327 1355 #ifdef qedebug 1328 1356 G4cout<<"G4QCol::PStDoIt:QEC,RN="<<r4M.rho()<<r4M<<",QCl="<<n4M.rho()<<n4M<<G4endl; 1329 1357 #endif 1330 1358 } 1331 1359 G4LorentzVector s4M=n4M+proj4M; // Tot 4-momentum for scattering 1332 G4double prjM2 = proj4M.m2(); 1360 G4double prjM2 = proj4M.m2(); // Squared mass of the projectile 1333 1361 G4double prjM = std::sqrt(prjM2); // @@ Get from pPDG (?) 1334 1362 G4double minM = prjM+qM; // Min mass sum for the final products … … 1337 1365 { 1338 1366 #ifdef qedebug 1339 1367 G4cout<<"G4QCol::PStDoIt:***Enter***,cmM2="<<cmM2<<" > minM2="<<minM*minM<<G4endl; 1340 1368 #endif 1341 1369 // Estimate and randomize charge-exchange with quasi-free cluster 1342 1370 G4bool chex=false; // Flag of the charge exchange scattering 1343 1371 G4ParticleDefinition* projpt=G4Proton::Proton(); // Prototype, only for chex=true 1372 // This is reserved for the charge-exchange scattering (to help neutron spectras) 1344 1373 //if(cln&&!cp1 &&(projPDG==2212&&rA>rZ || projPDG==2112&&rZ>1))// @@ Use proj chex 1345 1374 if(2>3) 1346 1375 { 1347 1376 #ifdef qedebug 1348 1377 G4cout<<"G4QCol::PStDoIt:-Enter,P="<<projPDG<<",cln="<<cln<<",cp1="<<cp1<<G4endl; 1349 1378 #endif 1350 1379 G4double tprM=mProt; … … 1365 1394 G4double chl=qfMan->ChExElCoef(efP*MeV, nZ, nA-nZ, projPDG); // ChEx/Elast(pPDG!) 1366 1395 #ifdef qedebug 1367 1396 G4cout<<"G4QCol::PStDoIt:chl="<<chl<<",P="<<efP<<",nZ="<<nZ<<",nA="<<nA<<G4endl; 1368 1397 #endif 1369 1398 if(chl>0.&&cmM2>minM*minM&&G4UniformRand()<chl/(1.+chl)) // minM is redefined … … 1381 1410 projPDG, proj4M); 1382 1411 #ifdef qedebug 1383 1412 G4cout<<"G4QCollis::PStDoIt:QElS,proj="<<prjM<<sctout.second<<",qfCl="<<qM 1384 1413 <<sctout.first<<",chex="<<chex<<",nA="<<nA<<",nZ="<<nZ<<G4endl; 1385 1414 #endif … … 1431 1460 else G4cout<<"G4QCol::PSD: OUT, M2="<<s4M.m2()<<"<"<<minM*minM<<", N="<<nPDG<<G4endl; 1432 1461 #endif 1433 } 1462 } // end of proton quasi-elastic (including QE on NF) 1463 else // @@ make cost-condition @@ Pickup process (pickup 1 or 2 n and make d or t) 1464 { 1465 restPDG--; // Res. nucleus PDG is one neutron less than targ. PDG 1466 G4double mPUF=mDeut; // Prototype of the mass of the created pickup fragment 1467 G4ParticleDefinition* theDefinition = G4Deuteron::Deuteron(); 1468 //theDefinition = G4ParticleTable::GetParticleTable()->FindIon(nZ,nA,0,nZ);//ion 1469 G4bool din=false; // Flag of picking up 2 neutrons to create t (tritium) 1470 //G4bool hin=false; // Flag of picking up 1 n + 1 p to create He3 (NOT IMPL) 1471 G4bool tin=false; // Flag of picking up 2 n + 1 p to create alpha (He4) 1472 G4double frn=G4UniformRand(); 1473 if(N>2 && frn > 0.95) // .95 is a parameter to pickup 2n (cteate t or +1p=alph) 1474 { 1475 theDefinition = G4Triton::Triton(); 1476 restPDG--; // Res. nucleus PDG is two neutrons less than target PDG 1477 rA--; // Reduce the baryon number of the residual nucleus 1478 mPUF=mTrit; // The mass of the created pickup fragment (triton) 1479 // Recalculate dmom 1480 G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) + 1481 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1482 dmom=sumv.mag(); 1483 din=true; 1484 if(Z>1 && frn > 0.99) // 0.99 is a parameter to pickup 2n + 1p and create alpha 1485 { 1486 theDefinition = G4Alpha::Alpha(); 1487 restPDG-=1000; // Res. nucleus PDG is (2 n + 1 p) less than target PDG 1488 rA--; // Reduce the baryon number of the residual nucleus 1489 rZ--; // Reduce the charge of the residual nucleus 1490 mPUF=mAlph; // The mass of the created pickup fragment (triton) 1491 // Recalculate dmom 1492 sumv += fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1493 dmom=sumv.mag(); 1494 tin=true; 1495 } 1496 } 1497 G4double mPUF2=mPUF*mPUF; 1498 G4LorentzVector t4M(0.,0.,0.,tM); // 4m of the target nucleus to be decayed 1499 G4double rM=G4QPDGCode(restPDG).GetMass();// Mass of the residual nucleus 1500 G4double rM2=rM*rM; // Squared mass of the residual nucleus 1501 G4double nM2=rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom);// M2 of boundQF-nucleon(2N) 1502 if(nM2 < 0) nM2=0.; 1503 G4double nM=std::sqrt(nM2); // M of bQF-nucleon 1504 G4double den2=(dmom*dmom+nM2); // squared energy of bQF-nucleon 1505 G4double den=std::sqrt(den2); // energy of bQF-nucleon 1506 #ifdef qedebug 1507 G4cout<<"G4QCollis::PStDoIt:PiU,p="<<dmom<<",tM="<<tM<<",R="<<rM<<",N="<<nM<<G4endl; 1508 #endif 1509 G4double qp=momentum*dmom; 1510 G4double srm=proj4M.e()*den; 1511 G4double cost=(nM2+mProt2+srm+srm-mPUF2)/(qp+qp); 1512 G4int ict=0; 1513 while(std::fabs(cost)>1. && ict<3) 1514 { 1515 dmom=91.; // Fermi momentum (proto default for a deuteron) 1516 if(Z>1||N>1) dmom=fmm*std::pow(-std::log(G4UniformRand()),third); 1517 if(din) // Recalculate dmom for the final triton 1518 { 1519 G4ThreeVector sumv=G4ThreeVector(0.,0.,dmom) + 1520 fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1521 if(tin) sumv+=fmm*std::pow(-std::log(G4UniformRand()),third)*G4RandomDirection(); 1522 dmom=sumv.mag(); 1523 } 1524 nM2=rM2+tM*tM-(tM+tM)*std::sqrt(rM2+dmom*dmom); // M2 of bQF-nucleon 1525 if(nM2 < 0) nM2=0.; 1526 nM=std::sqrt(nM2); // M of bQF-nucleon 1527 den2=(dmom*dmom+nM2); // squared energy of bQF-nucleon 1528 den=std::sqrt(den2); // energy of bQF-nucleon 1529 qp=momentum*dmom; 1530 srm=proj4M.e()*den; 1531 cost=(nM2+mProt2+srm+srm-mPUF2)/(qp+qp); 1532 ict++; 1533 #ifdef ldebug 1534 if(ict>2)G4cout<<"G4QCollis::PStDoIt:i="<<ict<<",d="<<dmom<<",ct="<<cost<<G4endl; 1535 #endif 1536 } 1537 if(std::fabs(cost)<=1.) 1538 {// ---- @@ From here can be a MF for QF nucleon extraction (if used by others) 1539 G4ThreeVector vdir = proj4M.vect(); // 3-Vector in the projectile direction 1540 G4ThreeVector vx(0.,0.,1.); // ProtoOrt in theDirection of the projectile 1541 G4ThreeVector vy(0.,1.,0.); // First ProtoOrt orthogonal to the direction 1542 G4ThreeVector vz(1.,0.,0.); // SecondProtoOrt orthoganal to the direction 1543 if(vdir.mag2() > 0.) // the projectile isn't at rest 1544 { 1545 vx = vdir.unit(); // Ort in the direction of the projectile 1546 G4ThreeVector vv= vx.orthogonal(); // Not normed orthogonal vector (!) 1547 vy = vv.unit(); // First ort orthogonal to the proj direction 1548 vz = vx.cross(vy); // Second ort orthoganal to the projDirection 1549 } 1550 // ---- @@ End of possible MF (Similar is in G4QEnvironment) 1551 G4double tdom=dmom*std::sqrt(1-cost*cost);// Transversal component of the Fermi-Mom 1552 G4double phi=twopi*G4UniformRand(); // Phi of the Fermi-Mom 1553 G4ThreeVector vedm=vx*dmom*cost+vy*tdom*std::sin(phi)+vz*tdom*std::cos(phi);// bQFN 1554 G4LorentzVector bqf(vedm,den); // 4-mom of the bQF nucleon 1555 r4M=t4M-bqf; // 4mom of the residual nucleus 1556 if(std::fabs(r4M.m()-rM)>.001) G4cout<<"G4QCol::PSD:rM="<<rM<<"#"<<r4M.m()<<G4endl; 1557 G4LorentzVector f4M=proj4M+bqf; // Prototype of 4-mom of Deuteron 1558 if(std::fabs(f4M.m()-mPUF)>.001) 1559 G4cout<<"G4QCol::PSD:mDeut="<<mPUF<<" # "<<f4M.m()<<G4endl; 1560 aParticleChange.ProposeEnergy(0.); // @@ ?? 1561 aParticleChange.ProposeTrackStatus(fStopAndKill);// projectile nucleon is killed 1562 aParticleChange.SetNumberOfSecondaries(2); 1563 // Fill pickup hadron 1564 G4DynamicParticle* theQFN = new G4DynamicParticle(theDefinition,f4M); 1565 G4Track* scatQFN = new G4Track(theQFN, localtime, position ); // pickup 1566 scatQFN->SetWeight(weight); // weighted 1567 scatQFN->SetTouchableHandle(trTouchable); // nuclear 1568 aParticleChange.AddSecondary(scatQFN); // cluster 1569 // ---------------------------------------------------- 1570 // Fill residual nucleus 1571 if (restPDG==90000001) theDefinition = G4Neutron::Neutron(); 1572 else if(restPDG==90001000) theDefinition = G4Proton::Proton(); 1573 else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(rZ,rA,0,rZ);//ion 1574 G4DynamicParticle* theReN = new G4DynamicParticle(theDefinition,r4M); 1575 G4Track* scatReN = new G4Track(theReN, localtime, position ); // scattered 1576 scatReN->SetWeight(weight); // weighted 1577 scatReN->SetTouchableHandle(trTouchable); // residual 1578 aParticleChange.AddSecondary(scatReN); // nucleus 1579 return G4VDiscreteProcess::PostStepDoIt(track, step); 1580 } 1581 } 1582 } // end of decoupled processes for the proton projectile 1434 1583 } // end lepto-nuclear, neutrino-nuclear, proton quasi-elastic 1435 1436 1584 EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM); // Total 4-mom of the reaction 1437 1585 if(absMom) EnMomConservation+=lead4M; // Add E/M of leading System … … 1444 1592 //G4double eWei=1.; 1445 1593 // @@@@@@@@@@@@@@ Temporary for the testing purposes --- End 1446 #ifdef debug1447 G4cout<<" G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;1448 #endif 1449 G4QHadron* pH = new G4QHadron(projPDG,proj4M); // ---> DELETED -->-- -+1594 #ifdef ldebug 1595 G4cout<<"^^G4QCollision::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl; 1596 #endif 1597 G4QHadron* pH = new G4QHadron(projPDG,proj4M); // ---> DELETED -->----+* 1450 1598 //if(momentum<1000.) // Condition for using G4QEnvironment (not G4QuasmonString) | 1451 1599 { // | … … 1465 1613 catch (G4QException& error)// | . 1466 1614 { // | . 1467 1615 //#ifdef pdebug 1468 1616 G4cerr<<"***G4QCollision::PostStepDoIt: G4QE Exception is catched"<<G4endl;// | . 1469 1617 //#endif 1470 1618 G4Exception("G4QCollision::PostStepDoIt:","27",FatalException,"CHIPSCrash");//| . 1471 1619 } // | . … … 1483 1631 // try // | 1484 1632 // { // | 1485 // 1633 // delete output; // | 1486 1634 // output = pan->Fragment();// DESTROYED in the end of the LOOP work space | 1487 1635 // // @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin | 1488 1636 // //tNH=pan->GetNOfHadrons(); // For the test purposes of the String | 1489 1637 // //if(tNH==2) // At least 2 hadrons are in the Constr.Output | 1490 // 1638 // //{// | 1491 1639 // // elF=true; // Just put a flag for the ellastic Scattering | 1492 1640 // // delete output; // Delete a prototype of dummy G4QHadronVector | … … 1503 1651 // //#ifdef pdebug 1504 1652 // G4cerr<<"***G4QCollision::PostStepDoIt: GEN Exception is catched"<<G4endl; // | 1505 1653 // //#endif 1506 1654 // G4Exception("G4QCollision::PostStDoIt:","27",FatalException,"QString Excep");//| 1507 1655 // } // | … … 1524 1672 delete leadhs; 1525 1673 } 1526 1527 1528 1674 // ------------- From here the secondaries are filled ------------------------- 1529 1675 G4int tNH = output->size(); // A#of hadrons in the output … … 1565 1711 { 1566 1712 #ifdef debug 1567 1713 G4cout<<"G4QCollision::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl; 1568 1714 #endif 1569 1715 delete hadr; … … 1578 1724 { 1579 1725 if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong(); // K_L 1580 1726 else theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S 1581 1727 } 1582 1728 else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus(); … … 1585 1731 else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero(); 1586 1732 else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus(); 1587 1733 else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!) 1588 1734 { 1589 1735 G4int aZ = hadr->GetCharge(); 1590 1736 G4int aA = hadr->GetBaryonNumber(); 1591 1737 #ifdef pdebug 1592 1738 G4cout<<"G4QCollision::PostStepDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl; 1593 1739 #endif 1594 1740 theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ); … … 1598 1744 { 1599 1745 #ifdef pdebug 1600 1746 G4cout<<"G4QCollision::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl; 1601 1747 #endif 1602 1748 theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode); 1603 1749 #ifdef pdebug 1604 1750 G4cout<<"G4QCollision::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl; 1605 1751 #endif 1606 1752 } … … 1643 1789 delete output; // instances of the G4QHadrons from the output are already deleted above + 1644 1790 #ifdef debug 1645 1791 G4cout<<"G4QCollision::PostStDoIt: after St="<<aParticleChange.GetTrackStatus()<<G4endl; 1646 1792 #endif 1647 1793 if(aProjPDG!=11 && aProjPDG!=13 && aProjPDG!=15) … … 1649 1795 //return &aParticleChange; // This is not enough (ClearILL) 1650 1796 #ifdef pdebug 1651 1797 G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy() 1652 1798 <<", d="<<*aParticleChange.GetMomentumDirection()<<G4endl; 1653 1799 #endif 1654 #ifdef debug1655 1800 #ifdef ldebug 1801 G4cout<<"G4QCollision::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG<<", St=" 1656 1802 <<aParticleChange.GetTrackStatus()<<G4endl; 1657 1803 #endif
Note: See TracChangeset
for help on using the changeset viewer.