- Timestamp:
- Nov 25, 2009, 5:13:58 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QBesIKJY.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QBesIKJY.cc,v 1. 3 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QBesIKJY.cc,v 1.4 2009/11/10 17:13:46 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QBesIKJY ---------------- … … 34 34 // Short description: Bessel functions class (can be substituted) 35 35 // ------------------------------------------------------------------- 36 36 37 //#define debug 37 38 //#define pdebug -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QCHIPSWorld.cc
r1055 r1196 26 26 // 27 27 // $Id: G4QCHIPSWorld.cc,v 1.33 2009/02/23 09:49:24 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QCHIPSWorld ---------------- -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QCandidate.cc
r1055 r1196 26 26 // 27 27 // $Id: G4QCandidate.cc,v 1.35 2009/02/23 09:49:24 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QCandidate ---------------- -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QChipolino.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QChipolino.cc,v 1.3 5 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QChipolino.cc,v 1.36 2009/08/10 16:36:53 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QChipolino ---------------- … … 222 222 <<G4endl; 223 223 #endif 224 if((fl&&kS>1)||(!fl&&mS>1)) 225 { 224 if( (fl && kS>1) || (!fl && mS>1)) 225 { 226 #ifdef debug 226 227 G4cerr<<"***G4QChipolino: ***Overfowed by strange quarks*** rQC="<<rQC<<G4endl; 227 228 //throw G4QException("G4QChipolino: NuclearFragment is overflowed by strangeQuarks"); 229 #endif 228 230 } 229 231 else if(fl) // ===> Anti-fragment -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QContent.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QContent.cc,v 1.4 5 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QContent.cc,v 1.49 2009/08/07 14:20:57 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QContent ---------------- … … 53 53 54 54 // Constructors 55 56 // Initialize by the full quark content 55 57 G4QContent::G4QContent(G4int d, G4int u, G4int s, G4int ad, G4int au, G4int as): 56 58 nD(d),nU(u),nS(s),nAD(ad),nAU(au),nAS(as) … … 60 62 #ifdef erdebug 61 63 G4cerr<<"***G4QContent:"<<d<<","<<u<<","<<s<<","<<ad<<","<<au<<","<<as<<G4endl; 62 //throw G4QException("***G4QContent::Constructor: Negative Quark Content");63 64 #endif 64 65 if(d<0) ad-=d; … … 69 70 if(as<0) s-=as; 70 71 } 72 } 73 74 // Initialize by a pair of partons 75 G4QContent::G4QContent(std::pair<G4int,G4int> PP): nD(0),nU(0),nS(0),nAD(0),nAU(0),nAS(0) 76 { 77 G4int P1=PP.first; 78 G4int P2=PP.second; 79 if(!P1 || !P2) 80 { 81 G4cerr<<"***G4QContent::Constr(pair): Zero parton P1="<<P1<<", P2="<<P2<<G4endl; 82 G4Exception("G4QContent::Constructor(pair):","72",FatalException,"WrongPartonPair"); 83 } 84 #ifdef pdebug 85 G4cout<<"G4QContent::PairConstr: P1="<<P1<<", P2="<<P2<<G4endl; 86 #endif 87 G4bool suc=true; 88 G4int A1=P1; 89 if (P1 > 7) A1= P1/100; 90 else if(P1 <-7) A1=(-P1)/100; 91 else if(P1 < 0) A1= -P1; 92 G4int P11=0; 93 G4int P12=0; 94 if(A1>7) 95 { 96 P11=A1/10; 97 P12=A1%10; 98 } 99 if(P1>0) 100 { 101 if(!P11) 102 { 103 if (A1==1) ++nD; 104 else if(A1==2) ++nU; 105 else if(A1==3) ++nS; 106 else suc=false; 107 } 108 else 109 { 110 if (P11==1) ++nD; 111 else if(P11==2) ++nU; 112 else if(P11==3) ++nS; 113 else suc=false; 114 if (P12==1) ++nD; 115 else if(P12==2) ++nU; 116 else if(P12==3) ++nS; 117 else suc=false; 118 } 119 } 120 else // negative parton 121 { 122 if(!P11) 123 { 124 if (A1==1) ++nAD; 125 else if(A1==2) ++nAU; 126 else if(A1==3) ++nAS; 127 else suc=false; 128 } 129 else 130 { 131 if (P11==1) ++nAD; 132 else if(P11==2) ++nAU; 133 else if(P11==3) ++nAS; 134 else suc=false; 135 if (P12==1) ++nAD; 136 else if(P12==2) ++nAU; 137 else if(P12==3) ++nAS; 138 else suc=false; 139 } 140 } 141 #ifdef pdebug 142 G4cout<<"G4QContent::PCo:1:"<<nD<<","<<nU<<","<<nS<<","<<nAD<<","<<nAU<<","<<nAS<<G4endl; 143 #endif 144 G4int A2=P2; 145 if (P2 > 7) A2= P2/100; 146 else if(P2 <-7) A2=(-P2)/100; 147 else if(P2 < 0) A2= -P2; 148 G4int P21=0; 149 G4int P22=0; 150 if(A2>7) 151 { 152 P21=A2/10; 153 P22=A2%10; 154 } 155 if(P2>0) 156 { 157 if(!P21) 158 { 159 if (A2==1) ++nD; 160 else if(A2==2) ++nU; 161 else if(A2==3) ++nS; 162 else suc=false; 163 } 164 else 165 { 166 if (P21==1) ++nD; 167 else if(P21==2) ++nU; 168 else if(P21==3) ++nS; 169 else suc=false; 170 if (P22==1) ++nD; 171 else if(P22==2) ++nU; 172 else if(P22==3) ++nS; 173 else suc=false; 174 } 175 } 176 else // negative parton 177 { 178 if(!P21) 179 { 180 if (A2==1) ++nAD; 181 else if(A2==2) ++nAU; 182 else if(A2==3) ++nAS; 183 else suc=false; 184 } 185 else 186 { 187 if (P21==1) ++nAD; 188 else if(P21==2) ++nAU; 189 else if(P21==3) ++nAS; 190 else suc=false; 191 if (P22==1) ++nAD; 192 else if(P22==2) ++nAU; 193 else if(P22==3) ++nAS; 194 else suc=false; 195 } 196 } 197 if(!suc) 198 { 199 G4cerr<<"***G4QContent::Constr(pair): Impossible partons, P1="<<P1<<",P2="<<P2<<G4endl; 200 G4Exception("G4QContent::Constructor(pair):","72",FatalException,"ImpossibPartonPair"); 201 } 202 #ifdef pdebug 203 G4cout<<"G4QContent::PCo:2:"<<nD<<","<<nU<<","<<nS<<","<<nAD<<","<<nAU<<","<<nAS<<G4endl; 204 #endif 71 205 } 72 206 … … 762 896 G4int G4QContent::DecQAQ(const G4int& nQAQ) 763 897 {// ===================================== 764 #ifdef pdebug898 #ifdef debug 765 899 G4cout<<"G4QCont::DecQC: n="<<nQAQ<<","<<GetThis()<<G4endl; 766 900 #endif … … 787 921 { 788 922 G4int res=tot+nQAQ; 789 #ifdef pdebug923 #ifdef debug 790 924 G4cout<<"G4QC::DecQC: tot="<<tot<<", nTP="<<nTotP<<", res="<<res<<G4endl; 791 925 #endif … … 809 943 if (!nReal) return nRet; // Now nothing to be done 810 944 // ---------- Decrimenting by nReal pairs 811 #ifdef pdebug945 #ifdef debug 812 946 G4cout<<"G4QC::DecQC: demanded "<<nQAQ<<" pairs, executed "<<nReal<<" pairs"<<G4endl; 813 947 #endif … … 820 954 if (nUP && j<nUP && (nRet>2 || nUP>1 || (nD<2 && nS<2)))// --- U-Ubar pair 821 955 { 822 #ifdef pdebug956 #ifdef debug 823 957 G4cout<<"G4QC::DecQC: decrementing UAU pair UP="<<nUP<<", QC="<<GetThis()<<G4endl; 824 958 #endif … … 831 965 else if (nDP && j<nLP && (nRet>2 || nDP>1 || (nU<2 && nS<2)))// --- D-Ubar pair 832 966 { 833 #ifdef pdebug967 #ifdef debug 834 968 G4cout<<"G4QC::DecQC: decrementing DAD pair DP="<<nDP<<", QC="<<GetThis()<<G4endl; 835 969 #endif … … 842 976 else if (nSP&& (nRet>2 || nSP>1 || (nU<2 && nD<2))) // --- S-Sbar pair 843 977 { 844 #ifdef pdebug978 #ifdef debug 845 979 G4cout<<"G4QC::DecQC: decrementing SAS pair SP="<<nSP<<", QC="<<GetThis()<<G4endl; 846 980 #endif … … 852 986 else if (nUP) // --- U-Ubar pair cancelation (final) 853 987 { 854 #ifdef pdebug988 #ifdef debug 855 989 G4cout<<"G4QC::DecQC:Decrement UAU pair (final) UP="<<nUP<<",QC="<<GetThis()<<G4endl; 856 990 #endif … … 863 997 else if (nDP) // --- D-Ubar pair cancelation (final) 864 998 { 865 #ifdef pdebug999 #ifdef debug 866 1000 G4cout<<"G4QC::DecQC:Decrement DAD pair (final) DP="<<nDP<<",QC="<<GetThis()<<G4endl; 867 1001 #endif … … 874 1008 else if (nSP) // --- S-Sbar pair cancelation (final) 875 1009 { 876 #ifdef pdebug1010 #ifdef debug 877 1011 G4cout<<"G4QC::DecQC: decrementing SAS pair SP="<<nSP<<", QC="<<GetThis()<<G4endl; 878 1012 #endif … … 885 1019 <<",T="<<nTotP<<",nRet="<<nRet<<", QC="<<GetThis()<<G4endl; 886 1020 } 887 #ifdef pdebug1021 #ifdef debug 888 1022 G4cout<<"G4QC::DecQC: >>>OUT<<< nRet="<<nRet<<", QC="<<GetThis()<<G4endl; 889 1023 #endif … … 1042 1176 G4int b=nU+nD+nS-nAU-nAD-nAS; 1043 1177 //#ifdef erdebug 1044 if(b%3) G4cerr<<"-Warn-G4QContent:BaryonNumber="<<b<<"/3 isn't an integer value"<<G4endl; 1178 if(b%3) 1179 { 1180 G4cerr<<"-Warning-G4QContent::GetBaryonNumber="<<b<<"/3 isn't anIntegerValue"<<G4endl; 1181 G4Exception("G4QContent::GetBaryonNumber:","72",FatalException,"Wrong Baryon Number"); 1182 } 1045 1183 //#endif 1046 1184 return b/3; … … 1106 1244 else 1107 1245 { 1108 #ifdef pdebug1246 #ifdef debug 1109 1247 G4cout<<"***G4QC::SPDG:CanD U="<<mU<<",D="<<mD<<",S="<<mS<<",QC="<<GetThis()<<G4endl; 1110 1248 #endif … … 1127 1265 else 1128 1266 { 1129 #ifdef pdebug1267 #ifdef debug 1130 1268 G4cout<<"***G4QC::SPDG:CanU U="<<mU<<",D="<<mD<<",S="<<mS<<",QC="<<GetThis()<<G4endl; 1131 1269 #endif … … 1148 1286 else 1149 1287 { 1150 #ifdef pdebug1288 #ifdef debug 1151 1289 G4cout<<"***G4QC::SPDG:CanS U="<<mU<<",D="<<mD<<",S="<<mS<<",QC="<<GetThis()<<G4endl; 1152 1290 #endif … … 1158 1296 G4int c=GetCharge(); 1159 1297 G4int s=GetStrangeness(); 1160 #ifdef pdebug1298 #ifdef debug 1161 1299 G4cout<<"G4QC::SPDGC:bef. b="<<b<<",n="<<n<<",c="<<c<<",s="<<s<<",Q="<<GetThis()<<G4endl; 1162 1300 #endif 1163 1301 if (b) // ==================== Baryon case 1164 1302 { 1303 1165 1304 G4int ab=abs(b); 1166 1305 if(ab>=2 && n>=6) // Multi-Baryonium (NuclearFragment) … … 1169 1308 //if (abs(mI)>3||mS>3||(b>0&&s<-1)||(b<0&&s>1)) return 0; 1170 1309 //else if(abs(mI)>2||mS>2||(b>0&&s< 0)||(b<0&&s>0)) return 10; 1171 if ( (b > 0 && s == -1) || (b < 0 && s ==1) ) return 10;1310 if ( (b > 0 && s < -1) || (b < 0 && s > 1) ) return 10; 1172 1311 else if (abs(mI) > 2 || mS > 2 1173 1312 || (b > 0 && s < 0) … … 1402 1541 return c; 1403 1542 } 1543 1544 // Make PDG's of PartonPairs for Mesons & Baryons (only) 1545 std::pair<G4int,G4int> G4QContent::MakePartonPair() const 1546 { 1547 G4double S=0.; 1548 S+=nD; 1549 G4double dP=S; 1550 S+=nU; 1551 G4double uP=S; 1552 S+=nS; 1553 G4double sP=S; 1554 S+=nAD; 1555 G4double dA=S; 1556 S+=nAU; 1557 G4double uA=S; 1558 S+=nAS; 1559 if(!S) 1560 { 1561 G4int f= static_cast<int>(1.+2.3*G4UniformRand()); // Random flavor @@ a Parameter 1562 return std::make_pair(f,-f); 1563 } 1564 G4int f=0; 1565 G4double R=S*G4UniformRand(); 1566 if (R<dP) f=1; 1567 else if(R<uP) f=2; 1568 else if(R<sP) f=3; 1569 else if(R<dA) f=-1; 1570 else if(R<uA) f=-2; 1571 else f=-3; 1572 if(f<0) // anti-quark 1573 { 1574 if(nD || nU || nS) // a Meson 1575 { 1576 if (nD) return std::make_pair(1,f); 1577 else if(nU) return std::make_pair(2,f); 1578 else return std::make_pair(3,f); 1579 } 1580 else // Anti-Baryon 1581 { 1582 // @@ Can be improved, taking into acount weights (i,i): w=3, (i,j#i): w=4(s=0 + s=1) 1583 G4int AD=nAD; 1584 if(f==-1) AD--; 1585 G4int AU=nAU; 1586 if(f==-1) AU--; 1587 G4int AS=nAS; 1588 if(f==-1) AS--; 1589 if (AS) 1590 { 1591 if (AS==2) return std::make_pair(-3303,f); // 3301 does not exist 1592 else if(AU) return std::make_pair(-3201,f); // @@ only lightest 1593 else return std::make_pair(-3101,f); // @@ only lightest 1594 } 1595 else if(AU) 1596 { 1597 if (AU==2) return std::make_pair(-2203,f); // 2201 does not exist 1598 else return std::make_pair(-2101,f); // @@ only lightest 1599 } 1600 else return std::make_pair(-1103,f); // 1101 does not exist 1601 } 1602 } 1603 else // quark (f is a PDG code of the quark) 1604 { 1605 if(nAD || nAU || nAS) // a Meson 1606 { 1607 if (nAD) return std::make_pair(f,-1); 1608 else if(nAU) return std::make_pair(f,-2); 1609 else return std::make_pair(f,-3); 1610 } 1611 else // Anti-Baryon 1612 { 1613 // @@ Can be improved, taking into acount weights (i,i): w=3, (i,j#i): w=4(s=0 + s=1) 1614 G4int AD=nD; 1615 if(f==-1) AD--; 1616 G4int AU=nU; 1617 if(f==-1) AU--; 1618 G4int AS=nS; 1619 if(f==-1) AS--; 1620 if (AS) 1621 { 1622 if (AS==2) return std::make_pair(f,3303); // 3301 does not exist 1623 else if(AU) return std::make_pair(f,3201); // @@ only lightest 1624 else return std::make_pair(f,3101); // @@ only lightest 1625 } 1626 else if(AU) 1627 { 1628 if (AU==2) return std::make_pair(f,2203); // 2201 does not exist 1629 else return std::make_pair(f,2101); // @@ only lightest 1630 } 1631 else return std::make_pair(f,1103); // 1101 does not exist 1632 } 1633 } 1634 } 1635 1636 // Add parton (pPDG) to the hadron (this QC) & get parton PDG (Baryons,Mesons,Anti-Baryons) 1637 G4int G4QContent::AddParton(G4int pPDG) const 1638 { 1639 #ifdef debug 1640 G4cout<<"G4QContent::AddParton: This="<<GetThis()<<", pPDG="<<pPDG<<G4endl; 1641 #endif 1642 if(!pPDG || pPDG==9 || pPDG==21) 1643 { 1644 #ifdef debug 1645 G4cout<<"-Warning-G4QContent::AddParton: ImpossibleToAdd PartonWithPDG="<<pPDG<<G4endl; 1646 #endif 1647 return 0; 1648 } 1649 G4int aPDG = std::abs(pPDG); 1650 if( (aPDG>3 && aPDG<1101) || pPDG>3303) // @@ 1101 does not exist 1651 { 1652 #ifdef debug 1653 G4cout<<"-Warning-G4QContent::AddParton: Impossible Parton with PDG="<<pPDG<<G4endl; 1654 #endif 1655 return 0; 1656 } 1657 G4int HBN = GetBaryonNumber(); 1658 if( HBN > 1 || HBN <-1) 1659 { 1660 #ifdef debug 1661 G4cout<<"-Warning-G4QContent::AddParton: Impossible Hadron with BaryonN="<<HBN<<G4endl; 1662 #endif 1663 return 0; 1664 } 1665 G4int AD=nAD; 1666 G4int AU=nAU; 1667 G4int AS=nAS; 1668 G4int QD=nD; 1669 G4int QU=nU; 1670 G4int QS=nS; 1671 if(aPDG>99) // Parton is DiQuark/antiDiQuark 1672 { 1673 G4int rPDG=aPDG/100; 1674 G4int P1=rPDG/10; // First quark 1675 G4int P2=rPDG%10; // Second quark 1676 #ifdef debug 1677 G4cout<<"G4QContent::AddParton: DiQuark/AntiDiQuark, P1="<<P1<<", P2="<<P2<<G4endl; 1678 #endif 1679 if(pPDG>0) // -- DiQuark 1680 { 1681 #ifdef debug 1682 G4cout<<"G4QContent::AddParton: DiQuark, P1="<<P1<<", P2="<<P2<<",HBN="<<HBN<<G4endl; 1683 #endif 1684 if (P1==3 && P2==3) // ----> ss DiQuark 1685 { 1686 if(HBN<0 && AS>1) AS-=2; // >> Annihilation of ss-DiQuark with anti-Baryon 1687 else if(!HBN && AS==1) 1688 { 1689 AS=0; 1690 ++QS; 1691 } 1692 else if(HBN || (!HBN && !AS)) return 0; 1693 } 1694 else if(P1==3 && P2==2) // ----> su DiQuark 1695 { 1696 if(HBN<0 && AS && AU) // >> Annihilation of su-DiQuark with anti-Baryon 1697 { 1698 --AS; 1699 --AU; 1700 } 1701 else if(!HBN && (AS || AU)) 1702 { 1703 if(AS) 1704 { 1705 --AS; 1706 ++QU; 1707 } 1708 else 1709 { 1710 --AU; 1711 ++QS; 1712 } 1713 } 1714 else if(HBN || (!HBN && !AS && !AU)) return 0; 1715 } 1716 else if(P1==3 && P2==1) // ----> sd DiQuark 1717 { 1718 if(HBN<0 && AS && AD) // >> Annihilation of sd-DiQuark with anti-Baryon 1719 { 1720 --AS; 1721 --AD; 1722 } 1723 else if(!HBN && (AS || AD)) 1724 { 1725 if(AS) 1726 { 1727 --AS; 1728 ++QD; 1729 } 1730 else 1731 { 1732 --AD; 1733 ++QS; 1734 } 1735 } 1736 else if(HBN || (!HBN && !AS && !AD)) return 0; 1737 } 1738 else if(P1==2 && P2==2) // ----> uu DiQuark 1739 { 1740 if(HBN<0 && AU>1) AU-=2; // >> Annihilation of uu-DiQuark with anti-Baryon 1741 else if(!HBN && AU==1) 1742 { 1743 AU=0; 1744 ++QU; 1745 } 1746 else if(HBN || (!HBN && !AU)) return 0; 1747 } 1748 else if(P1==2 && P2==1) // ----> ud DiQuark 1749 { 1750 if(HBN<0 && AD && AU) // >> Annihilation of ud-DiQuark with anti-Baryon 1751 { 1752 --AD; 1753 --AU; 1754 } 1755 else if(!HBN && (AD || AU)) 1756 { 1757 if(AD) 1758 { 1759 --AD; 1760 ++QU; 1761 } 1762 else 1763 { 1764 --AU; 1765 ++QD; 1766 } 1767 } 1768 else if(HBN || (!HBN && !AU && !AD)) return 0; 1769 } 1770 else // ----> dd DiQuark 1771 { 1772 if(HBN<0 && AD>1) AD-=2; // >> Annihilation of dd-DiQuark with anti-Baryon 1773 else if(!HBN && AD==1) 1774 { 1775 AD=0; 1776 ++QD; 1777 } 1778 else if(HBN || (!HBN && !AD)) return 0; 1779 } 1780 #ifdef debug 1781 G4cout<<"G4QContent::AddParton: DQ, QC="<<QD<<","<<QU<<","<<QS<<","<<AD<<","<<AU<<"," 1782 <<AS<<G4endl; 1783 #endif 1784 if (HBN<0) // ....... Hadron is an Anti-Baryon 1785 { 1786 if (AD) return -1; // >>>>>>> Answer is anti-d 1787 else if(AU) return -2; // >>>>>>> Answer is anti-u 1788 else return -3; // >>>>>>> Answer is anti-s 1789 } 1790 else // ... Hadron is aMeson with annihilatedAntiQuark 1791 { 1792 if (QS) // --------- There is an s-quark 1793 { 1794 if (QS==2) return 3303; // >>>>>>> Answer is ss (3301 does not exist) 1795 else if(QU) return 3201; // >>>>>>> Answer is su (@@ only lightest) 1796 else return 3101; // >>>>>>> Answer is sd (@@ only lightest) 1797 } 1798 else if(QU) // --------- There is an u quark 1799 { 1800 if (QU==2) return 2203; // >>>>>>> Answer is uu (2201 does not exist) 1801 else return 2101; // >>>>>>> Answer is ud (@@ only lightest) 1802 } 1803 else return 1103; // >>>>>>> Answer is dd (1101 does not exist) 1804 } 1805 } 1806 else // -- antiDiQuark 1807 { 1808 #ifdef debug 1809 G4cout<<"G4QContent::AddParton: AntiDiQuark,P1="<<P1<<",P2="<<P2<<",B="<<HBN<<G4endl; 1810 #endif 1811 if (P1==3 && P2==3) // ----> anti-s-anti-s DiQuark 1812 { 1813 if(HBN>0 && QS>1) QS-=2; // >> Annihilation of anti-ss-DiQuark with Baryon 1814 else if(!HBN && QS==1) 1815 { 1816 QS=0; 1817 ++AS; 1818 } 1819 else if(HBN || (!HBN && !QS)) return 0; 1820 } 1821 else if(P1==3 && P2==2) // ----> anti-s-anti-u DiQuark 1822 { 1823 if(HBN>0 && QS && QU) // >> Annihilation of anti-su-DiQuark with Baryon 1824 { 1825 --QS; 1826 --QU; 1827 } 1828 else if(!HBN && (QS || QU)) 1829 { 1830 if(QS) 1831 { 1832 --QS; 1833 ++AU; 1834 } 1835 else 1836 { 1837 --QU; 1838 ++AS; 1839 } 1840 } 1841 else if(HBN || (!HBN && !QS && !QU)) return 0; 1842 } 1843 else if(P1==3 && P2==1) // ----> anti-s-anti-d DiQuark 1844 { 1845 if(HBN>0 && QS && QD) // >> Annihilation of anti-sd-DiQuark with Baryon 1846 { 1847 --QS; 1848 --QD; 1849 } 1850 else if(!HBN && (QS || QD)) 1851 { 1852 if(QS) 1853 { 1854 --QS; 1855 ++AD; 1856 } 1857 else 1858 { 1859 --QD; 1860 ++AS; 1861 } 1862 } 1863 else if(HBN || (!HBN && !QS && !QD)) return 0; 1864 } 1865 else if(P1==2 && P2==2) // ----> anti-u-anti-u DiQuark 1866 { 1867 if(HBN>0 && QU>1) QU-=2; // >> Annihilation of anti-uu-DiQuark with Baryon 1868 else if(!HBN && QU==1) 1869 { 1870 QU=0; 1871 ++AU; 1872 } 1873 else if(HBN || (!HBN && !QU)) return 0; 1874 } 1875 else if(P1==2 && P2==1) // ----> anti-u-anti-d DiQuark 1876 { 1877 if(HBN>0 && QU && QD) // >> Annihilation of anti-ud-DiQuark with Baryon 1878 { 1879 --QU; 1880 --QD; 1881 } 1882 else if(!HBN && (QU || QD)) 1883 { 1884 if(QU) 1885 { 1886 --QU; 1887 ++AD; 1888 } 1889 else 1890 { 1891 --QD; 1892 ++AU; 1893 } 1894 } 1895 else if(HBN || (!HBN && !QU && !QD)) return 0; 1896 } 1897 else // ----> anti-d=anti-d DiQuark 1898 { 1899 if(HBN>0 && QD>1) QD-=2; // >> Annihilation of anti-dd-DiQuark with Baryon 1900 else if(!HBN && QD==1) 1901 { 1902 QD=0; 1903 ++AD; 1904 } 1905 else if(HBN || (!HBN && !QD)) return 0; 1906 } 1907 #ifdef debug 1908 G4cout<<"G4QContent::AddParton:ADQ, QC="<<QD<<","<<QU<<","<<QS<<","<<AD<<","<<AU<<"," 1909 <<AS<<G4endl; 1910 #endif 1911 if (HBN>0) // ....... Hadron is an Baryon 1912 { 1913 if (QD) return 1; // >>>>>>> Answer is d 1914 else if(QU) return 2; // >>>>>>> Answer is u 1915 else return 3; // >>>>>>> Answer is s 1916 } 1917 else // ....... Meson with annihilated Anti-Quark 1918 { 1919 if (AS) // --------- There is an anti-s quark 1920 { 1921 if (AS==2) return -3303; // >>>>>>> Answer is anti-ss (3301 does not exist) 1922 else if(AU) return -3201; // >>>>>>> Answer is anti-su (@@ only lightest) 1923 else return -3101; // >>>>>>> Answer is anti-sd (@@ only lightest) 1924 } 1925 else if(AU) // --------- There is an anti-u quark 1926 { 1927 if (AU==2) return -2203; // >>>>>>> Answer is anti-uu (2201 does not exist) 1928 else return -2101; // >>>>>>> Answer is anti-ud (@@ only lightest) 1929 } 1930 else return -1103; // >>>>>>> Answer is anti-dd (1101 does not exist) 1931 } 1932 } 1933 } 1934 else // Parton is Quark/antiQuark 1935 { 1936 if(pPDG>0) // -- Quark 1937 { 1938 #ifdef debug 1939 G4cout<<"G4QContent::AddParton: Quark, A="<<AD<<","<<AU<<","<<AS<<",B="<<HBN<<G4endl; 1940 #endif 1941 if (aPDG==1) // ----> d quark 1942 { 1943 if(HBN<0 && AD) AD--; // ====> Annihilation of d-quark with anti-Baryon 1944 else if(HBN || (!HBN && !AD)) return 0; 1945 } 1946 else if(aPDG==2) // ----> u quark 1947 { 1948 if(HBN<0 && AU) AU--; // ====> Annihilation of u-quark with anti-Baryon 1949 else if(HBN || (!HBN && !AU)) return 0; 1950 } 1951 else // ----> s quark 1952 { 1953 if(HBN<0 && AS) AS--; // ====> Annihilation of s-quark with anti-Baryon 1954 else if(HBN || (!HBN && !AS)) return 0; 1955 } 1956 #ifdef debug 1957 G4cout<<"G4QContent::AddParton: Q, QC="<<QD<<","<<QU<<","<<QS<<","<<AD<<","<<AU<<"," 1958 <<AS<<G4endl; 1959 #endif 1960 if (!HBN) // ....... Hadron is a Meson (passingThrougAbove) 1961 { 1962 if (QD) return 1; // >>>>>>> Answer is d 1963 else if(QU) return 2; // >>>>>>> Answer is u 1964 else return 3; // >>>>>>> Answer is s 1965 } 1966 else // ....... AntiBaryon with annihilated AntiQuark 1967 { 1968 if (AS) // --------- There is an anti-s quark 1969 { 1970 if (AS==2) return -3303; // >>>>>>> Answer is ss (3301 does not exist) 1971 else if(AU) return -3201; // >>>>>>> Answer is su (@@ only lightest) 1972 else return -3101; // >>>>>>> Answer is sd (@@ only lightest) 1973 } 1974 else if(AU) 1975 { 1976 if (AU==2) return -2203; // >>>>>>> Answer is uu (2201 does not exist) 1977 else return -2101; // >>>>>>> Answer is ud (@@ only lightest) 1978 } 1979 else return -1103; // >>>>>>> Answer is dd (1101 does not exist) 1980 } 1981 } 1982 else // -- antiQuark 1983 { 1984 #ifdef debug 1985 G4cout<<"G4QContent::AddParton: antiQ, Q="<<QD<<","<<QU<<","<<QS<<",B="<<HBN<<G4endl; 1986 #endif 1987 if (aPDG==1) // ----> anti-d quark 1988 { 1989 if(HBN>0 && QD) QD--; // ====> Annihilation of anti-d-quark with Baryon 1990 else if(HBN || (!HBN && !QD)) return 0; 1991 } 1992 else if(aPDG==2) // ----> anti-u quark 1993 { 1994 if(HBN>0 && QU) QU--; // ====> Annihilation of anti-u-quark with Baryon 1995 else if(HBN || (!HBN && !QU)) return 0; 1996 } 1997 else // ----> anti-s quark 1998 { 1999 if(HBN>0 && QS) QS--; // ====> Annihilation of anti-s-quark with Baryon 2000 else if(HBN || (!HBN && !QS)) return 0; 2001 } 2002 #ifdef debug 2003 G4cout<<"G4QContent::AddParton: AQ, QC="<<QD<<","<<QU<<","<<QS<<","<<AD<<","<<AU<<"," 2004 <<AS<<G4endl; 2005 #endif 2006 if (!HBN) // ....... Hadron is a Meson (passingThrougAbove) 2007 { 2008 if (AD) return -1; // >>>>>>> Answer is anti-d 2009 else if(AU) return -2; // >>>>>>> Answer is anti-u 2010 else return -3; // >>>>>>> Answer is anti-s 2011 } 2012 else // ....... Baryon with annihilated Quark 2013 { 2014 if (QS) // --------- There is an anti-s quark 2015 { 2016 if (QS==2) return 3303; // >>>>>>> Answer is ss (3301 does not exist) 2017 else if(QU) return 3201; // >>>>>>> Answer is su (@@ only lightest) 2018 else return 3101; // >>>>>>> Answer is sd (@@ only lightest) 2019 } 2020 else if(QU) 2021 { 2022 if (QU==2) return 2203; // >>>>>>> Answer is uu (2201 does not exist) 2023 else return 2101; // >>>>>>> Answer is ud (@@ only lightest) 2024 } 2025 else return 1103; // >>>>>>> Answer is dd (1101 does not exist) 2026 } 2027 } 2028 } 2029 } -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QDecayChan.cc
r1055 r1196 26 26 // 27 27 // $Id: G4QDecayChan.cc,v 1.28 2009/02/23 09:49:24 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QDecayChan ---------------- -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QEnvironment.cc
r1055 r1196 28 28 // 29 29 // 30 // $Id: G4QEnvironment.cc,v 1.1 44 2009/05/26 14:40:20mkossov Exp $31 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $30 // $Id: G4QEnvironment.cc,v 1.157 2009/11/16 18:15:01 mkossov Exp $ 31 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 32 32 // 33 33 // ---------------- G4QEnvironment ---------------- … … 53 53 //#define cldebug 54 54 //#define edebug 55 //#define rdebug 55 56 //#define fdebug 56 //#define rdebug57 57 //#define ffdebug 58 58 //#define pcdebug … … 100 100 { 101 101 G4QHadron* curQH = new G4QHadron(projHadrons[ih]); 102 #ifdef pdebug102 #ifdef debug 103 103 G4cout<<"*G4QE::Const:iH#"<<ih<<","<<curQH->GetQC()<<curQH->Get4Momentum()<<G4endl; 104 104 #endif … … 111 111 { 112 112 G4QHadron* curQH = new G4QHadron(targPDG); 113 #ifdef pdebug113 #ifdef debug 114 114 G4cout<<"**G4QE::Const:No iHad,eH="<<curQH->GetQC()<<curQH->Get4Momentum()<<G4endl; 115 115 #endif … … 120 120 } 121 121 G4QPDGCode targQPDG(targPDG); 122 #ifdef pdebug122 #ifdef debug 123 123 G4cout<<"G4QE::C:targQPDG="<<targQPDG<<G4endl; 124 124 #endif … … 129 129 tot4Mom=G4LorentzVector(0.,0.,0.,targM); 130 130 // === Print out of the input information at Creation time & tot 4-mom Calculation ====== 131 #ifdef pdebug131 #ifdef debug 132 132 G4cout<<"G4QE::C:PDG="<<targPDG<<",C="<<totCharge<<",M="<<targM<<",n="<<nHadrons<<G4endl; 133 133 #endif … … 141 141 totCharge += prHadr->GetCharge(); 142 142 totBaryoN += prHadr->GetBaryonNumber(); 143 #ifdef pdebug143 #ifdef debug 144 144 G4int hPDG = prHadr->GetPDGCode(); 145 145 G4int hNFrag= prHadr->GetNFragments(); … … 148 148 #endif 149 149 } 150 #ifdef pdebug150 #ifdef debug 151 151 G4cout<<"G4QEnv::Const:tC="<<totCharge<<",tB="<<totBaryoN<<",tot4M="<<tot4Mom<<G4endl; 152 152 #endif 153 #ifdef pdebug153 #ifdef debug 154 154 G4cout<<"G4QEnv::Const: ----> tC="<<totCharge<<",tB="<<totBaryoN<<G4endl; 155 155 #endif 156 156 G4int nP=theWorld->GetQPEntries(); // A#of init'ed particles in CHIPS World 157 157 G4int nCl=nP-90; // A#of init'ed clusters in CHIPS World 158 #ifdef pdebug158 #ifdef debug 159 159 G4cout<<"G4QEnv:Const:Before NCI:n="<<nP<<",F="<<projHadrons[0]->GetNFragments()<<",tC=" 160 160 <<totCharge<<",tB="<<totBaryoN<<G4endl; 161 161 #endif 162 162 InitClustersVector(nCl,targA); // Init Clusters as Particles (to interact) 163 #ifdef pdebug163 #ifdef debug 164 164 G4cout<<"G4QEnv::Const:NucClust,n="<<nCl<<",F="<<projHadrons[0]->GetNFragments()<<",tC=" 165 165 <<totCharge<<",tB="<<totBaryoN<<G4endl; … … 168 168 { 169 169 theEnvironment.InitByPDG(targPDG); // Create nuclear environment 170 #ifdef pdebug170 #ifdef debug 171 171 G4cout<<"G4QEnv::Const:nH="<<nHadrons<<",PDG="<<projHadrons[0]->GetPDGCode()<<",tC=" 172 172 <<totCharge<<",tB="<<totBaryoN<<G4endl; … … 176 176 G4QHadron* opHad=projHadrons[0]; 177 177 G4int opPDG=opHad->GetPDGCode(); 178 #ifdef pdebug178 #ifdef debug 179 179 G4cout<<"G4QEnviron::Constructor: *** Only one input hadron*** PDG="<<opPDG<<G4endl; 180 180 #endif … … 182 182 { 183 183 G4double exMass=tot4Mom.m(); 184 #ifdef pdebug184 #ifdef debug 185 185 G4cout<<"G4QEnvironment::Const: exM="<<exMass-targM<<" > mPi0 ?"<<G4endl; 186 186 #endif … … 191 191 if(targM>999.&&!exEnviron.SplitBaryon())//Nucleus is below SplitFragmentThreshold 192 192 { 193 #ifdef pdebug193 #ifdef debug 194 194 G4cout<<"G4QEnv::Const:Photon's added to Output, Env="<<theEnvironment<<G4endl; 195 195 #endif 196 196 G4QHadron* photon = new G4QHadron(opHad); // Fill projPhoton to Output 197 #ifdef pdebug197 #ifdef debug 198 198 G4cout<<"**G4QE::Const:Phot="<<photon->GetQC()<<photon->Get4Momentum()<<G4endl; 199 199 #endif … … 207 207 if(!G4QHadron(tot4Mom).DecayIn2(prot4m,gam4m)) 208 208 { 209 #ifdef pdebug209 #ifdef debug 210 210 G4cout<<"*War*G4QEnv::Const:(P)Photon->Output, Env="<<theEnvironment<<G4endl; 211 211 #endif 212 212 G4QHadron* photon = new G4QHadron(opHad); // Fill projPhoton to Output 213 #ifdef pdebug213 #ifdef debug 214 214 G4cout<<"**G4QE::Const:Ph="<<photon->GetQC()<<photon->Get4Momentum()<<G4endl; 215 215 #endif … … 222 222 theQHadrons.push_back(photon); // (delete equivalent) 223 223 theEnvironment.InitByPDG(90000000); // Create nuclear environment 224 #ifdef pdebug224 #ifdef debug 225 225 G4cout<<"G4QEnv::Const:Fill gamma and N from gam+N"<<targPDG<<prot4m<<G4endl; 226 226 #endif … … 255 255 G4LorentzVector tg4m=G4LorentzVector(0.,0.,0.,targM); // 4mom of all target nucleus 256 256 G4LorentzVector fd4m=tg4m-qi4m; // 4mom of the residual coloured nuclear sys. 257 #ifdef pdebug257 #ifdef debug 258 258 //G4cout<<">>>G4QEnv::Const:rM="<<rsm<<",fM="<<fnm<<",tM="<<targM<<G4endl; 259 259 G4cout<<"G4QEnvironment::Const:mu4M="<<mu4m<<",t4M="<<qt4m<<",tgQP="<<qi4m<<G4endl; … … 299 299 neutrino = new G4QHadron(nuPDG,nu4m);// Fill Neutrino to Output 300 300 theEnvironment.InitByPDG(90000000); // Create nuclear environment 301 #ifdef pdebug301 #ifdef debug 302 302 G4cout<<"G4QEnv::Const:Fill neutrino (1) "<<nuPDG<<nu4m<<G4endl; 303 303 #endif … … 306 306 } 307 307 neutrino = new G4QHadron(nuPDG,nu4m); // Fill Neutrino to Output 308 #ifdef pdebug308 #ifdef debug 309 309 G4cout<<"G4QEnv::Const:Fill neutrino (2) "<<nuPDG<<nu4m<<G4endl; 310 310 #endif … … 328 328 } 329 329 G4QHadron* photon = new G4QHadron(22,ga4m); // Fill projPhoton to Output 330 #ifdef pdebug330 #ifdef debug 331 331 G4cout<<"G4QEnv::Const:Fill photon "<<ga4m<<G4endl; 332 332 #endif 333 333 theQHadrons.push_back(photon); // (delete equivalent) 334 334 G4QHadron* fnuc = new G4QHadron(targQC,qf4m); // Fill Final Nucleus to Output 335 #ifdef pdebug335 #ifdef debug 336 336 G4cout<<"G4QEnv::Const:Fill target "<<targQC<<qf4m<<" in any form"<<G4endl; 337 337 #endif … … 355 355 G4int hNFrag = curHadr->GetNFragments();// #0 means intermediate (skip) 356 356 G4LorentzVector ch4M=curHadr->Get4Momentum(); // 4-momenyum of the current projectile 357 #ifdef pdebug357 #ifdef debug 358 358 G4cout<<"G4QE:C:"<<ih<<",F="<<hNFrag<<",0="<<projHadrons[0]->GetNFragments()<<G4endl; 359 359 #endif … … 382 382 { 383 383 G4QHadron* newHadr = new G4QHadron(curHadr); 384 #ifdef pdebug384 #ifdef debug 385 385 G4cout<<"*G4QE::Const:H="<<newHadr->GetQC()<<newHadr->Get4Momentum()<<G4endl; 386 386 #endif 387 387 theQHadrons.push_back(newHadr); // Fill existing hadron (delete equivalent) 388 #ifdef pdebug388 #ifdef debug 389 389 G4cout<<"G4QEnviron::Constructor: Fill h="<<hPDG<<ch4M<<G4endl; 390 390 for(unsigned ipo=0; ipo<theQHadrons.size(); ipo++) // LOOP just for printing … … 403 403 { 404 404 G4QContent hQC = curHadr->GetQC(); 405 #ifdef pdebug405 #ifdef debug 406 406 G4cout<<"G4QE::Const:CreateQuasm, 4M="<<ch4M<<",QC="<<hQC<<",E="<<envPDG<<",tC=" 407 407 <<totCharge<<",tB="<<totBaryoN<<G4endl; … … 447 447 h4Mom+=G4LorentzVector(0.,0.,0.,tQPDG.GetMass()); //Projectile + TargetHadron 448 448 hQC+=tQPDG.GetQuarkContent(); 449 #ifdef pdebug449 #ifdef debug 450 450 G4cout<<"G4QEnv::Const:VacHadrTarg="<<h4Mom<<hQC<<",E="<<theEnvironment<<G4endl; 451 451 #endif … … 458 458 { 459 459 G4QHadron* newHadr = new G4QHadron(curHadr); 460 #ifdef pdebug460 #ifdef debug 461 461 G4cout<<"*G4QE::Const:#"<<ih<<","<<curHadr->GetQC()<<curHadr->Get4Momentum()<<G4endl; 462 462 #endif … … 504 504 { 505 505 G4QHadron* curQH = new G4QHadron(right.theQHadrons[ih]); 506 #ifdef pdebug506 #ifdef debug 507 507 G4cout<<"G4QE::CopyByVal:cH#"<<ih<<","<<curQH->GetQC()<<curQH->Get4Momentum()<<G4endl; 508 508 #endif … … 550 550 { 551 551 G4QHadron* curQH = new G4QHadron(right->theQHadrons[ih]); 552 #ifdef pdebug552 #ifdef debug 553 553 G4cout<<"G4QE::CopyByPtr:cH#"<<ih<<","<<curQH->GetQC()<<curQH->Get4Momentum()<<G4endl; 554 554 #endif … … 650 650 { 651 651 G4QHadron* curQH = new G4QHadron(right.theQHadrons[ih]); 652 #ifdef pdebug652 #ifdef debug 653 653 G4cout<<"G4QE::Operator=:c#"<<ih<<","<<curQH->GetQC()<<curQH->Get4Momentum()<<G4endl; 654 654 #endif … … 728 728 { 729 729 G4double tgMass=theEnvironment.GetMass();// mass of the target (QEnvironment) nucleus 730 #ifdef pdebug730 #ifdef debug 731 731 G4cout<<"G4QEnvironment::CreateQ:Interact "<<projQC<<proj4M<<"(m2="<<projM2<<") + A=" 732 732 <<targPDG<<",M="<<tgMass<<",tC="<<totCharge<<",tB="<<totBaryoN<<G4endl; … … 749 749 else nBarClust=4+d+d; 750 750 } 751 #ifdef pdebug751 #ifdef debug 752 752 G4cout<<"G4QE::CrQ:TNuc:Z="<<envZ<<",N="<<envN<<",nC="<<nBarClust<<",tC=" 753 753 <<totCharge<<", tB="<<totBaryoN<<G4endl; … … 762 762 theEnvironment.SetMaxClust(nBarClust); 763 763 nBarClust=theEnvironment.UpdateClusters(din); // Cluster Probabilities upto maxClust 764 #ifdef pdebug764 #ifdef debug 765 765 G4cout<<"G4QEnv::CreateQ: Nucleus("<<targPDG<<") is created ("<<nBarClust<<" clast's)"; 766 766 for(G4int ic=0;ic<nBarClust;ic++) … … 770 770 theEnvironment.PrepareCandidates(theQCandidates,piF,gaF,proj4M);//Calc.Clust's probab's 771 771 G4QNucleus memEnviron=theEnvironment; 772 #ifdef pdebug772 #ifdef debug 773 773 G4cout<<"G4QE::CrQ:ClusterProbabCalculation tC="<<totCharge<<",tB="<<totBaryoN<<G4endl; 774 774 #endif … … 785 785 { 786 786 // @@ Annihilation on one baryon is implemented (no annihilation on clusters! @@?) @@ 787 #ifdef pdebug787 #ifdef debug 788 788 G4cout<<"G4QE::CreQ:Annihilation on a perif. nucleon, Z="<<envZ<<",N="<<envN<<G4endl; 789 789 #endif … … 817 817 //} 818 818 theEnvironment.Reduce(targNPDG); // Subtract periferal baryon from Nucleus 819 #ifdef pdebug819 #ifdef debug 820 820 G4cout<<"G4QEnvironment::CQ:"<<targNPDG<<" is selected Env="<<theEnvironment<<G4endl; 821 821 #endif … … 834 834 G4Quasmon* pan = new G4Quasmon(valQ,q4Mom);// N-Nbar Quasm creation (del.at 9th line) 835 835 G4QNucleus vE(90000000); // Annihilation in vacuum (in NuclMatter?) 836 #ifdef pdebug836 #ifdef debug 837 837 G4cout<<"G4QE::CreQ: before Fragment, vE="<<vE<<",vP="<<vE.GetProbability()<<",QQC=" 838 838 <<valQ<<",Q4M="<<q4Mom<<G4endl; 839 839 #endif 840 840 G4QHadronVector* output=pan->Fragment(vE,1);//Output of inVacAnnihilation*DESTROY*<-+ 841 #ifdef pdebug841 #ifdef debug 842 842 G4cout<<"G4QE::CrQ:NucleonAntinucleonAnnihilation's done,N="<<output->size()<<G4endl; 843 843 #endif 844 844 G4Quasmon::OpenElectromagneticDecays(); // Parameter for multihadronFragmentatation^ 845 #ifdef pdebug845 #ifdef debug 846 846 G4cout<<"G4QE::CrQ:>>AnnihilationIsDone,C="<<totCharge<<",B="<<totBaryoN<<G4endl;// ^ 847 847 #endif … … 851 851 G4LorentzVector trg4M(0.,0.,0.,resMass); // New 4-momentum for the ResidualNucleus^ ^ 852 852 G4int tNH = output->size(); // For the selection LOOP ^ ^ 853 G4ThreeVector dir = RndmDir();// For the selection in LOOP (@@ at rest)^ ^853 G4ThreeVector dir = G4RandomDirection(); // For the selection in LOOP (@@ at rest)^ ^ 854 854 G4double ra=std::pow(G4double(totBaryoN),third); // ^ ^ 855 #ifdef pdebug855 #ifdef debug 856 856 G4cout<<"G4QE::CQ:N="<<tNH<<",T="<<totCharge<<","<<totBaryoN<<",A="<<ra<<G4endl;//^ ^ 857 857 #endif … … 866 866 G4int shCHG= curHadr->GetCharge(); // Charge of the projectile ^ ^ 867 867 G4double shMOM= sh4m.rho(); // Momentum of the projectile ^ ^ 868 #ifdef pdebug868 #ifdef debug 869 869 G4cout<<"G4QE::CrQ:"<<ind<<","<<shDFL<<",PDG="<<shPDG<<",4M="<<sh4m<<G4endl; // ^ ^ 870 870 #endif … … 878 878 else solAnCut+=1000*shCHG/shMOM/ra; // ChargeDepSolAngle(Normal) ^ ^ 879 879 //G4double solAnCut=SolidAngle+20*shCHG*sqrt(1.*envZ)/shMOM;//ChargeDepSolAngle ^ ^ 880 #ifdef pdebug880 #ifdef debug 881 881 G4cout<<"G4QE::CrQ: PDG="<<shPDG<<", p="<<shMOM<<", r="<<ra<<G4endl; // ^ ^ 882 882 #endif 883 883 if(!shDFL) // Final(notDecayed) hadrons ^ ^ 884 884 { 885 #ifdef pdebug885 #ifdef debug 886 886 G4cout<<"G4QE::CQ:>H="<<shPDG<<":"<<dir.dot(shDIR)<<">"<<solAnCut<<G4endl; // ^ ^ 887 887 #endif … … 889 889 if(dir.dot(shDIR)>solAnCut && abs(shPDG)>99) // Absorb mesons ^ ^ 890 890 { 891 #ifdef pdebug891 #ifdef debug 892 892 G4cout<<"G4QE::CQ:>H="<<shPDG<<":"<<dir.dot(shDIR)<<">"<<solAnCut<<", P="// ^ ^ 893 893 <<shMOM<<" < 120"<<G4endl; // ^ ^ … … 899 899 EnFlQC+=shQC; 900 900 efCounter++; 901 #ifdef pdebug901 #ifdef debug 902 902 G4int hPDG=curHadr->GetPDGCode(); // Only for gebug printing ^ ^ 903 903 G4LorentzVector h4M = curHadr->Get4Momentum(); // Only for gebug printing^ ^ … … 909 909 G4QHadron* mqHadron = new G4QHadron(curHadr); 910 910 input.push_back(mqHadron); // Fill hadron-copy (del equiv) <...^ ^ 911 #ifdef pdebug911 #ifdef debug 912 912 G4int hPDG=curHadr->GetPDGCode(); // Only for debug printing ^ ^ 913 913 G4LorentzVector h4M = curHadr->Get4Momentum(); // Only for gebug printing ^ ^ … … 918 918 else // DirectFilling of the output vector^ ^ 919 919 { // ^ ^ 920 #ifdef pdebug920 #ifdef debug 921 921 G4int hPDG=curHadr->GetPDGCode(); // Only for gebug printing ^ ^ 922 922 G4LorentzVector h4M = curHadr->Get4Momentum(); // Only for gebug printing ^ ^ … … 937 937 if(noh) for(G4int kh=0; kh<noh; kh++) // One can escape it but... ^ 938 938 { // ^ 939 #ifdef pdebug939 #ifdef debug 940 940 G4cout<<"G4QE::CreateQ:H#"<<kh<<", QC="<<theQHadrons[kh]->GetQC() // ^ 941 941 <<", 4M="<<theQHadrons[kh]->Get4Momentum()<<G4endl; // ^ … … 949 949 } // ^ ^ 950 950 theQHadrons.clear(); // deletedWhenDecayed // Now theQHadrons is EmptyVector->^ ^ 951 #ifdef pdebug951 #ifdef debug 952 952 G4int nInH=intQHadrons.size(); // Resulting #of hadrons after decay ^ 953 953 G4cout<<"G4QE::CrQ:nH="<<nInH<<",C="<<totCharge<<",B="<<totBaryoN<<G4endl;// ^ … … 955 955 if(!(input.size())) // *RETURN* Without Quasmon creation-^ 956 956 { // ^ 957 #ifdef pdebug957 #ifdef debug 958 958 G4cout<<"*G4QEnv::CrQ:AnnihStack tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;//^ 959 959 #endif 960 960 return; // Do not clear and delete objects --^ 961 961 } // ^ 962 #ifdef pdebug962 #ifdef debug 963 963 G4cout<<"G4QE::CrQ:fakeQ, restPars tC="<<totCharge<<",tB="<<totBaryoN<<G4endl;//^ 964 964 #endif … … 967 967 // From this point the new temporary environment is created (multiQuasmon) ^ 968 968 G4QEnvironment* muq = new G4QEnvironment(input,theEnvironment.GetPDG());//<--+ ^ 969 #ifdef pdebug969 #ifdef debug 970 970 G4cout<<"G4QE::CrQ:befCl&Dest tC="<<totCharge<<", tB="<<totBaryoN<<G4endl; //^ ^ 971 971 #endif … … 977 977 delete muq; //=====>===========>==============^ ^ ^ 978 978 noh = outH->size(); // a#of Not Interacting(Q) Hadrons ^ ^ 979 #ifdef pdebug979 #ifdef debug 980 980 G4cout<<"G4QEnv::CreateQ:*** #ofNotInterQH="<<noh<<" is found ***"<<G4endl; // ^ ^ 981 981 #endif 982 982 if(noh) for(G4int nh=0; nh<noh; nh++) // One can escape it but... ^ ^ 983 983 { // ^ ^ 984 #ifdef pdebug984 #ifdef debug 985 985 G4cout<<"G4QE::CreateQ: NotIntQH#"<<nh<<", QC="<<(*outH)[nh]->GetQC() // ^ ^ 986 986 <<", 4M="<<(*outH)[nh]->Get4Momentum()<<G4endl; // ^ ^ … … 996 996 delete outH; // >---->---->---->---->---->---->---^-+ 997 997 G4int nMQ = outQ->size(); // A#ofQuasmons in MultyQuasmonOutput^ 998 #ifdef pdebug998 #ifdef debug 999 999 G4LorentzVector eLorV=theEnvironment.Get4Momentum(); // ^ 1000 1000 G4cout<<"G4QE::CrQ:nMQ="<<nMQ<<",tC="<<totCharge<<", tB="<<totBaryoN<<G4endl;// ^ … … 1005 1005 { // ^ 1006 1006 G4Quasmon* curQ = new G4Quasmon((*outQ)[mh]);// Copy to destroy TMP(?) ^ 1007 #ifdef pdebug1007 #ifdef debug 1008 1008 G4LorentzVector qLorV=curQ->Get4Momentum(); // ^ 1009 1009 G4cout<<"G4QE::CrQ:Q#"<<mh<<",4M="<<qLorV<<curQ->GetQC()<<G4endl; // ^ … … 1015 1015 outQ->clear(); // ^ 1016 1016 delete outQ; // >=================================+ 1017 #ifdef pdebug1017 #ifdef debug 1018 1018 G4int nsHadr = theQHadrons.size(); // Update the value of OUTPUT entries 1019 1019 G4cout<<"G4QEnvironment::CreateQ: before return nH="<<nsHadr<<G4endl; … … 1044 1044 PrepareInteractionProbabilities(EnFlQC,EnFlP); // InteractionProbabilities for clusters 1045 1045 G4int nCandid = theQCandidates.size(); 1046 #ifdef pdebug1046 #ifdef debug 1047 1047 G4cout<<"G4QEnvironment::CrQ: InteractionProbabilities are done, nC="<<nCandid<<G4endl; 1048 1048 #endif … … 1058 1058 if(nCandid==1||maxP==0.) 1059 1059 { 1060 #ifdef pdebug1060 #ifdef debug 1061 1061 G4cout<<"***G4QEnv::CrQ:MaxP=0||nCand=1: Use all Env., Env="<<theEnvironment<<G4endl; 1062 1062 #endif … … 1067 1067 { 1068 1068 G4double totP = maxP * G4UniformRand(); 1069 #ifdef pdebug1069 #ifdef debug 1070 1070 G4cout<<"G4QEnvironment::CrQ:nC="<<nCandid<<", maxP="<<maxP<<", totP="<<totP<<G4endl; 1071 1071 #endif … … 1081 1081 if(pq4M.m()>=clMass) 1082 1082 { 1083 #ifdef pdebug1083 #ifdef debug 1084 1084 G4cout<<"G4QEnv::CQ:#"<<i<<"("<<targClust<<curQC<<") Env="<<theEnvironment<<G4endl; 1085 1085 #endif … … 1092 1092 if(te4M.m()>=teMass) 1093 1093 { 1094 #ifdef pdebug1094 #ifdef debug 1095 1095 G4cout<<"***G4QEnv::CrQ: Deep virtual, use all Env,Env="<<theEnvironment<<G4endl; 1096 1096 #endif … … 1114 1114 q4Mom=G4LorentzVector(0.,0.,0.,tgMass-envMass);// PhotoInteracts with BoundedCluster 1115 1115 valQ=curQC; 1116 #ifdef pdebug1116 #ifdef debug 1117 1117 G4cout<<"G4QE::CrQ:Q="<<q4Mom<<valQ<<"+vg="<<proj4M<<",Env="<<theEnvironment<<G4endl; 1118 1118 #endif … … 1125 1125 q4Mom=proj4M+G4LorentzVector(0.,0.,0.,tgMass-envMass);// PION + BoundCluster 1126 1126 valQ=EnFlQC+curQC; 1127 #ifdef pdebug1127 #ifdef debug 1128 1128 if(projE<mPi)G4cout<<"*VirtualPiM*G4QE::CrQ:Ener(pi-)="<<projE<<"<mPi="<<mPi<<G4endl; 1129 1129 G4cout<<"G4QEnv::CrQ:Q="<<q4Mom<<valQ<<"+pi="<<proj4M<<",E="<<theEnvironment<<G4endl; … … 1138 1138 valQ=EnFlQC; // qc: QUASMON=Projectile 1139 1139 theEnvironment=memEnviron; 1140 #ifdef pdebug1140 #ifdef debug 1141 1141 G4cout<<"G4QEnv::CreQAll: Q="<<q4Mom<<valQ<<", QEnv="<<theEnvironment<<G4endl; 1142 1142 #endif … … 1188 1188 om=(tnM2+rmu2+rt)/dtnM; // Energy of the excited cluster 1189 1189 ep=prE+tnM-om; // Energy of the scattered projectile (epsilon) 1190 #ifdef pdebug1190 #ifdef debug 1191 1191 G4cout<<"G4QEnv::CreQAll: m2="<<tnM2<<" < mu2="<<rmu2<<" < "<<mu2<<"=Max2"<<G4endl; 1192 1192 G4cout<<"G4QEnv::CreQAll: -t="<<rt<<" < "<<tmax<<"=tmax"<<G4endl; … … 1199 1199 G4double om2=om*om; 1200 1200 if(om2<rmu2)G4cout<<"-Warn-G4QEnv::CreQA:(scat w ex)e2="<<om<<" < mu2="<<tnM<<G4endl; 1201 #ifdef pdebug1201 #ifdef debug 1202 1202 G4cout<<"G4QEnv::CreQAll: ct="<<cost<<",pio="<<Pi*po<<",()="<<cost*Pi*po<<G4endl; 1203 1203 G4double ps=std::sqrt(om2-rmu2); // Momentum of the excited cluster (p) … … 1221 1221 G4ThreeVector fp=pfc*vx+pfs*(std::sin(phi)*vy+std::cos(phi)*vz); 1222 1222 G4LorentzVector s4M(fp,ep); 1223 #ifdef pdebug1223 #ifdef debug 1224 1224 G4cout<<"G4QEnv::CreQA:ps="<<po<<"="<<fp.mag()<<",sM="<<prM<<"="<<s4M.m()<<G4endl; 1225 1225 G4cout<<"G4QEnv::CreQA:Ee="<<prE*ep<<" =? "<<(prM2+rt/2-Pi*po*cost)<<G4endl; … … 1227 1227 if(std::fabs(s4M.m()-scM)>.001)G4cout<<"-W-G4QE::CQA:M="<<prM<<"#"<<s4M.m()<<G4endl; 1228 1228 G4LorentzVector c4M=proj4M+G4LorentzVector(0.,0.,0.,tnM)-s4M; 1229 #ifdef pdebug1229 #ifdef debug 1230 1230 G4cout<<"G4QEnv::CreQA: ec="<<om<<" = "<<c4M.e()<<", pc="<<ps<<" = " 1231 1231 <<c4M.rho()<<", mc2="<<rmu2<<" = "<<c4M.m2()<<G4endl; … … 1243 1243 q4Mom=proj4M+G4LorentzVector(0.,0.,0.,tgMass-envMass); // Projectile + BoundCluster 1244 1244 valQ=EnFlQC+curQC; 1245 #ifdef pdebug1245 #ifdef debug 1246 1246 G4cout<<"G4QEnv::CreQAll: Q="<<q4Mom<<valQ<<", QEnv="<<theEnvironment<<G4endl; 1247 1247 #endif … … 1344 1344 // ============================================================== 1345 1345 { 1346 #ifdef pdebug1346 #ifdef debug 1347 1347 G4cout<<"G4QEnvironment::InitClustersVector called with nC="<<maxClust<<G4endl; 1348 1348 #endif … … 1375 1375 static const G4int NUCPDG = 90000000; 1376 1376 static const G4QNucleus vacuum(NUCPDG); 1377 static const G4LorentzVector zeroLV(0.,0.,0.,0.); 1378 //static const G4QContent zeroQC(0,0,0,0,0,0); 1377 1379 static const G4QContent PiQC(0,1,0,1,0,0); 1378 1380 static const G4QContent K0QC(1,0,0,0,0,1); … … 1431 1433 } 1432 1434 #endif 1433 #ifdef pdebug1435 #ifdef debug 1434 1436 G4cout<<"G4QE::HQE:*HADRONIZE Q-ENVIRONMENT="<<theEnvironment<<",nQ="<<nQuasmons<<G4endl; 1435 1437 #endif … … 1437 1439 { 1438 1440 G4int nPDG = theEnvironment.GetPDG(); // PDG code of the residual Nucl.Environ. 1439 #ifdef pdebug1441 #ifdef debug 1440 1442 G4cout<<"G4QE::HQE:***NO QUASMONS***Env="<<nPDG<<theEnvironment.Get4Momentum()<<G4endl; 1441 1443 #endif … … 1519 1521 if(!ast) nlq--; // Reduce nlq if Quasmon decayed ^ 1520 1522 G4int nHadrons = output->size(); // A#of output Hadrons in the Quasmon ^ 1521 #ifdef pdebug1523 #ifdef debug 1522 1524 G4cout<<"G4QEnv::HadrQE: ***Vacuum*** Q#"<<iq<<", nHadr="<<nHadrons<<G4endl; // ^ 1523 1525 #endif … … 1528 1530 //G4QHadron* curH=new G4QHadron(output->operator[](ih));// (Del 7 lines below)^ 1529 1531 G4QHadron* curH = new G4QHadron((*output)[ih]); // (Deleted 7 lines below) ^ 1530 #ifdef pdebug1532 #ifdef debug 1531 1533 G4cout<<"G4QEnv::HadrQE:Vacuum, H#"<<ih<<", QPDG="<<curH->GetQPDG() // ^ 1532 1534 <<",4M="<<curH->Get4Momentum()<<G4endl; // ^ … … 1569 1571 else // "Have a chance to recover" case ^ 1570 1572 { // ^ 1571 #ifdef pdebug1573 #ifdef debug 1572 1574 G4cout<<"***G4QE::HQE:"<<iq<<",n="<<nHadrons<<",Tot="<<totQC<<totQM<<G4endl;//^ 1573 1575 for (G4int kq=0; kq<nQuasmons; kq++) // LOOP over Quasmons for DEBUG PRINTING ^ … … 1616 1618 if(!ast) nlq--; // Reduce nlq if Quasmon decayed ^ ^ 1617 1619 G4int nHadrons=curout->size(); // A#of outputQHadrons in theDecayedQ ^ ^ 1618 #ifdef pdebug1620 #ifdef debug 1619 1621 G4cout<<"G4QEnv::HadrQE:VacuumRecoverQ#"<<iq<<",n="<<nHadrons<<G4endl;//^ ^ 1620 1622 #endif … … 1625 1627 //G4QHadron* curH = new G4QHadron(curout->operator[](ih)); // ^ ^ 1626 1628 G4QHadron* curH = new G4QHadron((*curout)[ih]); // ^ ^ 1627 #ifdef pdebug1629 #ifdef debug 1628 1630 G4cout<<"G4QEnv::HadrQE:Recovered, H#"<<ih<<", QPDG=" // ^ ^ 1629 1631 <<curH->GetQPDG()<<",4M="<<curH->Get4Momentum()<<G4endl; // ^ ^ … … 1823 1825 G4int Qst= pQ->GetStatus(); 1824 1826 sumstat += Qst; 1825 #ifdef pdebug1827 #ifdef debug 1826 1828 G4cout<<"G4QEnv::HadrQE:#"<<iq<<", Qst="<<Qst<<", Q="<<Q4M<<Q4M.m()<<QQC<<", Env=" 1827 <<theEnvironment<<G4endl; 1828 #endif 1829 <<theEnvironment<<",nQ="<<nQuasmons<<G4endl; 1830 #endif 1831 if(nQuasmons>1 && iq+1==nQuasmons && !Qst && Q4M==zeroLV) 1832 { 1833 theQuasmons.pop_back(); // Exclude the zero-Quasmon 1834 delete pQ; // and delet it 1835 nQuasmons--; 1836 } 1829 1837 if(Qst==1||Qst==3||Qst==4) 1830 1838 { … … 1862 1870 // === Now we should be prepared for evaporation === 1863 1871 G4int totChg=totQC.GetCharge(); // Total Electric Charge of the Total System 1864 #ifdef pdebug1872 #ifdef debug 1865 1873 if(totPDG==90999999||totPDG==90999000||totPDG==90000999||totPDG==89999001) 1866 1874 G4cout<<"***G4QEnv::HadrQEnv: Meson (1) PDG="<<totPDG<<", M="<<tot4M.m()<<G4endl; … … 1899 1907 G4Quasmon* pQ = theQuasmons[jq];// Pointer to the CurrentQuasmon <--<--<--+ 1900 1908 G4int status = pQ->GetStatus();// Old status of the Quasmon ^ 1901 #ifdef pdebug1909 #ifdef debug 1902 1910 G4cout<<"G4QE::HQE:Status of Q#"<<jq<<" (before Fragment)="<<status<<G4endl;//^ 1903 1911 #endif … … 1907 1915 if(nQuas==1&&first) nQuas=-nQuas; 1908 1916 G4QHadronVector* output=pQ->Fragment(theEnvironment,nQuas);//<DESTRUCT<--<--^-+ 1909 #ifdef pdebug1917 #ifdef debug 1910 1918 G4cout<<"G4QE::HQE:Q#"<<jq<<",*afterFragm* Env="<<theEnvironment<<G4endl;// ^ ^ 1911 1919 #endif … … 1979 1987 G4double hKE=0.; // Kinetic Energy of the Hadron ^ ^ 1980 1988 G4LorentzVector hLV=inpH->Get4Momentum(); // ^ ^ 1981 #ifdef pdebug1989 #ifdef debug 1982 1990 G4cout<<"G4QEnv::HadrQE:H#"<<ih<<", hC="<<hC<<",hF="<<hF<<",4M=" // ^ ^ 1983 1991 <<hLV<<inpH->GetPDGCode()<<G4endl; // ^ ^ … … 1997 2005 G4LorentzVector tLV=hLV+pQ->Get4Momentum();// ^ ^ 1998 2006 pQ->InitQuasmon(tQC,tLV); // Reinitialize the current Quasmon ^ ^ 1999 #ifdef pdebug2007 #ifdef debug 2000 2008 G4cout<<"G4QE::HQE:Medium, H#"<<ih<<", QPDG="<<inpH->GetQPDG() // ^ ^ 2001 2009 <<",4M="<<inpH->Get4Momentum()<<" is suckedInQ"<<G4endl; // ^ ^ … … 2007 2015 G4LorentzVector tLV=hLV+theEnvironment.Get4Momentum(); // ^ ^ 2008 2016 theEnvironment=G4QNucleus(tQC,tLV); // Reinit currentEnvironment ^ ^ 2009 #ifdef pdebug2017 #ifdef debug 2010 2018 G4cout<<"G4QE::HQE:Med,H#"<<ih<<",PDG="<<inpH->GetQPDG()<<",4M="//^ ^ 2011 2019 <<inpH->Get4Momentum()<<" is suckedInEnvironment"<<G4endl;//^ ^ … … 2016 2024 { // ^ ^ 2017 2025 G4QHadron* curH = new G4QHadron(inpH); // ^ ^ 2018 #ifdef pdebug2026 #ifdef debug 2019 2027 G4LorentzVector ph4M=curH->Get4Momentum(); // 4-mom of the hadron ^ ^ 2020 2028 G4double phX=ph4M.x(); // p_x of the hadron ^ ^ … … 2039 2047 else if(status<0||status==2) // => "PANIC or NOTHING was done" case ^ 2040 2048 { // ^ 2041 #ifdef pdebug2049 #ifdef debug 2042 2050 G4cout<<"G4QE::HQE:***PANIC***,status="<<status<<",nC="<<nCount<<G4endl; // ^ 2043 2051 #endif … … 2063 2071 else if(status==2 && eCount==1 && cAN<mcAN && envM>500.)// Add N from E to Q^ 2064 2072 { // ^ 2065 #ifdef pdebug2073 #ifdef debug 2066 2074 G4cout<<"G4QE::HQE:E="<<theEnvironment<<",M="<<envM<<",c="<<cAN<<G4endl;//^ 2067 2075 #endif … … 2078 2086 nucQC=protQC; // proton QContent ^ 2079 2087 } // ^ 2080 #ifdef pdebug2088 #ifdef debug 2081 2089 G4cout<<"G4QE::HQE:P,eZ="<<envZ<<",eN="<<envN<<",rPDG="<<resPDG<<G4endl;//^ 2082 2090 #endif … … 2094 2102 theEnvironment=G4QNucleus(res4M,resPDG);// Update the Environment ^ 2095 2103 theQuasmons[0]->IncreaseBy(nucQC,nuc4M);// Update the Only Quasmon ^ 2096 #ifdef pdebug2104 #ifdef debug 2097 2105 G4cout<<"G4QE::HQE:P,Q="<<nucQC<<nuc4M<<",env="<<theEnvironment<<G4endl;//^ 2098 2106 #endif … … 2100 2108 else if(status==2&&nCount>nCnMax)// Treat PANIC for stat=2 (NothingWasDone) ^ 2101 2109 { // ^ 2102 #ifdef pdebug2110 #ifdef debug 2103 2111 G4cout<<"G4QE::HQE:PANIC,nC="<<nCount<<">"<<nCnMax<<G4endl; // ^ 2104 2112 #endif … … 2257 2265 G4QHadron* h1H = new G4QHadron(h1QPDG.GetPDGCode(),h14M); // ^ 2258 2266 theQHadrons.push_back(h1H); // (delete equivalent) ^ 2259 #ifdef pdebug2267 #ifdef debug 2260 2268 G4cout<<"G4QE::HQE:(1) H1="<<h1QPDG<<h14M<<G4endl; // ^ 2261 2269 #endif 2262 2270 G4QHadron* h2H = new G4QHadron(h2QPDG.GetPDGCode(),h24M); // ^ 2263 2271 theQHadrons.push_back(h2H); // (delete equivalent) ^ 2264 #ifdef pdebug2272 #ifdef debug 2265 2273 G4cout<<"G4QE::HQE:(1) H2="<<h2QPDG<<h24M<<G4endl; // ^ 2266 2274 #endif 2267 2275 G4QHadron* qeH = new G4QHadron(envPDG,e4M); // ^ 2268 2276 theQHadrons.push_back(qeH); // (delete equivalent) ^ 2269 #ifdef pdebug2277 #ifdef debug 2270 2278 G4cout<<"G4QE::HQE:(1) QEnv="<<envPDG<<e4M<<G4endl; // ^ 2271 2279 #endif … … 2313 2321 G4QHadron* qH = new G4QHadron(qPDG,fq4M);// the out going Quasmon ^ 2314 2322 theQHadrons.push_back(qH); // (delete equivalent) ^ 2315 #ifdef pdebug2323 #ifdef debug 2316 2324 G4cout<<"G4QE::HQE:QuasmH="<<qPDG<<fq4M<<G4endl; // ^ 2317 2325 #endif 2318 2326 G4QHadron* qeH = new G4QHadron(envPDG,qe4M);//theRecoilEnvironment^ 2319 #ifdef pdebug2327 #ifdef debug 2320 2328 G4cout<<"G4QE::HQE:EnvironH="<<envPDG<<qe4M<<G4endl; // ^ 2321 2329 #endif … … 2381 2389 G4QHadron* h1H = new G4QHadron(h1QPDG.GetPDGCode(),h14M); // ^ 2382 2390 theQHadrons.push_back(h1H); // (delete equivalent) ^ 2383 #ifdef pdebug2391 #ifdef debug 2384 2392 G4cout<<"G4QE::HQE: QCip-> H1="<<h1QPDG<<h14M<<G4endl; // ^ 2385 2393 #endif 2386 2394 G4QHadron* h2H = new G4QHadron(h2QPDG.GetPDGCode(),h24M); // ^ 2387 2395 theQHadrons.push_back(h2H); // (delete equivalent) ^ 2388 #ifdef pdebug2396 #ifdef debug 2389 2397 G4cout<<"G4QE::HQE: QChip->H2="<<h2QPDG<<h24M<<G4endl; // ^ 2390 2398 #endif … … 2497 2505 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // ^ 2498 2506 theQHadrons.push_back(hadr); // Cor or fill as It Is ^ 2499 #ifdef pdebug2507 #ifdef debug 2500 2508 G4cout<<"-Warn-G4QE::HQE:Sig,QC="<<totQC<<",4M="<<tot4M<<G4endl;//^ 2501 2509 #endif … … 2505 2513 return theQHadrons; // ^ 2506 2514 } // ^ 2507 #ifdef pdebug2515 #ifdef debug 2508 2516 G4cout<<"G4QEnv::HadronizeQEnv: Sigma="<<PDGQ<<cq4M<<" -> Hyperon="// ^ 2509 2517 <<hyPDG<<b4Mom<<" + Gamma/Pi="<<pigPDG<<m4Mom<<G4endl; // ^ … … 2565 2573 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // ^ 2566 2574 theQHadrons.push_back(hadr); // Cor or fill as It Is ^ 2567 #ifdef pdebug2575 #ifdef debug 2568 2576 G4cout<<"-Warn-G4QE::HQE:Sig,QC="<<totQC<<",4M="<<tot4M<<G4endl;//^ 2569 2577 #endif … … 2573 2581 return theQHadrons; // ^ 2574 2582 } // ^ 2575 #ifdef pdebug2583 #ifdef debug 2576 2584 G4cout<<"G4QEnv::HadronizeQEnv: NSigma="<<PDGQ<<cq4M<<"-> Sigma/dN="//^ 2577 2585 <<hyPDG<<b4Mom<<" + N/Pi="<<pigPDG<<m4Mom<<G4endl; // ^ … … 2640 2648 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // ^ 2641 2649 theQHadrons.push_back(hadr); // Cor or fill as It Is ^ 2642 #ifdef pdebug2650 #ifdef debug 2643 2651 G4cout<<"-Warn-G4QE::HQE:Sig,QC="<<totQC<<",4M="<<tot4M<<G4endl;//^ 2644 2652 #endif … … 2648 2656 return theQHadrons; // ^ 2649 2657 } // ^ 2650 #ifdef pdebug2658 #ifdef debug 2651 2659 G4cout<<"G4QEnv::HadronizeQEnv:2NSigma="<<PDGQ<<cq4M<<"-> Sigma/Pi="//^ 2652 2660 <<hyPDG<<b4Mom<<" + 2N/3N="<<pigPDG<<m4Mom<<dinFlag<<G4endl; // ^ … … 2680 2688 { // ^ 2681 2689 G4QHadron* resQ = new G4QHadron(PDGQ,cq4M); // GSM hadron for CurQ ^ 2682 #ifdef pdebug2690 #ifdef debug 2683 2691 G4cout<<"G4QEnv::HadrQEnv:ResQ="<<PDGQ<<cq4M<<G4endl; // ^ 2684 2692 #endif … … 2824 2832 delete output; // >================================|=====^ 2825 2833 } // End of skip of the dead Quasmons | 2826 #ifdef pdebug2834 #ifdef debug 2827 2835 G4cout<<"G4QE::HQE:QStat("<<jq<<"="<<status<<pQ->Get4Momentum()<<G4endl;//| 2828 2836 #endif … … 2904 2912 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 2905 2913 theQHadrons.push_back(hadr); // Cor or fill as It Is 2906 #ifdef pdebug2914 #ifdef debug 2907 2915 G4cout<<"***G4QE::HQE:FillAsIs(-4),QC="<<totQC<<",4M="<<tot4M<<G4endl; 2908 2916 #endif … … 2932 2940 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 2933 2941 theQHadrons.push_back(hadr); // Cor or fill as It Is 2934 #ifdef pdebug2942 #ifdef debug 2935 2943 G4cout<<"***G4QE::HQE:FillAsIs(-3),QC="<<totQC<<",4M="<<tot4M<<G4endl; 2936 2944 #endif … … 2940 2948 return theQHadrons; 2941 2949 } 2942 #ifdef pdebug2950 #ifdef debug 2943 2951 G4cout<<"G4QEnv::HadronizeQEnv: DELTA="<<totPDG<<tot4M<<" -> Bar=" 2944 2952 <<bPDG<<b4Mom<<" + Mes="<<mPDG<<m4Mom<<G4endl; … … 2978 2986 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 2979 2987 theQHadrons.push_back(hadr); // Cor or fill as It Is 2980 #ifdef pdebug2988 #ifdef debug 2981 2989 G4cout<<"***G4QE::HQE:FillAsIs(-2),QC="<<totQC<<",4M="<<tot4M<<G4endl; 2982 2990 #endif … … 2986 2994 return theQHadrons; 2987 2995 } 2988 #ifdef pdebug2996 #ifdef debug 2989 2997 G4cout<<"G4QEnv::HadronizeQEnv: Chipo="<<tot4M<<" -> h1=" 2990 2998 <<h1PDG<<h14Mom<<" + Mes="<<h2PDG<<h24Mom<<G4endl; … … 3016 3024 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3017 3025 theQHadrons.push_back(hadr); // Cor or fill as It Is 3018 #ifdef pdebug3026 #ifdef debug 3019 3027 G4cout<<"***G4QE::HQE:FillAsIs(-1),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3020 3028 #endif … … 3024 3032 return theQHadrons; 3025 3033 } 3026 #ifdef pdebug3034 #ifdef debug 3027 3035 G4cout<<"G4QE::HQE:"<<tot4M<<"->h="<<totPDG<<h4Mom<<" + gamma="<<g4Mom<<G4endl; 3028 3036 #endif … … 3080 3088 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3081 3089 theQHadrons.push_back(hadr); // Cor or fill as It Is 3082 #ifdef pdebug3090 #ifdef debug 3083 3091 G4cout<<"***G4QE::HQE:FillAsIs(0),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3084 3092 #endif … … 3088 3096 return theQHadrons; 3089 3097 } 3090 #ifdef pdebug3098 #ifdef debug 3091 3099 G4cout<<"G4QE::HQE:"<<tot4M<<"->h="<<mbPDG<<h4Mom<<"+p="<<piPDG<<g4Mom<<G4endl; 3092 3100 #endif … … 3115 3123 for (G4int ih=0; ih<nHadrons; ih++)// LOOP over output QHadrons ^ 3116 3124 { // ^ 3117 #ifdef pdebug3125 #ifdef debug 3118 3126 G4cout<<"G4QEnv::HadrQE:NewB<2, H#"<<ih // ^ 3119 3127 <<", QPDG="<<(*curout)[ih]->GetQPDG() // ^ … … 3278 3286 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3279 3287 theQHadrons.push_back(hadr); // Cor or fill as It Is 3280 #ifdef pdebug3288 #ifdef debug 3281 3289 G4cout<<"***G4QEnv::HQE:FillAsItIs(1),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3282 3290 #endif … … 3286 3294 return theQHadrons; 3287 3295 } 3288 #ifdef pdebug3296 #ifdef debug 3289 3297 G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> M=" 3290 3298 <<aKPDG<<m4Mom<<" + N="<<totPDG<<n4Mom<<totQC<<G4endl; … … 3315 3323 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3316 3324 theQHadrons.push_back(hadr); // Cor or fill as It Is 3317 #ifdef pdebug3325 #ifdef debug 3318 3326 G4cout<<"***G4QEnv::HQE:FillAsItIs(2),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3319 3327 #endif … … 3332 3340 { 3333 3341 G4QHadron* curP = new G4QHadron(PiPDG,onePi); 3334 #ifdef pdebug3342 #ifdef debug 3335 3343 G4cout<<"G4QEnv::HadrQEnv:SPion#"<<ip<<",H="<<PiPDG<<onePi<<G4endl; 3336 3344 #endif … … 3342 3350 { 3343 3351 G4QHadron* curP = new G4QHadron(aKPDG,oneK); 3344 #ifdef pdebug3352 #ifdef debug 3345 3353 G4cout<<"G4QEnv::HadrQEnv:Kaon#"<<jp<<",H="<<aKPDG<<oneK<<G4endl; 3346 3354 #endif … … 3376 3384 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3377 3385 theQHadrons.push_back(hadr); // Cor or fill as It Is 3378 #ifdef pdebug3386 #ifdef debug 3379 3387 G4cout<<"***G4QEnv::HQE:FillAsItIs(2),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3380 3388 #endif … … 3384 3392 return theQHadrons; 3385 3393 } 3386 #ifdef pdebug3394 #ifdef debug 3387 3395 G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> Sig=" 3388 3396 <<SiPDG<<m4Mom<<" + N="<<totPDG<<n4Mom<<totQC<<G4endl; … … 3413 3421 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3414 3422 theQHadrons.push_back(hadr); // Cor or fill as It Is 3415 #ifdef pdebug3423 #ifdef debug 3416 3424 G4cout<<"***G4QEnv::HQE:FillAsItIs(3),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3417 3425 #endif … … 3430 3438 { 3431 3439 G4QHadron* curP = new G4QHadron(PiPDG,onePi); 3432 #ifdef pdebug3440 #ifdef debug 3433 3441 G4cout<<"G4QEnv::HadrQEnv:SPion#"<<ip<<",H="<<PiPDG<<onePi<<G4endl; 3434 3442 #endif … … 3440 3448 { 3441 3449 G4QHadron* curP = new G4QHadron(SiPDG,oneS); 3442 #ifdef pdebug3450 #ifdef debug 3443 3451 G4cout<<"G4QEnv::HadrQEnv:Sigma#"<<jp<<",H="<<SiPDG<<oneS<<G4endl; 3444 3452 #endif … … 3466 3474 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3467 3475 theQHadrons.push_back(hadr); // Cor or fill as It Is 3468 #ifdef pdebug3476 #ifdef debug 3469 3477 G4cout<<"***G4QEnv::HQE:FillAsItIs(5),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3470 3478 #endif … … 3474 3482 return theQHadrons; 3475 3483 } 3476 #ifdef pdebug3484 #ifdef debug 3477 3485 G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> M="<<PiPDG<<m4Mom<<" + N=" 3478 3486 <<totPDG<<n4Mom<<totQC<<G4endl; … … 3503 3511 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3504 3512 theQHadrons.push_back(hadr); // Cor or fill as It Is 3505 #ifdef pdebug3513 #ifdef debug 3506 3514 G4cout<<"***G4QEnv::HQE:FillAsItIs(5),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3507 3515 #endif … … 3511 3519 return theQHadrons; 3512 3520 } 3513 #ifdef pdebug3521 #ifdef debug 3514 3522 G4cout<<"G4QEnv::HadronizeQEnv: SN="<<tot4M<<" -> N*PI="<<PiPDG 3515 3523 <<" (4M1="<<m4Mom<<" + 4M2="<<k4Mom<<") + N="<<totPDG<<n4Mom<<G4endl; … … 3543 3551 return theQHadrons; 3544 3552 } 3545 else // ==> "Only GSEnvironment exists" case3553 else // ==> "Only with GSEnvironment" case 3546 3554 { 3547 3555 if(totPDG==90000000 || fabs(totMass)<0.000001) … … 3551 3559 } 3552 3560 G4double dM=totMass-totM; 3553 #ifdef pdebug3561 #ifdef debug 3554 3562 G4cout<<"G4QEnv::HadrQEnv:GroundState tM-GSM="<<dM<<",GSM="<<totM<<",tPDG="<<totPDG 3555 3563 <<",nQ="<<nQuasmons<<G4endl; 3556 3564 #endif 3557 3565 G4Quasmon* pQ = theQuasmons[0]; // Pointer to the first Quasmon 3558 G4QPDGCode QQPDG = pQ->GetQPDG(); // QPDG of the Quasmon3566 G4QPDGCode QQPDG = pQ->GetQPDG(); // QPDG of the first Quasmon 3559 3567 G4int QPDG = QQPDG.GetPDGCode(); 3560 3568 G4QNucleus totRN(totQC,tot4M); // Nucleus for theTotalResidualNuclearComp … … 3572 3580 { 3573 3581 G4int envPDG = theEnvironment.GetPDG();// PDGCode of the NuclQEnvironment 3574 #ifdef pdebug3582 #ifdef debug 3575 3583 G4cout<<"G4QEnv::HadrQEnv: nQ=1, QPDG=="<<QPDG<<G4endl; 3576 3584 #endif … … 3669 3677 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3670 3678 theQHadrons.push_back(hadr); // Cor or fill as It Is 3671 #ifdef pdebug3679 #ifdef debug 3672 3680 G4cout<<"***G4QEnv::HQE:FillAsItIs(6),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3673 3681 #endif … … 3680 3688 G4QHadron* h1H = new G4QHadron(h1QPDG.GetPDGCode(),h14M); 3681 3689 theQHadrons.push_back(h1H); // (delete equivalent) 3682 #ifdef pdebug3690 #ifdef debug 3683 3691 G4cout<<"G4QE::HQE:(2) H1="<<h1QPDG<<h14M<<G4endl; 3684 3692 #endif 3685 3693 G4QHadron* h2H = new G4QHadron(h2QPDG.GetPDGCode(),h24M); 3686 3694 theQHadrons.push_back(h2H); // (delete equivalent) 3687 #ifdef pdebug3695 #ifdef debug 3688 3696 G4cout<<"G4QE::HQE:(2) H2-"<<h2QPDG<<h24M<<G4endl; 3689 3697 #endif 3690 3698 G4QHadron* qeH = new G4QHadron(envPDG,e4M); 3691 3699 theQHadrons.push_back(qeH); // (delete equivalent) 3692 #ifdef pdebug3700 #ifdef debug 3693 3701 G4cout<<"G4QE::HQE:(2) QEenv="<<envPDG<<e4M<<G4endl; 3694 3702 #endif … … 3701 3709 CleanUp(); 3702 3710 G4QHadron* evH = new G4QHadron(totQC,tot4M);// Create a Hadron for ResidualNucl 3703 EvaporateResidual(evH); // Try to evaporate residual (del. equiv.)3711 EvaporateResidual(evH); // Try to evaporate residual (del. equiv.) 3704 3712 return theQHadrons; 3713 } 3714 else // No environment 3715 { 3716 G4int nHadrs=theQHadrons.size(); // #of available hadrons 3717 for(G4int ih=0; ih<nHadrs; ++ih) 3718 { 3719 G4QHadron* ch=theQHadrons[ih]; 3720 G4LorentzVector ch4M=ch->Get4Momentum(); 3721 G4double chM=ch4M.m(); 3722 G4LorentzVector tch4M=ch4M+tot4M; 3723 if(tch4M.m() > chM + totM) // Can be corrected 3724 { 3725 G4LorentzVector h14M(0.,0.,0.,chM); 3726 G4LorentzVector h24M(0.,0.,0.,totM); 3727 if(!G4QHadron(tch4M).DecayIn2(h14M,h24M)) 3728 { 3729 G4cout<<"-Warning->G4QE::HQE:M="<<tch4M.m()<<"->"<<chM<<"+"<<totM<<"=" 3730 <<chM+totM<<G4endl; 3731 } 3732 else 3733 { 3734 tot4M=h24M; // Change the residual 4M 3735 ch->Set4Momentum(h14M); // Change 4M of the current hadron 3736 break; // Quit the loop 3737 } 3738 } 3739 } 3740 G4QHadron* rH = new G4QHadron(totQC,tot4M);// Create a Hadron for ResidualNucl 3741 theQHadrons.push_back(rH); 3705 3742 } 3706 3743 } … … 3718 3755 else if(2>3) // "Try to correct" case (change condition) 3719 3756 { 3720 #ifdef pdebug3757 #ifdef debug 3721 3758 G4cout<<"***G4QEnv::HadrQE: M="<<totMass<<",dM="<<dM<<",nQ="<<nQuasmons<<G4endl; 3722 3759 #endif … … 3792 3829 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3793 3830 theQHadrons.push_back(hadr); // Cor or fill as It Is 3794 #ifdef pdebug3831 #ifdef debug 3795 3832 G4cout<<"***G4QE::HQE:FillAsIs(7),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3796 3833 #endif … … 3801 3838 } 3802 3839 G4QHadron* H1 = new G4QHadron(PDG1,fq4M); 3803 #ifdef pdebug3840 #ifdef debug 3804 3841 G4cout<<"G4QE::HQE:Kaon(Env)="<<PDG1<<fq4M<<G4endl; 3805 3842 #endif 3806 3843 theQHadrons.push_back(H1); // (delete equivalent) 3807 3844 G4QHadron* H2 = new G4QHadron(PDG2,qe4M); 3808 #ifdef pdebug3845 #ifdef debug 3809 3846 G4cout<<"G4QE::HQE:ResidEnv="<<PDG2<<qe4M<<G4endl; 3810 3847 #endif … … 3856 3893 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3857 3894 theQHadrons.push_back(hadr); // Cor or fill as It Is 3858 #ifdef pdebug3895 #ifdef debug 3859 3896 G4cout<<"***G4QE::HQE:FillAsIs(8),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3860 3897 #endif … … 3866 3903 G4QHadron* H1 = new G4QHadron(PDG1,k14M); 3867 3904 theQHadrons.push_back(H1); // (delete equivalent) 3868 #ifdef pdebug3905 #ifdef debug 3869 3906 G4cout<<"G4QE::HQE:K1(Env)="<<PDG1<<k14M<<G4endl; 3870 3907 #endif 3871 3908 G4QHadron* H2 = new G4QHadron(PDG2,k24M); 3872 3909 theQHadrons.push_back(H2); // (delete equivalent) 3873 #ifdef pdebug3910 #ifdef debug 3874 3911 G4cout<<"G4QE::HQE:K2(Env)="<<PDG2<<k24M<<G4endl; 3875 3912 #endif 3876 3913 G4QHadron* H3 = new G4QHadron(PDG3,ra4M); 3877 3914 theQHadrons.push_back(H3); // (delete equivalent) 3878 #ifdef pdebug3915 #ifdef debug 3879 3916 G4cout<<"G4QE::HQE:ResKKEnv="<<PDG3<<ra4M<<G4endl; 3880 3917 #endif … … 3924 3961 G4QHadron* hadr = new G4QHadron(totQC,tot4M); // totQC not tQC! 3925 3962 theQHadrons.push_back(hadr); // Cor or fill as It Is 3926 #ifdef pdebug3963 #ifdef debug 3927 3964 G4cout<<"***G4QE::HQE:FillAsIs(9),QC="<<totQC<<",4M="<<tot4M<<G4endl; 3928 3965 #endif … … 3934 3971 G4QHadron* H1 = new G4QHadron(PDG1,fq4M); 3935 3972 theQHadrons.push_back(H1); // (delete equivalent) 3936 #ifdef pdebug3973 #ifdef debug 3937 3974 G4cout<<"G4QE::HQE:h1="<<PDG1<<fq4M<<G4endl; 3938 3975 #endif 3939 3976 G4QHadron* H2 = new G4QHadron(PDG2,qe4M); 3940 #ifdef pdebug3977 #ifdef debug 3941 3978 G4cout<<"G4QE::HQE:h2="<<PDG2<<qe4M<<G4endl; 3942 3979 #endif … … 3978 4015 else // "Last decay was fatal" case @@ buggy ?MK 3979 4016 { 3980 #ifdef pdebug4017 #ifdef debug 3981 4018 G4cout<<"***G4QEnv::HadrQE: M="<<totMass<<",dM="<<dM<<",nQ="<<nQuasmons<<G4endl; 3982 4019 #endif … … 3986 4023 { 3987 4024 G4QHadron* hadr = new G4QHadron(totQC,tot4M); 3988 #ifdef pdebug4025 #ifdef debug 3989 4026 G4cout<<"G4QE::HQE:CheckGS failed H="<<totQC<<tot4M<<G4endl; 3990 4027 #endif … … 4027 4064 G4QContent theQC = qH->GetQC(); // Quark Content of the hadron 4028 4065 G4int theS=theQC.GetStrangeness(); // S (Strangeness of the nucleus) 4029 #ifdef pdebug4066 #ifdef debug 4030 4067 G4cout<<"G4QE::EvaporateRes:Called for PDG="<<thePDG<<",4M="<<qH->Get4Momentum()<<G4endl; 4031 4068 #endif 4032 4069 if(theS<0) // Antistrange nucleus 4033 4070 { 4034 #ifdef pdebug4071 #ifdef debug 4035 4072 G4cout<<"G4QE::EvaporateRes: AntistrangeNucleus="<<thePDG<<qH->Get4Momentum()<<G4endl; 4036 4073 #endif … … 4040 4077 else if(theBN==1) 4041 4078 { 4042 #ifdef pdebug4079 #ifdef debug 4043 4080 G4cout<<"G4QE::EvaporateRes: Baryon="<<thePDG<<qH->Get4Momentum()<<G4endl; 4044 4081 #endif … … 4048 4085 else if(!theBN) // @@ In future it is usefull to add the MesonExcitationDecay (?!) 4049 4086 { 4050 #ifdef pdebug4087 #ifdef debug 4051 4088 G4LorentzVector mesLV=qH->Get4Momentum(); 4052 4089 G4cout<<"G4QE::EvaporateRes:(!)Meson(!) PDG="<<thePDG<<",4M="<<mesLV<<mesLV.m() … … 4090 4127 else // Correction must be done 4091 4128 { 4092 #ifdef pdebug4129 #ifdef debug 4093 4130 G4cout<<"G4QE::EvaRes: *Correct* "<<theQC<<q4M<<totMass<<"<"<<totGSM<<G4endl; 4094 4131 #endif … … 4096 4133 if(!CheckGroundState(quasH,true)) 4097 4134 { 4098 #ifdef pdebug4135 #ifdef debug 4099 4136 G4cout<<"***G4QE::EvaporResid:GSCorFailed.FillAsItIs,n="<<theQHadrons.size()<<G4endl; 4100 4137 #endif … … 4116 4153 if (qH) 4117 4154 { 4118 G4cout<<"G4QEnvironment::EvaporateResidual: deleted at end, PDG=" 4119 <<qH->GetPDGCode()<<G4endl; 4155 G4cout<<"G4QEnvironment::EvaporateResidual:EndDeleted, PDG="<<qH->GetPDGCode()<<G4endl; 4120 4156 delete qH; 4121 4157 } … … 4326 4362 static const G4double mSigM= G4QPDGCode(3112).GetMass(); 4327 4363 static const G4double mSigP= G4QPDGCode(3222).GetMass(); 4328 #ifdef pdebug 4364 static const G4double mXiZ = G4QPDGCode(3322).GetMass(); 4365 static const G4double mXiM = G4QPDGCode(3312).GetMass(); 4366 #ifdef debug 4329 4367 static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0); 4330 4368 #endif … … 4346 4384 static const G4double mK0mN = mK0+mNeut; 4347 4385 static const G4QNucleus vacuum(90000000); 4348 static const G4double eps=0.00 5;4386 static const G4double eps=0.003; 4349 4387 ///////////////static const G4double third=1./3.; 4350 4388 ///////////////static const G4double nPDG=90000001; … … 4454 4492 } 4455 4493 G4int lHadr=theQHadrons[nHadr-1]->GetBaryonNumber(); 4456 #ifdef pdebug4494 #ifdef debug 4457 4495 G4cout<<"G4QE::FSI:after HQE,nH="<<nHadr<<",lHBN="<<lHadr<<",E="<<theEnvironment<<G4endl; 4458 4496 #endif … … 4465 4503 G4int lhPDG=curHadr->GetPDGCode(); // PDG code of the last fragment 4466 4504 G4double lhGSM=G4QPDGCode(lhPDG).GetMass(); // GroundStateMass of the last fragment 4467 #ifdef pdebug4505 #ifdef debug 4468 4506 G4cout<<"G4QE::FSI:lastHadr 4M/M="<<lh4M<<lhM<<",GSM="<<lhGSM<<",PDG="<<lhPDG<<G4endl; 4469 4507 #endif … … 4474 4512 EvaporateResidual(curHadr); // Try to evaporate Hadr-Nucl (@@DecDib)(delete eq.) 4475 4513 nHadr=theQHadrons.size(); 4476 #ifdef pdebug4514 #ifdef debug 4477 4515 G4cout<<"G4QE::FSI:After nH="<<nHadr<<",PDG="<<curHadr->GetPDGCode()<<G4endl; 4478 4516 #endif … … 4485 4523 if(!CheckGroundState(quasH,true))// Try to correct with other hadrons 4486 4524 { 4487 #ifdef pdebug4525 #ifdef debug 4488 4526 // M.K. Fake complain in the low energy nHe/pHe reactions, while everything is OK 4489 4527 G4cout<<"---Warning---G4QEnv::FSI:Correction error LeaveAsItIs h4m="<<lh4M<<G4endl; … … 4501 4539 else delete curHadr; // ==> Leave the nucleus as it is (close to the GSM) 4502 4540 } 4503 #ifdef pdebug4541 #ifdef debug 4504 4542 G4LorentzVector ccs4M(0.,0.,0.,0.); // CurrentControlSum of outgoing Hadrons 4505 4543 #endif … … 4541 4579 G4int hPDG = theCurr->GetPDGCode(); 4542 4580 G4LorentzVector h4Mom = theCurr->Get4Momentum(); 4543 #ifdef pdebug4581 #ifdef debug 4544 4582 G4int hNF = theCurr->GetNFragments(); 4545 4583 G4cout<<"G4QE::FSI:h#"<<ipo<<",PDG="<<hPDG<<h4Mom<<",mGS="<<G4QPDGCode(hPDG).GetMass() … … 4570 4608 if(hPDG==89002000||hPDG==89001001||hPDG==89000002)// 2pt dec. of anti-strange (3pt dec) 4571 4609 { 4572 #ifdef pdebug4610 #ifdef debug 4573 4611 G4cout<<"G4QE::FSI:***ANTISTRANGE*** i="<<ipo<<",PDG="<<hPDG<<",BaryN="<<hBN<<G4endl; 4574 4612 #endif … … 4594 4632 else if(hMi>mProt+mPi) // @@ Does not conserve strangeness (Week decay) 4595 4633 { 4596 #ifdef pdebug4634 #ifdef debug 4597 4635 G4cout<<"**G4QE::FSI:ANTISTRANGE*++*STRANGENESS,PDG="<<hPDG<<",M="<<hM<<G4endl; 4598 4636 #endif … … 4643 4681 else if(hMi>mProt+mPi0) // @@ Does not conserve strangeness (Week decay) 4644 4682 { 4645 #ifdef pdebug4683 #ifdef debug 4646 4684 G4cout<<"**G4QE::FSI:*ANTISTRANGE*+*STRANGENESS*PDG="<<hPDG<<",M="<<hM<<G4endl; 4647 4685 #endif … … 4680 4718 else if(hMi>mProt+mPi) // @@ Does not conserve strangeness (Week decay) 4681 4719 { 4682 #ifdef pdebug4720 #ifdef debug 4683 4721 G4cout<<"**G4QE::FSI:**ANTISTRANGE*0*STRANGENE**PDG="<<hPDG<<",M="<<hM<<G4endl; 4684 4722 #endif … … 4693 4731 if(!sPDG) 4694 4732 { 4695 #ifdef pdebug4733 #ifdef debug 4696 4734 G4cout<<"***G4QE::FSI:***ANTISTRANGE***CANN'T DECAY,PDG="<<hPDG<<",M="<<hM<<G4endl; 4697 4735 #endif … … 4832 4870 hPDG==90999002||hPDG==91001999) // "3-particles decays of dibaryons and 3N" 4833 4871 { 4834 #ifdef pdebug4872 #ifdef debug 4835 4873 G4cout<<"G4QE::FSI:***nD-/pD++/nnn/ppp***i="<<ipo<<",PDG="<<hPDG<<",A="<<hBN<<G4endl; 4836 4874 #endif … … 4954 4992 if(hM<sum || !G4QHadron(h4Mom).DecayIn3(nu4M,ba4M,pi4M)) 4955 4993 { 4956 #ifdef pdebug4994 #ifdef debug 4957 4995 G4int eA=theEnvironment.GetA(); 4958 4996 G4cout<<"***G4QEnv::FSI:T="<<hPDG<<"("<<hM<<")-> N="<<nuQPDG<<"(M="<<nucM<<") + B=" … … 4963 5001 G4QHadron* theLast = theCurr; // Prototype of the pointer to theLastHadron 4964 5002 G4QHadron* qH = new G4QHadron(theCurr); // Copy of the Current Hadron 4965 #ifdef pdebug5003 #ifdef debug 4966 5004 G4cout<<"***G4QE::FSI:#"<<ipo<<",4MQC="<<qH->Get4Momentum()<<qH->GetQC()<<G4endl; 4967 5005 #endif … … 4974 5012 if(lQP.GetPDGCode()!=10) theCurr->SetQPDG(lQP); //CurHadr instead of LastHadr 4975 5013 else theCurr->SetQC(theLast->GetQC());// CurHadrPDG instead of LastHadrPDG 4976 #ifdef pdebug5014 #ifdef debug 4977 5015 G4cout<<"---Warning---G4QE::FSI:l#"<<nhd1<<",4M="<<l4M<<",PDG="<<lQP<<G4endl; 4978 5016 #endif … … 5019 5057 else if(hBN>1 && !sBN && (cBN<0 || cBN>hBN)) // "nN+mD- or nP+mD++ decay" 5020 5058 { 5021 #ifdef pdebug5059 #ifdef debug 5022 5060 G4cout<<"G4QE::FSI:nNmD-/nPmD++ #"<<ipo<<",P="<<hPDG<<",B="<<hBN<<",C="<<cBN<<G4endl; 5023 5061 #endif … … 5055 5093 if(hM<sum || !G4QHadron(h4Mom).DecayIn3(nu4M,ba4M,pi4M)) 5056 5094 { 5057 #ifdef pdebug5095 #ifdef debug 5058 5096 G4cout<<"***G4QEnv::FSI:IsN M="<<hM<<","<<hPDG<<"->N="<<nuQPDG<<"(M="<<nucM<<")+" 5059 5097 <<nN<<"*B="<<barPDG<<"(M="<<barM<<")+"<<nPi<<"*pi="<<tPDG<<"(M="<<tM<<")=" … … 5117 5155 } 5118 5156 } 5119 #ifdef pdebug5157 #ifdef debug 5120 5158 G4int hNFrag= theQHadrons[ipo]->GetNFragments(); //Recover after swapping 5121 5159 G4QContent hQC = theQHadrons[ipo]->GetQC(); // ... … … 5128 5166 ipo=jpo; // Take into account the roll back in case of the Last substitution 5129 5167 } 5130 #ifdef pdebug5168 #ifdef debug 5131 5169 G4cout<<"G4QE::FSI: >>>CurrentControlSumOf4MomOfHadrons="<<ccs4M<<G4endl; 5132 5170 #endif … … 5173 5211 G4QPDGCode hQPDG(hPDG); 5174 5212 G4double hGSM = hQPDG.GetMass(); // Ground State Mass of the first fragment 5175 #ifdef pdebug5213 #ifdef debug 5176 5214 G4cout<<"G4QE::FSI:LOOP START,h#"<<hadron<<curHadr->Get4Momentum()<<hPDG<<G4endl; 5177 5215 #endif … … 5352 5390 G4int hB = curHadr->GetBaryonNumber(); 5353 5391 //////////////////////G4int hC = curHadr->GetCharge(); 5354 #ifdef pdebug5392 #ifdef debug 5355 5393 if(!hF&&(hPDG>80000000&&hPDG<90000000||hPDG==90000000|| 5356 5394 hPDG>90000000&&(hPDG%1000000>200000||hPDG%1000>300))) 5357 5395 G4cout<<"**G4QEnv::FSInteraction: PDG("<<hadron<<")="<<hPDG<<", M="<<hM<<G4endl; 5358 5396 #endif 5359 #ifdef pdebug5397 #ifdef debug 5360 5398 G4cout<<"G4QE::FSI:h="<<hPDG<<",S="<<hS<<",B="<<hB<<",#"<<hadron<<"<"<<nHadr<<G4endl; 5361 5399 #endif … … 5367 5405 //if(2>3) // Close the ThermoBackFusion (VIMP for gamA TotCS) 5368 5406 { 5369 #ifdef pdebug5407 #ifdef debug 5370 5408 //if(nHadr==3) 5371 5409 G4cout<<"G4QE::FSI: h="<<hPDG<<",B="<<hB<<",h#"<<hadron<<" < nH="<<nHadr<<G4endl; … … 5397 5435 G4double pCM2=(sM2-rm*rm)*(sM2-sm*sm)/(dsM2+dsM2); 5398 5436 G4int bS = backH->GetStrangeness(); 5399 #ifdef pdebug5437 #ifdef debug 5400 5438 //if(nHadr==3) 5401 5439 G4cout<<"G4QE::FSI:"<<pt<<",B="<<bB<<",S="<<bS<<",p="<<pCM2<<"<"<<p2cut<<",hB=" … … 5687 5725 three=true; 5688 5726 } 5689 #ifdef pdebug5727 #ifdef debug 5690 5728 G4cout<<"G4QE::FSI: "<<three<<",r="<<rQPDG<<",f="<<fQPDG<<",t="<<hQPDG<<G4endl; 5691 5729 #endif … … 5700 5738 else 5701 5739 { 5702 #ifdef pdebug5740 #ifdef debug 5703 5741 G4cout<<"G4QE::FSI:*FUSION IS DONE*,fPDG="<<sPDG<<",PDG1="<<hPDG<<",PDG2=" 5704 5742 <<bPDG<<G4endl; … … 5708 5746 backH->SetQPDG(rQPDG); 5709 5747 backH->Set4Momentum(g4Mom); 5710 #ifdef pdebug5748 #ifdef debug 5711 5749 G4cout<<"G4QE::FSI:h="<<h4m<<",b="<<b4m<<",s="<<s4M<<G4endl; 5712 5750 G4cout<<"G4QE::FSI:f="<<f4Mom<<",g="<<g4Mom<<",s="<<f4Mom+g4Mom<<G4endl; … … 5724 5762 else 5725 5763 { 5726 #ifdef pdebug5764 #ifdef debug 5727 5765 G4cout<<"G4QE::FSI:DONE,n="<<nHadr<<",PDG="<<sPDG<<",1="<<hPDG<<",2="<<bPDG 5728 5766 <<G4endl; … … 5735 5773 theQHadrons.push_back(newH); // (delete equivalent for newH) 5736 5774 nHadr=theQHadrons.size(); 5737 #ifdef pdebug5775 #ifdef debug 5738 5776 G4cout<<"G4QE::FSI:h="<<h4m<<",b="<<b4m<<G4endl; 5739 5777 G4cout<<"G4QE::FSI:s="<<s4M<<" = Sum"<<f4Mom+g4Mom+t4Mom<<G4endl; … … 5757 5795 hM=h4m.m(); 5758 5796 // End of Instead ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 5759 #ifdef pdebug5797 #ifdef debug 5760 5798 G4cout<<"G4QE::FSI:cH4M="<<curHadr->Get4Momentum()<<G4endl; 5761 5799 #endif … … 5796 5834 G4double dmo=rpx*rpx+rpy*rpy+rpz*rpz; 5797 5835 G4double dem=re*re+dmo; 5798 #ifdef pdebug5836 #ifdef debug 5799 5837 G4cout<<"G4QE::FSI: Is Energy&Mom conserved? t4M="<<tot4Mom<<",d2="<<dem<<G4endl; 5800 5838 #endif … … 5802 5840 if(dem>0.0001) // Energy or momentum is not conserved 5803 5841 { 5804 #ifdef pdebug5842 #ifdef debug 5805 5843 if(dem>.1) 5806 5844 { … … 5889 5927 } 5890 5928 #endif 5891 G4QHadron* prevHadr = theQHadrons[nHadr-2]; // GetPointer to Hadr prev to theLast5892 G4LorentzVector pH4Mom = prevHadr->Get4Momentum(); // 4-mom of thePreviousHadron5893 5929 G4double cHM = curHadr->GetMass(); // Mass of the current hadron 5894 G4double pHM = prevHadr->GetMass(); // Mass of the current hadron 5895 tot4Mom+=cH4Mom+pH4Mom; 5896 G4double totRM=tot4Mom.m(); 5897 if(cHM+pHM<=totRM) // *** Make the final correction *** 5898 { 5899 if(!G4QHadron(tot4Mom).DecayIn2(pH4Mom,cH4Mom)) 5900 { 5901 G4cout<<"***G4QE::FSI:**Correction**tot4M="<<tot4Mom<<totRM<<">sM="<<cHM+cHM 5902 <<G4endl; 5903 #ifdef pdebug 5904 throw G4QException("***G4QEnvironment::FSInteract:CORRECTION DecIn2 error"); 5905 #endif 5906 } 5930 G4int ch=0; 5931 for(ch=nHadr-2; ch>-1; --ch) 5932 { 5933 G4QHadron* prevHadr = theQHadrons[ch]; // GetPointer to Hadr prev to theLast 5934 G4LorentzVector pH4Mom = prevHadr->Get4Momentum();// 4-mom of thePreviousHadron 5935 G4double pHM = prevHadr->GetMass(); // Mass of the current hadron 5936 tot4Mom+=cH4Mom+pH4Mom; 5937 G4double totRM=tot4Mom.m(); 5938 if(cHM+pHM<=totRM) // *** Make the final correction *** 5939 { 5940 if(!G4QHadron(tot4Mom).DecayIn2(pH4Mom,cH4Mom)) 5941 { 5942 G4cout<<"***G4QEnv::FSI:**Correction**,tot4M="<<tot4Mom<<totRM<<" > sM=" 5943 <<cHM+cHM<<G4endl; 5944 #ifdef debug 5945 throw G4QException("***G4QEnvironment::FSInteract:CORRECTION DecIn2Error"); 5946 #endif 5947 } 5907 5948 #ifdef chdebug 5908 G4cout<<"---Warning---G4QE::FSI:***CORRECTION IS DONE*** d="<<dem<<G4endl; 5909 #endif 5910 curHadr->Set4Momentum(cH4Mom); 5911 prevHadr->Set4Momentum(pH4Mom); 5912 } 5913 else 5914 { 5915 G4cerr<<"*!*G4QE::FSI:NoCor "<<cHM<<"+"<<pHM<<"="<<cHM+pHM<<">"<<totRM<<G4endl; 5916 #ifdef pdebug 5917 throw G4QException("***G4QEnvironment::FSInteraction: TEMPORARY EXCEPTION"); 5918 #endif 5919 } 5920 } 5921 #ifdef pdebug 5949 G4cout<<"---!!!---G4QE::FSI:***CORRECTION IS DONE*** d="<<dem<<G4endl; 5950 #endif 5951 curHadr->Set4Momentum(cH4Mom); 5952 prevHadr->Set4Momentum(pH4Mom); 5953 break; // Get out of the correction LOOP 5954 } 5955 else tot4Mom-=cH4Mom+pH4Mom; 5956 } 5957 #ifdef ppdebug 5958 if(ch<0) 5959 { 5960 G4cerr<<"*Warning*G4QEnvir::FSI:***EnergyMomentumCorrection FAILED***"<<G4endl; 5961 5962 throw G4QException("***G4QEnvironment::FSInteraction: EnMomCorrectionFailed"); 5963 } 5964 #endif 5965 } 5966 #ifdef debug 5922 5967 else G4cout<<"G4QE::FSI: Yes, it is. d="<<dem<<" for "<<nHadr<<" hadrons."<<G4endl; 5923 5968 #endif … … 5954 5999 { 5955 6000 G4int fBN=theQHadrons[f]->GetBaryonNumber(); // Baryon number of the fragment 5956 #ifdef pdebug 5957 G4cout<<"G4QE::FSI:"<<f<<",PDG="<<theQHadrons[f]->GetPDGCode()<<",fBN="<<fBN<<G4endl; 6001 #ifdef debug 6002 G4int fPDG=theQHadrons[f]->GetPDGCode(); // PDG code of the fragment 6003 G4LorentzVector fLV=theQHadrons[f]->Get4Momentum(); // 4Mom of the fragment 6004 G4cout<<"G4QE::FSI:"<<f<<",PDG="<<fPDG<<",fBN="<<fBN<<",f4M="<<fLV<<G4endl; 5958 6005 #endif 5959 6006 if(fBN>1) frag=true; // The fragment with A>1 is found 5960 6007 } 5961 #ifdef pdebug6008 #ifdef debug 5962 6009 G4cout<<"G4QE::FSI:===Before Gamma Compression===, nH="<<nHadr<<",frag="<<frag<<G4endl; 5963 6010 #endif … … 5969 6016 if(hPDG==89999003||hPDG==90002999) 5970 6017 G4cout<<"---Warning---G4QEnv::FSI:nD-/pD++(1)="<<hPDG<<G4endl; 5971 #ifdef pdebug6018 #ifdef debug 5972 6019 G4cout<<"G4QE::FSI: h#"<<h<<", hPDG="<<hPDG<<", hNFrag="<<hF<<G4endl; 5973 6020 #endif … … 5977 6024 if(hPDG==22) 5978 6025 { 5979 sum+=curHadr->Get4Momentum(); // Add 4Mom of gamma to the "sum" 6026 G4LorentzVector g4M=curHadr->Get4Momentum(); 6027 sum+=g4M; // Add 4Mom of gamma to the "sum" 5980 6028 gamCount++; 6029 #ifdef debug 6030 G4cout<<"G4QE::FSI: gam4M="<<g4M<<" is added to s4M="<<sum<<G4endl; 6031 #endif 5981 6032 } 5982 6033 if(h<static_cast<G4int>(theQHadrons.size())-1) // Need swap with the Last … … 5987 6038 if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); //CurHadr instead of LastHadr 5988 6039 else curHadr->SetQC(theLast->GetQC());// CurHadrPDG instead of LastHadrPDG 5989 #ifdef pdebug6040 #ifdef debug 5990 6041 G4cout<<"G4QE::FSI: Exchange with the last is done"<<G4endl; 5991 6042 #endif … … 5994 6045 delete theLast;//!!When kill,DON'T forget to delete theLastQHadron as an instance!! 5995 6046 nHadr--; 5996 #ifdef pdebug6047 #ifdef debug 5997 6048 G4cout<<"G4QE::FSI: The last is compessed"<<G4endl; 5998 6049 #endif 5999 6050 } 6000 6051 } 6001 #ifdef pdebug6052 #ifdef debug 6002 6053 G4cout<<"G4QE::FSI: nH="<<nHadr<<"="<<theQHadrons.size()<<", sum="<<sum<<G4endl; 6003 6054 #endif … … 6021 6072 if(nHadr>1)for(unsigned hdr=0; hdr<theQHadrons.size()-1; hdr++)//Ord:theBigestIstheLast 6022 6073 { 6023 #ifdef pdebug6074 #ifdef debug 6024 6075 G4cout<<"G4QE::FSI:ORD,h="<<hdr<<"<"<<nHadr<<",hPDG="<<theQHadrons[hdr]->GetPDGCode() 6025 6076 <<G4endl; … … 6029 6080 G4int hB = curHadr->GetBaryonNumber(); 6030 6081 G4int lB = theLast->GetBaryonNumber(); 6031 #ifdef pdebug6082 #ifdef debug 6032 6083 G4cout<<"G4QE::FSI:hBN="<<hB<<"<lBN="<<lB<<",lstPDG="<<theLast->GetPDGCode()<<G4endl; 6033 6084 #endif … … 6065 6116 { 6066 6117 G4QHadron* theLast = theQHadrons[nHadr-1];// Get a pointer to the Last Hadron 6067 if(theLast->GetBaryonNumber()> 1) // "Absorb photons & evaporate/decay" case6118 if(theLast->GetBaryonNumber()>0) // "Absorb photons & evaporate/decay" case 6068 6119 { 6069 6120 G4QHadron* theNew = new G4QHadron(theLast); // Make New Hadron of the Last Hadron … … 6076 6127 G4int newPDG=theNew->GetPDGCode(); 6077 6128 G4LorentzVector new4M=theNew->Get4Momentum(); // 4-mom of the fragment 6078 #ifdef pdebug6129 #ifdef debug 6079 6130 G4cout<<"G4QE::FSI:gSum4M="<<sum<<" is added to "<<new4M<<", PDG="<<newPDG<<G4endl; 6080 6131 #endif … … 6260 6311 G4int hBN = theQHadrons[ipo]->GetBaryonNumber(); 6261 6312 tHadr+=hBN; 6262 #ifdef pdebug6313 #ifdef debug 6263 6314 G4cout<<"G4QE::FSI:h#"<<ipo<<":hPDG="<<hPDG<<",hBN="<<hBN<<",nH="<<theQHadrons.size() 6264 6315 <<G4endl; … … 6271 6322 } 6272 6323 } 6273 #ifdef pdebug6324 #ifdef debug 6274 6325 G4cout<<"G4QE::FSI:max#"<<maxB<<",lB="<<lHadr<<",tBN="<<tHadr<<",gam="<<gamcnt<<G4endl; 6275 6326 #endif … … 6314 6365 G4QHadron* theCurr = theQHadrons[gp]; // Pointer to the Current Hadron 6315 6366 G4int hPDG=theCurr->GetPDGCode(); 6316 #ifdef pdebug6367 #ifdef debug 6317 6368 G4cout<<"G4QE::FSI:gp#"<<gp<<", PDG="<<hPDG<<", is found"<<G4endl; 6318 6369 #endif 6319 if(hPDG==22) // Photon is foun on the "gp" position6370 if(hPDG==22) // Photon is foun ond the "gp" position 6320 6371 { 6321 6372 gamSum=gamSum+theCurr->Get4Momentum(); // Accumulate the 4Momenta of the photon 6373 #ifdef debug 6374 G4cout<<"G4QE::FSI:Photon gp#"<<gp<<",nH="<<nHadr<<", update gS="<<gamSum<<G4endl; 6375 #endif 6322 6376 unsigned nLast=nHadr-1; // position of theLastHadron (gp<nHadr-1) 6323 6377 G4QHadron* theLast = theQHadrons[nLast]; // Pointer to the Last Hadron 6324 while(nLast>gp && theLast->GetPDGCode()==22) // "TheLast is a photon too" LOOP 6325 { 6326 gamSum=gamSum+theLast->Get4Momentum(); // Accumulate 4-momentum of theLastPhoton 6378 #ifdef debug 6379 G4int wcn=0; 6380 #endif 6381 while(nLast>=gp && theLast->GetPDGCode()==22) // "TheLast is a photon too" LOOP 6382 { 6383 #ifdef debug 6384 ++wcn; 6385 #endif 6386 if(nLast>gp) 6387 { 6388 gamSum=gamSum+theLast->Get4Momentum();// Accumulate 4-momentum of theLastPhoton 6389 #ifdef debug 6390 G4cout<<"G4QE::FSI:TheLastPhotonIsFound #"<<wcn<<",update gS="<<gamSum<<G4endl; 6391 #endif 6392 } 6327 6393 theQHadrons.pop_back(); // Pnt to theLastHadr.is excluded from HV 6328 6394 delete theLast;//*!!When kill,DON'T forget to delete theLastQHadron as an inst!!* … … 6331 6397 theLast = theQHadrons[nLast]; 6332 6398 } 6333 if(nLast>gp) 6399 if(nLast>gp) // -> swapping with the last 6334 6400 { 6335 6401 G4QPDGCode lQP=theLast->GetQPDG(); // The QPDG of the last … … 6340 6406 delete theLast;//*!|When kill,DON'T forget to delete theLastQHadron as an inst!!* 6341 6407 nHadr=theQHadrons.size(); 6342 #ifdef pdebug6343 G4cout<<"G4QE::FSI:RepBy lPDG="<<lQP<<", nH="<<nHadr<<",gS="<<gamSum<<G4endl;6408 #ifdef debug 6409 G4cout<<"G4QE::FSI:RepBy lPDG="<<lQP<<", nH="<<nHadr<<", gS="<<gamSum<<G4endl; 6344 6410 #endif 6345 6411 } … … 6354 6420 delete theLast; //**!!When kill,DON'T forget to delete theLastQHadron as an inst.!!** 6355 6421 nHadr=theQHadrons.size(); 6356 #ifdef pdebug6357 G4cout<<" G4QE::FSI: The last photon is killed, nH="<<nHadr<<",gS="<<gamSum<<G4endl;6422 #ifdef debug 6423 G4cout<<"-Warning-G4QE::FSI: LastPhotonIsKilled, nH="<<nHadr<<",gS="<<gamSum<<G4endl; 6358 6424 #endif 6359 6425 theLast = theQHadrons[nHadr-1]; … … 6402 6468 delete curHadr; 6403 6469 G4int APDG=lrN.GetPDG(); 6404 #ifdef pdebug6470 #ifdef debug 6405 6471 G4cout<<"G4QE::FSI: Final A+alpha, A="<<APDG<<lr4M<<", a="<<al4M<<G4endl; 6406 6472 #endif … … 6869 6935 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,k4M)) 6870 6936 { 6937 #ifdef debug 6938 6871 6939 G4cout<<"---Warning---G4QE::FSI: Try to recover ASN="<<hPDG<<","<<reM<<"<"<<mR<<"+" 6872 6940 <<mKaon<<"="<<sum<<G4endl; 6941 #endif 6873 6942 if(!theEnvironment.GetA()) 6874 6943 { … … 6889 6958 { 6890 6959 qH->SetNFragments(-1); //@@ To avoid looping 6960 #ifdef debug 6891 6961 G4cout<<"---Warning---G4QE::FSI:AntiStraN Failed LeaveAsItIs 4m="<<r4M<<G4endl; 6962 #endif 6892 6963 theQHadrons.push_back(qH); // Leave as it is (delete equivalent) 6893 6964 } … … 6917 6988 } 6918 6989 } 6919 else if(hPDG>90500000&&hPDG!=91000000&&hPDG!=91000999&&hPDG!=90999001) // Only for G4 6920 // @@ Xi & Omega- can be added here ^^^, if show up below 6990 // =Lambda(Sigma0)= = Sigma+ = = Sigma- = 6991 else if(hPDG>90500000 && hPDG!=91000000 && hPDG!=91000999 && hPDG!=90999001 && 6992 hPDG!=91999000 && hPDG!=91999999 && hPDG!=92998999 ) 6993 // == Xi- == == Xi0 == === Omega- === 6921 6994 { 6922 6995 #ifdef pdebug … … 6928 7001 G4int nSM=0; // A#0f unavoidable Sigma- 6929 7002 G4int nSP=0; // A#0f unavoidable Sigma+ 6930 if(nC<0) // Negative hypernucleus 6931 { 6932 if(-nC<=nL) 6933 { 6934 nSM=-nC; // Can be compensated by Sigma- 6935 nL+=nC; // Reduce the residual strangeness 7003 G4int nXZ=0; // A#0f unavoidable Xi- 7004 G4int nXM=0; // A#0f unavoidable Xi0 7005 //G4int nOM=0; // A#0f unavoidable Omega- 7006 // @@ Now it does not include more complicated clusters as Omega-,Xi- (Improve) 7007 if(nC < 0) // Negative hypernucleus 7008 { 7009 if(-nC <= nL) // Negative Charge is smaller than Strange 7010 { 7011 if(nL <= nB) // ==> Big Hyper-nucleus 7012 { 7013 nSM=-nC; // Can be compensated by Sigma- 7014 nL+=nC; // Reduce the residual strangeness 7015 } 7016 else // ==> Lack of BaryonNumber (better use Xi-) 7017 { 7018 G4int nX=nL-nB; 7019 if(-nC <= nX && nL >= nX+nX) // Part or all Xi are Xi- (e.g. Xi-,Lambda) 7020 { 7021 nXM=-nC; 7022 if(nXM != nX) nXZ=nX-nXM; // The rest are Xi0 7023 nL-=nX+nX; // Xi reduce srangeness twice faster 7024 } 7025 else if(nL >= nX-nC) // Sigma- should be used in addition to Xi- 7026 { // e.g. Xi-, Sigma- 7027 nXM=nX; 7028 nSM=-nC-nX; 7029 nL-=nX-nC; 7030 } 7031 else G4cout<<"-Warning-G4QEn::FSI:*Improve*,-nC<=nL,nL>nB, PDG="<<hPDG<<G4endl; 7032 } 7033 } 7034 else // -nC can not be totally compensated by nL 7035 { 7036 nSM=nL; // The maximumNumber of Sigma- (theRest pi-) 7037 nL=0; // Kill the residualStrangeness (@notEnough) 7038 } 7039 } 7040 else if(nC>nB-nL) // Extra positive hypernucleus (nC>=0 here) 7041 { // Can't compensate theCharge by onlyProtons 7042 if(nC<=nB) 7043 { 7044 if(nL <= nB) 7045 { 7046 G4int dH=nB-nC; 7047 nSP=nL-dH; // Can be compensated by Sigma+ 7048 nL=dH; // Reduce the residual strangeness 7049 } 7050 else if(nL<nB+nB) // Xi0 can be used 7051 { 7052 nXZ=nL-nB; // This is how many Xi0 7053 nL=nB-nL+nB; // a#of S=1 particles 7054 if(nC <= nL) 7055 { 7056 nSP=nC; 7057 nL-=nSP; 7058 } 7059 else 7060 { 7061 nSP=nL; 7062 nL=0; 7063 } 7064 } 7065 #ifdef pdebug 7066 else G4cout<<"-Warning-G4QEn::FSI:*Improve*,nC>nB-nL,nC<=nB, PDG="<<hPDG<<G4endl; 7067 #endif 6936 7068 } 6937 7069 else 6938 7070 { 6939 nS M=nL; // The maximum number of Sigma-7071 nSP=nL; // The maximumNumber of Sigma+ (theRest pi+) 6940 7072 nL=0; // Kill the residual strangeness 6941 7073 } 6942 7074 } 6943 else if(nC>nB-nL) // Extra positive hypernucleus 6944 { 6945 if(nC<=nB) 6946 { 6947 G4int dH=nB-nC; 6948 nSP=nL-dH; // Can be compensated by Sigma+ 6949 nL=dH; // Reduce the residual strangeness 6950 } 6951 else 6952 { 6953 nSP=nL; // The maximum number of Sigma+ 6954 nL=0; // Kill the residual strangeness 6955 } 6956 } 7075 // else = the charge can be compensated by nucleons 6957 7076 G4LorentzVector r4M=curHadr->Get4Momentum(); // Real 4-momentum of the hypernucleus 6958 7077 G4double reM=r4M.m(); // Real mass of the hypernucleus 6959 G4int rlPDG = hPDG-nL*1000000-nSP*1000999-nSM*999001;// Subtract Lamb/Sig from Nucl 6960 G4int sPDG=3122; // Prototype for the Hyperon PDG (Lambda) 6961 G4double MLa=mLamb; // Prototype for one Hyperon decay 7078 // Subtract Lamb/Sig/Xi from the Nucleus and decay 7079 G4int SS=nL+nSP+nSM+nXZ+nXM; 7080 if(SS<nB) // Should not be Xi's in the nucleus 7081 { 7082 G4int rlPDG = hPDG-nL*1000000-nSP*1000999-nSM*999001; 7083 G4int sPDG=3122; // Prototype for the Hyperon PDG (Lambda) 7084 G4double MLa=mLamb; // Prototype for one Hyperon decay 6962 7085 #ifdef pdebug 6963 G4cout<<"G4QEnvironment::FSI:*G4* nS+="<<nSP<<", nS-="<<nSM<<", nL="<<nL<<G4endl;6964 #endif 6965 if(nSP||nSM)6966 {6967 if(nL)6968 {6969 G4cout<<"***G4QE::FSI: HypNPDG="<<hPDG<<": both Sigm&Lamb -> Improve it"<<G4endl;6970 //throw G4QException("*G4QEnvironment::FSInter: Both Lambda&Sigma in Hypernucl");6971 // @@ Correction, which does not conservthe charge !! (-> add decay in 3)6972 if(nSP) nL+=nSP;6973 else nL+=nSM;6974 }6975 if(nSP)6976 {6977 nL=nSP;6978 sPDG=3222;6979 MLa=mSigP;6980 }6981 else6982 {6983 nL=nSM;6984 sPDG=3112;6985 MLa=mSigM;6986 }6987 }7086 G4cout<<"G4QEnvironment::FSI:*G4* nS+="<<nSP<<", nS-="<<nSM<<", nL="<<nL<<G4endl; 7087 #endif 7088 if(nSP||nSM) 7089 { 7090 if(nL) 7091 { 7092 // Hopefully it never happens 7093 G4cout<<"-Warning-G4QE::FSI:*Improve*,PDG="<<hPDG<<": both Sigma&Lamb"<<G4endl; 7094 // @@ Bad Correction, which does not conserve the charge !! (-> add decay in 3) 7095 if(nSP) nL+=nSP; 7096 else nL+=nSM; 7097 } 7098 if(nSP) 7099 { 7100 nL=nSP; 7101 sPDG=3222; 7102 MLa=mSigP; 7103 } 7104 else 7105 { 7106 nL=nSM; 7107 sPDG=3112; 7108 MLa=mSigM; 7109 } 7110 } 6988 7111 #ifdef pdebug 6989 G4cout<<"G4QEnvironment::FSI:*G4* mS="<<MLa<<", sPDG="<<sPDG<<", nL="<<nL<<G4endl;6990 #endif 6991 if(nL>1) MLa*=nL;6992 G4double rlM=G4QNucleus(rlPDG).GetMZNS();// Mass of the new residualNonstrangeNucleus6993 if(!nSP&&!nSM&&nL==1&&reM>rlM+mSigZ&&G4UniformRand()>.5) // Sigma0 @@ AddToHadroniz.?6994 {6995 sPDG=3212;6996 MLa=mSigZ;6997 }6998 G4int rnPDG = hPDG-nL*999999;// Convert Lambdas to neutrons (for convInN)6999 G4QNucleus rnN(rnPDG);// New nonstrange nucleus7000 G4double rnM=rnN.GetMZNS();// Mass of the new nonstrange nucleus7001 // @@ Take into account that therecan be Iso-Hypernucleus (Add PI+,R & Pi-,R decays)7002 if(rlPDG==90000000)// Multy Hyperon (HyperNuc of only hyperons)7003 {7004 if(nL>1) r4M=r4M/nL;// split the 4-mom for the MultyLambda7005 for(G4int il=0; il<nL; il++)// loop over Lambdas7006 {7007 G4QHadron* theLam = new G4QHadron(sPDG,r4M);// Make a New Hadr for the Hyperon7008 theQHadrons.push_back(theLam);// (del.eq.- user is responsible for del)7009 }7010 }7011 else if(reM>rlM+MLa-eps)// Lambda(or Sigma) can be split7012 {7013 G4LorentzVector n4M(0.,0.,0.,rlM);7014 G4LorentzVector h4M(0.,0.,0.,MLa);7015 G4double sum=rlM+MLa;7016 if(fabs(reM-sum)<eps)7017 {7018 n4M=r4M*(rlM/sum);7019 h4M=r4M*(MLa/sum);7020 }7021 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M))7022 {7023 G4cerr<<"***G4QE::FSI:Hypern, M="<<reM<<"<A+n*L="<<sum<<",d="<<sum-reM<<G4endl;7024 throw G4QException("***G4QEnvironment::FSInter: Hypernuclear L-decay error");7025 }7112 G4cout<<"G4QEnvironment::FSI:*G4* mS="<<MLa<<", sPDG="<<sPDG<<", nL="<<nL<<G4endl; 7113 #endif 7114 if(nL>1) MLa*=nL; 7115 G4double rlM=G4QNucleus(rlPDG).GetMZNS();// Mass of theNewResidualNonstrangeNucleus 7116 if(!nSP&&!nSM&&nL==1&&reM>rlM+mSigZ&&G4UniformRand()>.5)// Sigma0 @@ AddToHadroniz? 7117 { 7118 sPDG=3212; 7119 MLa=mSigZ; 7120 } 7121 G4int rnPDG = hPDG-nL*999999; // Convert Lambdas to neutrons (for convInN) 7122 G4QNucleus rnN(rnPDG); // New nonstrange nucleus 7123 G4double rnM=rnN.GetMZNS(); // Mass of the new nonstrange nucleus 7124 // @@ Take into account that can be Iso-Hypernucleus (Add PI+,R & Pi-,R decays) 7125 if(rlPDG==90000000) // Multy Hyperon (HyperNuc of only hyperons) 7126 { 7127 if(nL>1) r4M=r4M/nL; // split the 4-mom for the MultyLambda 7128 for(G4int il=0; il<nL; il++) // loop over Lambdas 7129 { 7130 G4QHadron* theLam = new G4QHadron(sPDG,r4M);// Make a New Hadr for the Hyperon 7131 theQHadrons.push_back(theLam); // (del.eq.- user is responsible for del) 7132 } 7133 } 7134 else if(reM>rlM+MLa-eps) // Lambda(or Sigma) can be split 7135 { 7136 G4LorentzVector n4M(0.,0.,0.,rlM); 7137 G4LorentzVector h4M(0.,0.,0.,MLa); 7138 G4double sum=rlM+MLa; 7139 if(fabs(reM-sum)<eps) 7140 { 7141 n4M=r4M*(rlM/sum); 7142 h4M=r4M*(MLa/sum); 7143 } 7144 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7145 { 7146 G4cerr<<"***G4QE::FSI:Hypern, M="<<reM<<"<A+n*L="<<sum<<",d="<<sum-reM<<G4endl; 7147 throw G4QException("***G4QEnvironment::FSInter: Hypernuclear L-decay error"); 7148 } 7026 7149 #ifdef pdebug 7027 G4cout<<"*G4QE::FSI:HypN "<<r4M<<"->A="<<rlPDG<<n4M<<", n*Lamb="<<nL<<h4M<<G4endl; 7028 #endif 7029 curHadr->Set4Momentum(n4M); 7030 curHadr->SetQPDG(G4QPDGCode(rlPDG)); // converted hypernucleus 7031 if(rlPDG==90000002) // Additional action with curHadr change 7032 { 7033 G4LorentzVector newLV=n4M/2.; 7034 curHadr->Set4Momentum(newLV); 7035 curHadr->SetQPDG(G4QPDGCode(90000001)); 7036 G4QHadron* secHadr = new G4QHadron(curHadr); 7037 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7038 } 7039 else if(rlPDG==90002000) // Additional action with curHadr change 7040 { 7041 G4LorentzVector newLV=n4M/2.; 7042 curHadr->Set4Momentum(newLV); 7043 curHadr->SetQPDG(G4QPDGCode(90001000)); 7044 G4QHadron* secHadr = new G4QHadron(curHadr); 7045 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7046 } 7047 // @@(?) Add multybaryon decays if necessary (Now it anyhow is made later) 7048 #ifdef fdebug 7049 G4cout<<"*G4QE::FSI: resNucPDG="<<curHadr->GetPDGCode()<<G4endl; 7050 #endif 7051 if(nL>1) h4M=h4M/nL; // split the lambda's 4-mom if necessary 7052 for(G4int il=0; il<nL; il++) // loop over excessive 7053 { 7054 G4QHadron* theLamb = new G4QHadron(sPDG,h4M);// Make a New Hadr for the Hyperon 7055 theQHadrons.push_back(theLamb); // (del.eq.- user is responsible for del) 7056 } 7057 } 7058 else if(reM>rnM+mPi0-eps&&!nSP&&!nSM) // Lambda->N only if Sigmas are absent 7059 { 7060 G4int nPi=static_cast<G4int>((reM-rnM)/mPi0); 7061 if (nPi>nL) nPi=nL; 7062 G4double npiM=nPi*mPi0; 7063 G4LorentzVector n4M(0.,0.,0.,rnM); 7064 G4LorentzVector h4M(0.,0.,0.,npiM); 7065 G4double sum=rnM+npiM; 7066 if(fabs(reM-sum)<eps) 7067 { 7068 n4M=r4M*(rnM/sum); 7069 h4M=r4M*(npiM/sum); 7070 } 7071 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7072 { 7073 G4cerr<<"***G4QE::FSI:Hypern, M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl; 7074 throw G4QException("***G4QEnvironment::FSInter: Hypernuclear decay error"); 7075 } 7076 curHadr->Set4Momentum(n4M); 7077 curHadr->SetQPDG(G4QPDGCode(rnPDG)); // converted hypernucleus 7078 #ifdef fdebug 7079 G4cout<<"*G4QE::FSI:HypN "<<r4M<<"->A="<<rnPDG<<n4M<<",n*Pi0="<<nPi<<h4M<<G4endl; 7080 #endif 7081 if(nPi>1) h4M=h4M/nPi; // split the 4-mom if necessary 7082 for(G4int ihn=0; ihn<nPi; ihn++) // loop over additional pions 7083 { 7084 G4QHadron* thePion = new G4QHadron(111,h4M);// Make a New Hadr for the pion 7085 theQHadrons.push_back(thePion); // (del.eq.- user is responsible for del) 7086 //theFragments->push_back(thePion); // (delete equivalent for the pion) 7087 } 7088 if(rnPDG==90000002) // Additional action with curHadr change 7089 { 7090 G4LorentzVector newLV=n4M/2.; 7091 curHadr->Set4Momentum(newLV); 7092 curHadr->SetQPDG(G4QPDGCode(90000001)); 7093 G4QHadron* secHadr = new G4QHadron(curHadr); 7094 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7095 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7096 } 7097 else if(rnPDG==90002000) // Additional action with curHadr change 7098 { 7099 G4LorentzVector newLV=n4M/2.; 7100 curHadr->Set4Momentum(newLV); 7101 curHadr->SetQPDG(G4QPDGCode(90001000)); 7102 G4QHadron* secHadr = new G4QHadron(curHadr); 7103 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7104 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7105 } 7106 // @@ Add multybaryon decays if necessary 7107 } 7108 else if(reM>rnM-eps) // Decay in nonstange and gamma 7109 { 7110 G4LorentzVector n4M(0.,0.,0.,rnM); 7111 G4LorentzVector h4M(0.,0.,0.,0.); 7112 G4double sum=rnM; 7113 if(fabs(reM-sum)<eps) n4M=r4M; 7114 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7115 { 7116 G4cerr<<"***G4QE::FSI:Hypern, M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl; 7117 throw G4QException("***G4QEnvironment::FSInter: Hypernuclear gamma decay error"); 7118 } 7119 curHadr->Set4Momentum(n4M); 7120 curHadr->SetQPDG(G4QPDGCode(rnPDG)); // converted hypernucleus 7121 #ifdef fdebug 7122 G4cout<<"*G4QE::FSI:HypNg "<<r4M<<"->A="<<rnPDG<<n4M<<",gamma="<<h4M<<G4endl; 7123 #endif 7124 G4QHadron* theGamma = new G4QHadron(22,h4M);// Make a New Hadr for the gamma 7125 theQHadrons.push_back(theGamma); // (del.eq.- user is responsible for del) 7126 if(rnPDG==90000002) // Additional action with curHadr change 7127 { 7128 G4LorentzVector newLV=n4M/2.; 7129 curHadr->Set4Momentum(newLV); 7130 curHadr->SetQPDG(G4QPDGCode(90000001)); 7131 G4QHadron* secHadr = new G4QHadron(curHadr); 7132 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7133 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7134 } 7135 else if(rnPDG==90002000) // Additional action with curHadr change 7136 { 7137 G4LorentzVector newLV=n4M/2.; 7138 curHadr->Set4Momentum(newLV); 7139 curHadr->SetQPDG(G4QPDGCode(90001000)); 7140 G4QHadron* secHadr = new G4QHadron(curHadr); 7141 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7142 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7143 } 7144 // @@ Add multybaryon decays if necessary 7145 } 7146 else // If this Error shows up (lowProbable appearance) => now it is left as is 7147 { 7148 G4double d=rlM+MLa-reM; 7149 G4cerr<<"G4QE::FSI:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl; 7150 d=rnM+mPi0-reM; 7151 G4cerr<<"***G4QE::FSI: HypN="<<hPDG<<", M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl; 7152 //throw G4QException("G4QEnvironment::FSInteract: Hypernuclear conversion"); 7153 } 7150 G4cout<<"*G4QE::FSI:HypN="<<r4M<<"->A="<<rlPDG<<n4M<<",n*Lamb="<<nL<<h4M<<G4endl; 7151 #endif 7152 curHadr->Set4Momentum(n4M); 7153 curHadr->SetQPDG(G4QPDGCode(rlPDG)); // converted hypernucleus 7154 if(rlPDG==90000002) // Additional action with curHadr change 7155 { 7156 G4LorentzVector newLV=n4M/2.; 7157 curHadr->Set4Momentum(newLV); 7158 curHadr->SetQPDG(G4QPDGCode(90000001)); 7159 G4QHadron* secHadr = new G4QHadron(curHadr); 7160 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7161 } 7162 else if(rlPDG==90002000) // Additional action with curHadr change 7163 { 7164 G4LorentzVector newLV=n4M/2.; 7165 curHadr->Set4Momentum(newLV); 7166 curHadr->SetQPDG(G4QPDGCode(90001000)); 7167 G4QHadron* secHadr = new G4QHadron(curHadr); 7168 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7169 } 7170 // @@(?) Add multybaryon decays if necessary (Now it anyhow is made later) 7171 #ifdef pdebug 7172 G4cout<<"*G4QE::FSI: resNucPDG="<<curHadr->GetPDGCode()<<G4endl; 7173 #endif 7174 if(nL>1) h4M=h4M/nL; // split the lambda's 4-mom if necessary 7175 for(G4int il=0; il<nL; il++) // loop over excessive 7176 { 7177 G4QHadron* theLamb = new G4QHadron(sPDG,h4M);// Make a New Hadr for the Hyperon 7178 theQHadrons.push_back(theLamb); // (del.eq.- user is responsible for del) 7179 } 7180 } 7181 else if(reM>rnM+mPi0-eps&&!nSP&&!nSM) // Lambda->N only if Sigmas are absent 7182 { 7183 G4int nPi=static_cast<G4int>((reM-rnM)/mPi0); 7184 if (nPi>nL) nPi=nL; 7185 G4double npiM=nPi*mPi0; 7186 G4LorentzVector n4M(0.,0.,0.,rnM); 7187 G4LorentzVector h4M(0.,0.,0.,npiM); 7188 G4double sum=rnM+npiM; 7189 if(fabs(reM-sum)<eps) 7190 { 7191 n4M=r4M*(rnM/sum); 7192 h4M=r4M*(npiM/sum); 7193 } 7194 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7195 { 7196 G4cerr<<"**G4QE::FSI:HyperN,M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl; 7197 throw G4QException("***G4QEnvironment::FSInter: Hypernuclear decay error"); 7198 } 7199 curHadr->Set4Momentum(n4M); 7200 curHadr->SetQPDG(G4QPDGCode(rnPDG)); // converted hypernucleus 7201 #ifdef pdebug 7202 G4cout<<"*G4QE::FSI:HypN "<<r4M<<"->A="<<rnPDG<<n4M<<",n*Pi0="<<nPi<<h4M<<G4endl; 7203 #endif 7204 if(nPi>1) h4M=h4M/nPi; // split the 4-mom if necessary 7205 for(G4int ihn=0; ihn<nPi; ihn++) // loop over additional pions 7206 { 7207 G4QHadron* thePion = new G4QHadron(111,h4M);// Make a New Hadr for the pion 7208 theQHadrons.push_back(thePion); // (del.eq.- user is responsible for del) 7209 //theFragments->push_back(thePion); // (delete equivalent for the pion) 7210 } 7211 if(rnPDG==90000002) // Additional action with curHadr change 7212 { 7213 G4LorentzVector newLV=n4M/2.; 7214 curHadr->Set4Momentum(newLV); 7215 curHadr->SetQPDG(G4QPDGCode(90000001)); 7216 G4QHadron* secHadr = new G4QHadron(curHadr); 7217 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7218 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7219 } 7220 else if(rnPDG==90002000) // Additional action with curHadr change 7221 { 7222 G4LorentzVector newLV=n4M/2.; 7223 curHadr->Set4Momentum(newLV); 7224 curHadr->SetQPDG(G4QPDGCode(90001000)); 7225 G4QHadron* secHadr = new G4QHadron(curHadr); 7226 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7227 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7228 } 7229 // @@ Add multybaryon decays if necessary 7230 } 7231 else if(reM>rnM-eps) // Decay in nonstrange and gamma 7232 { 7233 G4LorentzVector n4M(0.,0.,0.,rnM); 7234 G4LorentzVector h4M(0.,0.,0.,0.); 7235 G4double sum=rnM; 7236 if(fabs(reM-sum)<eps) n4M=r4M; 7237 else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7238 { 7239 G4cerr<<"**G4QE::FSI:Hypern,M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl; 7240 throw G4QException("***G4QEnvironment::FSInter:Hypernuclear GammaDecay error"); 7241 } 7242 curHadr->Set4Momentum(n4M); 7243 curHadr->SetQPDG(G4QPDGCode(rnPDG)); // converted hypernucleus 7244 #ifdef pdebug 7245 G4cout<<"*G4QE::FSI:HypNg "<<r4M<<"->A="<<rnPDG<<n4M<<",gamma="<<h4M<<G4endl; 7246 #endif 7247 G4QHadron* theGamma = new G4QHadron(22,h4M);// Make a New Hadr for the gamma 7248 theQHadrons.push_back(theGamma); // (del.eq.- user is responsible for del) 7249 if(rnPDG==90000002) // Additional action with curHadr change 7250 { 7251 G4LorentzVector newLV=n4M/2.; 7252 curHadr->Set4Momentum(newLV); 7253 curHadr->SetQPDG(G4QPDGCode(90000001)); 7254 G4QHadron* secHadr = new G4QHadron(curHadr); 7255 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7256 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7257 } 7258 else if(rnPDG==90002000) // Additional action with curHadr change 7259 { 7260 G4LorentzVector newLV=n4M/2.; 7261 curHadr->Set4Momentum(newLV); 7262 curHadr->SetQPDG(G4QPDGCode(90001000)); 7263 G4QHadron* secHadr = new G4QHadron(curHadr); 7264 theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7265 //theFragments->push_back(secHadr); // (del.eq.- user is responsible for del) 7266 } 7267 // @@ Add multybaryon decays if necessary 7268 } 7269 #ifdef pdebug 7270 else // If this Error shows up (lowProbable appearance) => now it is left as is 7271 { 7272 G4double d=rlM+MLa-reM; 7273 G4cerr<<"G4QE::F:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl; 7274 d=rnM+mPi0-reM; 7275 G4cerr<<"-W-G4QE::FSI:HypN="<<hPDG<<", M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl; 7276 //throw G4QException("G4QEnvironment::FSInteract: Hypernuclear conversion"); 7277 } 7278 #endif 7279 } 7280 else if(SS==nB) 7281 { 7282 #ifdef pdebug 7283 G4cout<<"G4QEnvironment::FSI:OnlyHyp,B="<<nB<<",SP="<<nSP<<",SM="<<nSM<<",L="<<nL 7284 <<",XM="<<nXM<<",XZ="<<nXZ<<G4endl; 7285 #endif 7286 G4int SP=0; 7287 if(nL) ++SP; 7288 if(nSP) ++SP; 7289 if(nSM) ++SP; 7290 if(nXZ) ++SP; 7291 if(nXM) ++SP; 7292 if(SP>1 && SP<4) 7293 { 7294 G4int fPDG=3122; 7295 G4double fM=mLamb; 7296 G4int fS=nL; 7297 G4int sPDG=3222; 7298 G4double sM=mSigP; 7299 G4int sS=nSP; 7300 G4int uPDG=3322; 7301 G4double uM=mXiZ; 7302 G4int uS=nSP; 7303 if(nL) 7304 { 7305 if(nSM) 7306 { 7307 sPDG=3112; 7308 sM =mSigM; 7309 sS =nSM; 7310 if(SP==3) 7311 { 7312 if(nXM) 7313 { 7314 uPDG=3312; 7315 uM =mXiM; 7316 uS =nXM; 7317 } 7318 } 7319 } 7320 else if(nXZ) 7321 { 7322 sPDG=3322; 7323 sM =mXiZ; 7324 sS =nXZ; 7325 if(SP==3) 7326 { 7327 if(nSP) 7328 { 7329 uPDG=3222; 7330 uM =mSigP; 7331 uS =nSP; 7332 } 7333 else if(nXM) 7334 { 7335 uPDG=3312; 7336 uM =mXiM; 7337 uS =nXM; 7338 } 7339 } 7340 } 7341 else if(nXM) 7342 { 7343 sPDG=3312; 7344 sM =mXiM; 7345 sS =nXM; 7346 //if(SP==3) uXiZ is a default 7347 } 7348 else if(SP==3) // Lambda,Sigma+ (only Xi0 is possible) 7349 { 7350 if(nXZ) 7351 { 7352 uPDG=3322; 7353 uM =mXiZ; 7354 uS =nXZ; 7355 } 7356 else G4cout<<"-Warning-G4QE::FSI: *Improve* StrangeComb, PDG="<<hPDG<<G4endl; 7357 } 7358 } 7359 else if(nSM) 7360 { 7361 fPDG=3112; 7362 fM =mSigM; 7363 fS =nSM; 7364 if(nXZ) 7365 { 7366 sPDG=3322; 7367 sM =mXiZ; 7368 sS =nXZ; 7369 if(SP==3) 7370 { 7371 if(nXM) 7372 { 7373 uPDG=3312; 7374 uM =mXiM; 7375 uS =nXM; 7376 } 7377 else if(nXZ) 7378 { 7379 uPDG=3322; 7380 uM =mXiZ; 7381 uS =nXZ; 7382 } 7383 } 7384 } 7385 else if(nXM) 7386 { 7387 sPDG=3312; 7388 sM =mXiM; 7389 sS =nXM; 7390 } 7391 } 7392 else if(nSP) 7393 { 7394 fPDG=3222; 7395 fM =mSigP; 7396 fS =nSP; 7397 if(nXZ) 7398 { 7399 sPDG=3322; 7400 sM =mXiZ; 7401 sS =nXZ; 7402 if(SP==3) 7403 { 7404 if(nXZ) 7405 { 7406 uPDG=3322; 7407 uM =mXiZ; 7408 uS =nXZ; 7409 } 7410 } 7411 } 7412 else if(nXM) 7413 { 7414 sPDG=3312; 7415 sM =mXiM; 7416 sS =nXM; 7417 } 7418 } 7419 else if(nXZ) 7420 { 7421 fPDG=3322; 7422 fM =mXiZ; 7423 fS =nXZ; 7424 if(nXM) 7425 { 7426 sPDG=3312; 7427 sM =mXiM; 7428 sS =nXM; 7429 } 7430 } 7431 else G4cout<<"-Warning-G4QE::FSI: *Improve* StrangeFragment, PDG="<<hPDG<<G4endl; 7432 // Now make two or three particles decay 7433 if(SP==2) // @@ Only 2BodyDecay is implemented >Improve 7434 { 7435 #ifdef pdebug 7436 G4cout<<"G4QEnvironment::FSI:2HypD,fS="<<fS<<",fPDG="<<sPDG<<",fM="<<fM<<",sS=" 7437 <<sS<<",sPDG="<<sPDG<<",sM="<<sM<<",rM="<<reM<<G4endl; 7438 #endif 7439 fM*=fS; 7440 sM+=sS; 7441 if(reM>fM+sM-eps) // can be split or decayed 7442 { 7443 G4LorentzVector f4M(0.,0.,0.,fM); 7444 G4LorentzVector s4M(0.,0.,0.,sM); 7445 G4double sum=fM+sM; 7446 if(fabs(reM-sum)<eps) // splitting 7447 { 7448 f4M=r4M*(fM/sum); 7449 s4M=r4M*(sM/sum); 7450 } 7451 else if(reM<sum || !G4QHadron(r4M).DecayIn2(f4M,s4M)) 7452 { 7453 G4cerr<<"***G4QE::FSI:Hyp,M="<<reM<<"<A+n*L="<<sum<<",d="<<sum-reM<<G4endl; 7454 throw G4QException("***G4QEnvironment::FSInter: HypernucOnlyStran2 error"); 7455 } 7456 #ifdef pdebug 7457 G4cout<<"G4QEnv::FSI:HNuc="<<r4M<<hPDG<<"->First="<<fS<<f4M<<fPDG<<",Second=" 7458 <<sS<<s4M<<sPDG<<G4endl; 7459 #endif 7460 if(fS>1) 7461 { 7462 f4M/=fS; // split the Hyperons 4-mom if necessary 7463 for(G4int il=1; il<fS; il++) // loop over excessive Hyperons 7464 { 7465 G4QHadron* theHyp = new G4QHadron(fPDG,f4M);// Make NewHadr for theHyper 7466 theQHadrons.push_back(theHyp); // (del.eq.- user is respons for del) 7467 } 7468 } 7469 curHadr->Set4Momentum(f4M); 7470 curHadr->SetQPDG(G4QPDGCode(fPDG)); // converted hypernucleus 7471 if(sS>1) s4M/=sS; // split the Hyperon 4-mom if necessary 7472 for(G4int il=0; il<sS; il++) // loop over excessive 7473 { 7474 G4QHadron* theHyp = new G4QHadron(sPDG,s4M);// Make NewHadr for theHyperon 7475 theQHadrons.push_back(theHyp); // (del.eq.- user is respons for del) 7476 } 7477 } 7478 else G4cout<<"-Warning-G4QE::FSI:*Improve* S2, PDG="<<hPDG<<",M="<<reM<<G4endl; 7479 //else if(reM>rnM+mPi0-eps&&!nSP&&!nSM) // Lambda->N only if Sigmas are absent 7480 //{ 7481 // G4int nPi=static_cast<G4int>((reM-rnM)/mPi0); 7482 // if (nPi>nL) nPi=nL; 7483 // G4double npiM=nPi*mPi0; 7484 // G4LorentzVector n4M(0.,0.,0.,rnM); 7485 // G4LorentzVector h4M(0.,0.,0.,npiM); 7486 // G4double sum=rnM+npiM; 7487 // if(fabs(reM-sum)<eps) 7488 // { 7489 // n4M=r4M*(rnM/sum); 7490 // h4M=r4M*(npiM/sum); 7491 // } 7492 // else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7493 // { 7494 // G4cerr<<"**G4QE::FSI:HypN,M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl; 7495 // throw G4QException("***G4QEnvironment::FSInter: Hypernuclear decay error"); 7496 // } 7497 // curHadr->Set4Momentum(n4M); 7498 // curHadr->SetQPDG(G4QPDGCode(rnPDG)); // converted hypernucleus 7499 #ifdef pdebug 7500 // G4cout<<"*G4QE::FSI:HN="<<r4M<<"->A="<<rnPDG<<n4M<<",n*Pi0="<<nPi<<h4M 7501 // <<G4endl; 7502 #endif 7503 // if(nPi>1) h4M=h4M/nPi; // split the 4-mom if necessary 7504 // for(G4int ihn=0; ihn<nPi; ihn++) // loop over additional pions 7505 // { 7506 // G4QHadron* thePion = new G4QHadron(111,h4M);// Make a New Hadr for the pion 7507 // theQHadrons.push_back(thePion); // (del.eq.- user is responsible for del) 7508 // //theFragments->push_back(thePion); // (delete equivalent for the pion) 7509 // } 7510 // if(rnPDG==90000002) // Additional action with curHadr change 7511 // { 7512 // G4LorentzVector newLV=n4M/2.; 7513 // curHadr->Set4Momentum(newLV); 7514 // curHadr->SetQPDG(G4QPDGCode(90000001)); 7515 // G4QHadron* secHadr = new G4QHadron(curHadr); 7516 // theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7517 // } 7518 // else if(rnPDG==90002000) // Additional action with curHadr change 7519 // { 7520 // G4LorentzVector newLV=n4M/2.; 7521 // curHadr->Set4Momentum(newLV); 7522 // curHadr->SetQPDG(G4QPDGCode(90001000)); 7523 // G4QHadron* secHadr = new G4QHadron(curHadr); 7524 // theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7525 // } 7526 // // @@ Add multybaryon decays if necessary 7527 //} 7528 //else if(reM>rnM-eps) // Decay in nonstange and gamma 7529 //{ 7530 // G4LorentzVector n4M(0.,0.,0.,rnM); 7531 // G4LorentzVector h4M(0.,0.,0.,0.); 7532 // G4double sum=rnM; 7533 // if(fabs(reM-sum)<eps) n4M=r4M; 7534 // else if(reM<sum || !G4QHadron(r4M).DecayIn2(n4M,h4M)) 7535 // { 7536 // G4cerr<<"**G4QE::FSI:HypN,M="<<reM<<"<A+n*Pi0="<<sum<<",d="<<sum-reM<<G4endl; 7537 // throw G4QException("***G4QEnvironment::FSInt:Hypernuclear GammaDecay error"); 7538 // } 7539 // curHadr->Set4Momentum(n4M); 7540 // curHadr->SetQPDG(G4QPDGCode(rnPDG)); // converted hypernucleus 7541 #ifdef pdebug 7542 // G4cout<<"*G4QE::FSI:HyN="<<r4M<<"->A="<<rnPDG<<n4M<<",gamma="<<h4M<<G4endl; 7543 #endif 7544 // G4QHadron* theGamma = new G4QHadron(22,h4M);// Make a New Hadr for the gamma 7545 // theQHadrons.push_back(theGamma); // (del.eq.- user is responsible for del) 7546 // if(rnPDG==90000002) // Additional action with curHadr change 7547 // { 7548 // G4LorentzVector newLV=n4M/2.; 7549 // curHadr->Set4Momentum(newLV); 7550 // curHadr->SetQPDG(G4QPDGCode(90000001)); 7551 // G4QHadron* secHadr = new G4QHadron(curHadr); 7552 // theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7553 // } 7554 // else if(rnPDG==90002000) // Additional action with curHadr change 7555 // { 7556 // G4LorentzVector newLV=n4M/2.; 7557 // curHadr->Set4Momentum(newLV); 7558 // curHadr->SetQPDG(G4QPDGCode(90001000)); 7559 // G4QHadron* secHadr = new G4QHadron(curHadr); 7560 // theQHadrons.push_back(secHadr); // (del.eq.- user is responsible for del) 7561 // } 7562 // // @@ Add multybaryon decays if necessary 7563 //} 7564 //else // If this Error shows up (lowProbable appearance) => now it is left as is 7565 //{ 7566 // G4double d=rlM+MLa-reM; 7567 //G4cerr<<"G4QE::F:R="<<rlM<<",S+="<<nSP<<",S-="<<nSM<<",L="<<nL<<",d="<<d<<G4endl; 7568 // d=rnM+mPi0-reM; 7569 // G4cerr<<"-W-G4QE::FSI:HyN="<<hPDG<<",M="<<reM<<"<"<<rnM+mPi0<<",d="<<d<<G4endl; 7570 // //throw G4QException("G4QEnvironment::FSInteract: Hypernuclear conversion"); 7571 //} 7572 } // End of decay in 2 7573 } 7574 } 7575 #ifdef pdebug 7576 else G4cout<<"-Warning-G4QE::FSI:*Improve*,S="<<SS<<">B="<<nB<<",PDG="<<hPDG<<G4endl; 7577 #endif 7154 7578 } 7155 7579 //unsigned nHd=theQHadrons.size()-1; … … 7164 7588 if(!fOK) hd--; 7165 7589 } // 7166 #ifdef fdebug7590 #ifdef pdebug 7167 7591 G4cout<<"G4QE::FSI:==>OUT,nH="<<theQHadrons.size()<<",nF="<<theFragments->size()<<G4endl; 7168 7592 #endif … … 7175 7599 { 7176 7600 G4QHadron* curHadr = new G4QHadron(theQHadrons[f]); 7177 #ifdef pdebug7601 #ifdef debug 7178 7602 G4cout<<"G4QE::FSI:#"<<f<<curHadr->Get4Momentum()<<curHadr->GetPDGCode()<<G4endl; 7179 7603 #endif … … 7204 7628 } 7205 7629 } 7630 #ifdef chdebug 7206 7631 if(cfContSum-chContSum || bfContSum-bnContSum) 7207 7632 { 7208 7633 G4cerr<<"*G4QE::FSI:(9) Ch="<<cfContSum-chContSum<<",Bn="<<bfContSum-bnContSum<<G4endl; 7209 #ifdef chdebug 7634 7210 7635 throw G4QException("G4QEnvironment::FSInteract: (9) Charge is not conserved"); 7211 #endif7212 7636 } 7637 #endif 7213 7638 // *** 7214 7639 return theFragments; … … 7219 7644 {// ============================= 7220 7645 G4int nQ=theQuasmons.size(); 7221 #ifdef pdebug7646 #ifdef debug 7222 7647 G4cout<<"G4QEnvironment::GetQuasmons is called nQ="<<nQ<<G4endl; 7223 7648 #endif … … 7225 7650 if(nQ) for(G4int iq=0; iq<nQ; iq++) 7226 7651 { 7227 #ifdef pdebug7652 #ifdef debug 7228 7653 G4cout<<"G4QEnv::GetQuasm:Q#"<<iq<<",QQPDG="<<theQuasmons[iq]->GetQPDG()<<",QQC=" 7229 7654 <<theQuasmons[iq]->GetQC()<<",M="<<theQuasmons[iq]->Get4Momentum().m()<<G4endl; … … 7232 7657 quasmons->push_back(curQ); // (delete equivalent - user is responsible) 7233 7658 } 7234 #ifdef pdebug7659 #ifdef debug 7235 7660 G4cout<<"G4QEnvironment::GetQuasmons ===OUT==="<<G4endl; 7236 7661 #endif … … 7242 7667 {// ============================= 7243 7668 G4int nH=theQHadrons.size(); 7244 #ifdef pdebug7669 #ifdef debug 7245 7670 G4cout<<"G4QEnvironment::GetQHadrons is called nH="<<nH<<G4endl; 7246 7671 #endif … … 7248 7673 if(nH) for(G4int ih=0; ih<nH; ih++) 7249 7674 { 7250 #ifdef pdebug7675 #ifdef debug 7251 7676 G4cout<<"G4QEnv::GetQHadrons:H#"<<ih<<",HQPDG="<<theQHadrons[ih]->GetQPDG()<<",HQC=" 7252 7677 <<theQHadrons[ih]->GetQC()<<",HM="<<theQHadrons[ih]->GetMass()<<G4endl; … … 7255 7680 hadrons->push_back(curH); // (del. equiv. - user is responsibile) 7256 7681 } 7257 #ifdef pdebug7682 #ifdef debug 7258 7683 G4cout<<"G4QEnvironment::GetQHadrons ===OUT=== Copied nQH="<<hadrons->size()<<G4endl; 7259 7684 #endif … … 7272 7697 {// ==================================== 7273 7698 G4int nH=input->size(); 7274 #ifdef pdebug7699 #ifdef debug 7275 7700 G4cout<<"G4QEnvironment::FillQHadrons is called nH="<<nH<<G4endl; 7276 7701 #endif 7277 7702 if(nH) for(G4int ih=0; ih<nH; ih++) 7278 7703 { 7279 #ifdef pdebug7704 #ifdef debug 7280 7705 G4cout<<"G4QEnv::FillQHadrons:H#"<<ih<<",HQPDG="<<(*input)[ih]->GetQPDG()<<",HQC=" 7281 7706 <<(*input)[ih]->GetQC()<<",HM="<<(*input)[ih]->GetMass()<<G4endl; … … 7284 7709 theQHadrons.push_back(curH); // (del. equiv. 7285 7710 } 7286 #ifdef pdebug7711 #ifdef debug 7287 7712 G4cout<<"G4QEnvironment::FillQHadrons ===OUT=== Filled nQH="<<theQHadrons.size()<<G4endl; 7288 7713 #endif … … 7327 7752 static const G4double mLPi = mPi + mLamb; 7328 7753 static const G4double mSpPi = mPi + mSigP; 7329 static const G4double mSmPi = mPi + mSig P;7754 static const G4double mSmPi = mPi + mSigM; 7330 7755 static const G4double mPK = mK + mProt; 7331 7756 static const G4double mPKZ = mK0 + mProt; … … 7351 7776 G4LorentzVector q4M = qH->Get4Momentum(); // Get 4-momentum of the Baryon 7352 7777 G4double qM = q4M.m(); // Mass of the Baryon 7353 #ifdef pdebug7778 #ifdef debug 7354 7779 G4cout<<"G4QEnv::DecayBaryon: *Called* S="<<theLS<<",C="<<theLC<<",4M="<<q4M<<qM<<G4endl; 7355 7780 #endif … … 7367 7792 if(fabs(qM-mNeut)<eps) 7368 7793 { 7369 #ifdef pdebug7794 #ifdef debug 7370 7795 G4cout<<"G4QEnv::DecayBaryon: Fill Neutron AsIs"<<G4endl; 7371 7796 #endif … … 7403 7828 if(fabs(qM-mProt)<eps) 7404 7829 { 7405 #ifdef pdebug7830 #ifdef debug 7406 7831 G4cout<<"G4QEnv::DecayBaryon: Fill Proton AsIs"<<G4endl; 7407 7832 #endif … … 7434 7859 else // @@ Can be aReason to search for anError in Fragmentation 7435 7860 { 7436 #ifdef pdebug7861 #ifdef debug 7437 7862 G4cout<<"-Warning-G4QE::DecBary:*AsIs* DEL++ M="<<qM<<"<"<<mPPi<<G4endl; 7438 7863 #endif … … 7452 7877 else // @@ Can be aReason to search for anError in Fragmentation 7453 7878 { 7454 #ifdef pdebug7879 #ifdef debug 7455 7880 G4cout<<"-Warning-G4QE::DecBary:*AsIs* DEL++ M="<<qM<<"<"<<mNPi<<G4endl; 7456 7881 #endif … … 7461 7886 else 7462 7887 { 7463 #ifdef pdebug7888 #ifdef debug 7464 7889 G4cout<<"-Warning-G4QE::DecBary:*AsIs* UnknBaryon (S=0) QC="<<qH->GetQC()<<G4endl; 7465 7890 #endif … … 7476 7901 if(fabs(qM-mLamb)<eps) 7477 7902 { 7478 #ifdef pdebug7903 #ifdef debug 7479 7904 G4cout<<"G4QEnv::DecayBaryon: Fill Lambda AsIs"<<G4endl; 7480 7905 #endif … … 7638 8063 if(fabs(qM-mSigP)<eps) 7639 8064 { 7640 #ifdef pdebug8065 #ifdef debug 7641 8066 G4cout<<"G4QEnv::DecayBaryon: Fill SigmaPlus AsIs"<<G4endl; 7642 8067 #endif … … 7731 8156 if(fabs(qM-mSigM)<eps) 7732 8157 { 7733 #ifdef pdebug8158 #ifdef debug 7734 8159 G4cout<<"G4QEnv::DecayBaryon: Fill SigmaMinus AsIs"<<G4endl; 7735 8160 #endif … … 7820 8245 } 7821 8246 } 8247 else if(theLC==2 || theLC==-2) // SigmaPlus+PiPlus or SigmaMinus+PiMinus 8248 { 8249 if(theLC==2 && qM>=mSpPi) // SigmaPlus+PiPlus decay is possible 8250 { 8251 fQPDG=spQPDG; // Baryon is SigmaP 8252 fMass=mSigP; 8253 sQPDG=pipQPDG; // Pi+ Meson 8254 sMass=mPi; 8255 } 8256 if(theLC==-2 && qM>=mSmPi)// SigmaPlus+PiPlus decay is possible 8257 { 8258 fQPDG=smQPDG; // Baryon is SigmaP 8259 fMass=mSigM; 8260 sQPDG=pimQPDG; // Pi- Meson 8261 sMass=mPi; 8262 } 8263 else 8264 { 8265 #ifdef debug 8266 G4cout<<"-Warning-G4QE::DecBary:*AsIs* Baryon(S=1,|C|=2),QC="<<qH->GetQC()<<G4endl; 8267 #endif 8268 theQHadrons.push_back(qH); // Fill AsIs (delete equivalent) 8269 return; 8270 } 8271 } 7822 8272 else 7823 8273 { … … 7825 8275 //KsiZ: Ksi0+Pi0=1449.81, KsiM+Pi=1460.9, L+K0=1613.3, Sig0+K0=1690.3, SigP+K=1683.05 7826 8276 //Omeg: Omeg+Pi0=1807.43, Ksi0+K=1808.5, KsiM+K0=1818.96 7827 G4cout<<"-Warning-G4QE::DecBary:*AsIs* UnknownBaryon(S >1)QC="<<qH->GetQC()<<G4endl;8277 G4cout<<"-Warning-G4QE::DecBary:*AsIs* UnknownBaryon(S=1)QC="<<qH->GetQC()<<G4endl; 7828 8278 theQHadrons.push_back(qH); // Fill AsIs (delete equivalent) 7829 8279 return; … … 7832 8282 else 7833 8283 { 7834 #ifdef pdebug8284 #ifdef debug 7835 8285 G4cout<<"---Warning---G4QE::DecBary:*AsIso*UnknBaryon(AntiS),QC="<<qH->GetQC()<<G4endl; 7836 8286 #endif … … 7848 8298 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom)) 7849 8299 { 7850 #ifdef pdebug8300 #ifdef debug 7851 8301 G4cout<<"---Warning---G4QE::DecBar:fPDG="<<fQPDG<<"(M="<<fMass<<")+sPDG="<<sQPDG<<"(M=" 7852 8302 <<sMass<<") > TotM="<<q4M.m()<<G4endl; … … 7867 8317 } 7868 8318 } 7869 #ifdef pdebug8319 #ifdef debug 7870 8320 G4cout<<"G4QEnv::DecayBaryon: *DONE* f4M="<<f4Mom<<",fPDG="<<fQPDG<<", s4M="<<s4Mom 7871 8321 <<",sPDG="<<sQPDG<<G4endl; … … 7898 8348 return; 7899 8349 } 7900 else if(theLS<-1) 7901 { 7902 G4cout<<"*Warning*G4QEnvironment::DecayAntistrange: S="<<theLS<<",AsIsImprove"<<G4endl; 7903 theQHadrons.push_back(qH); // Fill AsIs (delete equivalent) 7904 return; 7905 } 8350 //else if(theLS<-1) 8351 //{ 8352 // G4cout<<"*Warning*G4QEnviron::DecayAntistrange: S="<<theLS<<",AsIs->Improve"<<G4endl; 8353 // theQHadrons.push_back(qH); // Fill AsIs (delete equivalent) 8354 // return; 8355 //} 8356 G4int astr=-theLS; // Number of K+ (or anti-K0) 7906 8357 G4int theLB= qH->GetBaryonNumber(); // Baryon number of the Nucleus 7907 8358 G4int theLC= qH->GetCharge(); // Chsrge of the Nucleus 7908 8359 G4int qPDG = qH->GetPDGCode(); // PDG Code of the decaying Nucleus 7909 G4int K0PDG= qPDG+ 999999; // Residual nonStrange nucleus forantiK07910 G4QPDGCode K0QPDG(K0PDG); // QPDG of the nuclear residual for antiK07911 G4double rK0M=K0QPDG.GetMass(); // Mass of the nuclear residual for antiK07912 G4int KpPDG= qPDG+ 999000; // Residual nonStrange nucleus forK+7913 G4QPDGCode KpQPDG(KpPDG); // QPDG of the nuclear residual for K+7914 G4double rKpM=KpQPDG.GetMass(); // Mass of the nuclear residual for K+8360 G4int K0PDG= qPDG+astr*999999; // Residual nonStrange nucleus for S*antiK0 8361 G4QPDGCode K0QPDG(K0PDG); // QPDG of the nuclear residual for S*antiK0 8362 G4double rK0M=K0QPDG.GetMass(); // Mass of the nuclear residual for S*antiK0 8363 G4int KpPDG= qPDG+astr*999000; // Residual nonStrange nucleus for S*K+ 8364 G4QPDGCode KpQPDG(KpPDG); // QPDG of the nuclear residual for S*K+ 8365 G4double rKpM=KpQPDG.GetMass(); // Mass of the nuclear residual for S*K+ 7915 8366 G4LorentzVector q4M = qH->Get4Momentum(); // Get 4-momentum of the Nucleus 7916 8367 G4double qM = q4M.m(); // Mass of the Nucleus 7917 #ifdef pdebug8368 #ifdef debug 7918 8369 G4cout<<"G4QE::DecayAntistrang:S="<<theLS<<",C="<<theLC<<",B="<<theLB<<",M="<<qM<<G4endl; 7919 8370 #endif 7920 // Select a chanel of the decay 8371 // Select a chanel of the decay: @@ The Kaon binding energy is not taken into account !! 7921 8372 G4QPDGCode fQPDG = kzQPDG; // Prototype for Kaon (anti-K0) 7922 8373 G4double fMass= mK0; 7923 8374 G4QPDGCode sQPDG = K0QPDG; // Prototype for residual nucleus to Kaon 7924 8375 G4double sMass= rK0M; 7925 if( mK0+rK0M>qM) // Can not be K08376 if(astr*mK0+rK0M>qM) // Can not be K0 7926 8377 { 7927 if(mK+rKpM>qM) // Can not be K+ too 7928 { 8378 if(astr*mK+rKpM>qM) // Can not be K+ too 8379 { 8380 #ifdef debug 8381 // @@ Survices, but... 7929 8382 G4cout<<"*Warning*G4QEnvironment::DecayAntistrange: Too low mass, keep AsIs"<<G4endl; 8383 #endif 7930 8384 theQHadrons.push_back(qH); // Fill AsIs (delete equivalent) 7931 8385 return; … … 7939 8393 } 7940 8394 } 7941 else if( mK+rKpM<qM && theLC>theLB-theLC) // Switch to K+ if Z>N8395 else if(astr*mK+rKpM<qM && theLC>theLB-theLC) // Switch to K+ if Z>N 7942 8396 { 7943 8397 fQPDG = kpQPDG; // Positive Kaon … … 7946 8400 sMass= rKpM; 7947 8401 } 7948 G4LorentzVector f4Mom(0.,0.,0.,fMass); 8402 G4double afMass=fMass; 8403 if(astr>1) afMass*=astr; 8404 G4LorentzVector f4Mom(0.,0.,0.,afMass); 7949 8405 G4LorentzVector s4Mom(0.,0.,0.,sMass); 7950 G4double sum= fMass+sMass;8406 G4double sum=afMass+sMass; 7951 8407 if(fabs(qM-sum)<eps) 7952 8408 { 7953 f4Mom=q4M*( fMass/sum);8409 f4Mom=q4M*(afMass/sum); 7954 8410 s4Mom=q4M*(sMass/sum); 7955 8411 } 7956 8412 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom)) 7957 8413 { 7958 #ifdef pdebug8414 #ifdef debug 7959 8415 G4cout<<"--Warning--G4QE::DecAntistrange: fPDG="<<fQPDG<<"(M="<<fMass<<")+sPDG="<<sQPDG 7960 8416 <<"(M="<<sMass<<") > TotM="<<q4M.m()<<G4endl; … … 7963 8419 throw G4QException("G4QEnv::DecayAntistrange: Nucleus DecayIn2 error"); 7964 8420 } 7965 #ifdef pdebug8421 #ifdef debug 7966 8422 G4cout<<"G4QEnv::DecayAntistrange: *Done* f4M="<<f4Mom<<",fPDG="<<fQPDG<<", s4M="<<s4Mom 7967 8423 <<",sPDG="<<sQPDG<<G4endl; … … 7969 8425 delete qH; 7970 8426 // 7971 G4QHadron* H1 = new G4QHadron(fQPDG,f4Mom); // Create a Hadron for the 1-st baryon 8427 if(astr>1) f4Mom/=astr; 8428 G4QHadron* H1 = new G4QHadron(fQPDG,f4Mom); // Create a Hadron for the 1-st kaon 7972 8429 theQHadrons.push_back(H1); // Fill "H1" (delete equivalent) 7973 G4QHadron* H2 = new G4QHadron(sQPDG,s4Mom); // Create a Hadron for the 2-nd baryon 8430 for(G4int ia=1; ia < astr; ++ia) 8431 { 8432 H1 = new G4QHadron(fQPDG,f4Mom); // Create a Hadron for other kaons 8433 theQHadrons.push_back(H1); // Fill "H1" (delete equivalent) 8434 } 8435 G4QHadron* H2 = new G4QHadron(sQPDG,s4Mom); // Create a Hadron for the Residual Nucleus 7974 8436 theQHadrons.push_back(H2); // Fill "H2" (delete equivalent) 7975 8437 } // End of DecayAntistrange … … 8028 8490 if(G4QHadron(toLV).DecayIn2(reTLV,enva4M)) 8029 8491 { 8030 #ifdef pdebug8492 #ifdef debug 8031 8493 G4cout<<"G4QE::CGS: fill EnvPDG="<<envPDG<<",4M="<<enva4M<<" and continue"<<G4endl; 8032 8494 #endif … … 8038 8500 G4int baPDG=3122; // Prototype for MultiLambda 8039 8501 if(!resS) baPDG = (!resC) ? 2112 : 2212; // MultiNeutron or MultiProton 8040 #ifdef pdebug8502 #ifdef debug 8041 8503 G4cout<<"G4QE::CGS: fill "<<resB<<" of "<<baPDG<<" with t4M="<<reTLV<<G4endl; 8042 8504 #endif … … 8128 8590 { 8129 8591 //@@CHECK CoulBar (only for ResQuasmon in respect to ResEnv) and may be evaporate 8130 #ifdef pdebug8592 #ifdef debug 8131 8593 G4cout<<"G4QE::CGS: Modify the Last 4-momentum to "<<hadr4M<<G4endl; 8132 8594 #endif … … 8135 8597 G4QContent theEQC=theEnvironment.GetQCZNS(); 8136 8598 G4QHadron* envaH = new G4QHadron(theEQC,enva4M); 8137 #ifdef pdebug8599 #ifdef debug 8138 8600 G4cout<<"G4QE::CGS: Fill Quasm "<<valQ<<quas4M<<" in any form"<<G4endl; 8139 8601 #endif 8140 8602 EvaporateResidual(quasH); // Try to evaporate residual (del.eq.) 8141 #ifdef pdebug8603 #ifdef debug 8142 8604 G4cout<<"G4QE::CGS: Fill envir "<<theEQC<<enva4M<<" in any form"<<G4endl; 8143 8605 #endif … … 8164 8626 //@@CHECK CoulBar (only for ResQuasmon in respect to ResEnv) & may be evaporate 8165 8627 theLast->Set4Momentum(hadr4M); 8166 #ifdef pdebug8628 #ifdef debug 8167 8629 G4cout<<"G4QE::CGS: modify theLast 4M="<<hadr4M<<hadr4M.m()<<G4endl; 8168 8630 #endif 8169 8631 quasH->Set4Momentum(quas4M); 8170 #ifdef pdebug8632 #ifdef debug 8171 8633 G4cout<<"G4QE::CGS: fill newQH "<<valQ<<quas4M<<quas4M.m()<<" inAnyForm"<<G4endl; 8172 8634 #endif … … 8219 8681 G4cout<<"G4QE::CGS:*SUCCESS**>CHECK, D4M="<<tmpTLV-hadr4M-prev4M-nuc4M<<G4endl; 8220 8682 #endif 8221 #ifdef pdebug8683 #ifdef debug 8222 8684 G4cout<<"G4QE::CGS: Fill nucleus "<<reTQC<<nuc4M<<" in any form"<<G4endl; 8223 8685 #endif … … 8279 8741 G4cout<<"G4QE::CGS:nPhot="<<nphot<<",ph4M="<<ch4M<<"+r4M="<<quas4M<<G4endl; 8280 8742 #endif 8281 #ifdef pdebug8743 #ifdef debug 8282 8744 G4cout<<"G4QE::CGS: Fill Resid "<<reTQC<<quas4M<<" in any form"<<G4endl; 8283 8745 #endif … … 8339 8801 { 8340 8802 G4QHadron* fnH = new G4QHadron(nuPD,fn4M);// First Nucleon(s) 8341 #ifdef pdebug8803 #ifdef debug 8342 8804 G4cout<<"G4QE::CGS: fill Nucleon #"<<ib<<", "<<nuPD<<fn4M<<G4endl; 8343 8805 #endif … … 8345 8807 } 8346 8808 G4QHadron* snH = new G4QHadron(nuPD,sn4M);// Second Nucleon 8347 #ifdef pdebug8809 #ifdef debug 8348 8810 G4cout<<"G4QE::CGS: fill the Last Nucleon, "<<nuPD<<sn4M<<G4endl; 8349 8811 #endif … … 8399 8861 { 8400 8862 G4QHadron* piH = new G4QHadron(piPD,pi4M);// Pion(s) 8401 #ifdef pdebug8863 #ifdef debug 8402 8864 G4cout<<"G4QE::CGS: fill Pion #"<<ip<<", "<<piPD<<pi4M<<G4endl; 8403 8865 #endif … … 8408 8870 { 8409 8871 G4QHadron* fnH = new G4QHadron(nuPD,fn4M);// Nucleon(s) 8410 #ifdef pdebug8872 #ifdef debug 8411 8873 G4cout<<"G4QE::CGS: fill IsoNucleon #"<<ib<<", "<<nuPD<<fn4M<<G4endl; 8412 8874 #endif … … 8490 8952 curHadr->Set4Momentum(ch4M);// Change 4M of the Current Hadron 8491 8953 G4QHadron* rpH = new G4QHadron(ipiQC,ipi4M);// Prototype of ResidPion 8492 #ifdef pdebug8954 #ifdef debug 8493 8955 G4cout<<"G4QE::CGS: fill Pion "<<ipiQC<<ipi4M<<G4endl; 8494 8956 #endif 8495 8957 theQHadrons.push_back(rpH); // Fill Resid Pion (delete equivalent) 8496 8958 G4QHadron* rqH = new G4QHadron(nnQC,quas4M);// Prototype of OutResidQ 8497 #ifdef pdebug8959 #ifdef debug 8498 8960 G4cout<<"G4QE::CGS:Fill isoRes "<<nnQC<<quas4M<<" inAnyForm"<<G4endl; 8499 8961 #endif … … 8556 9018 rqH->SetQPDG(gamQPDG); // Change QPDG of the ResidualQuasmon 8557 9019 theQHadrons.push_back(rqH); // Fill Gamma 1 as QHadron (del. eq.) 8558 #ifdef pdebug9020 #ifdef debug 8559 9021 G4cout<<"G4QE::CGS:Fill (SubRQ) Gamma 1,(22)4M="<<quas4M<<G4endl; 8560 9022 #endif 8561 9023 G4QHadron* gamH = new G4QHadron(gamQPDG, gam4M); 8562 9024 theQHadrons.push_back(gamH);// Fill Gamma 2 as QHadron (del. eq.) 8563 #ifdef pdebug9025 #ifdef debug 8564 9026 G4cout<<"G4QE::CGS:Fill newMadeGamma 2, (22) 4M="<<gam4M<<G4endl; 8565 9027 #endif … … 8589 9051 G4cout<<"G4QE::CGS:#"<<hd<<",h="<<ch4M<<"+rq="<<quas4M<<G4endl; 8590 9052 #endif 8591 #ifdef pdebug9053 #ifdef debug 8592 9054 G4cout<<"G4QE::CGS:FilFr "<<nnQPDG<<quas4M<<" inAnyForm"<<G4endl; 8593 9055 #endif … … 8647 9109 G4cout<<"G4QE::CGS:#"<<hd<<",ch="<<ch4M<<"+t4M="<<tc4M<<G4endl; 8648 9110 #endif 8649 #ifdef pdebug9111 #ifdef debug 8650 9112 G4cout<<"G4QE::CGS:FilTC "<<tcQPDG<<tc4M<<" inAnyForm"<<G4endl; 8651 9113 #endif … … 8688 9150 <<ch4M<<" + ResQ4M="<<totPDG<<quas4M<<G4endl; 8689 9151 #endif 8690 #ifdef pdebug9152 #ifdef debug 8691 9153 G4cout<<"G4QE::CGS:Fill GSRes "<<reTQC<<quas4M<<" inAnyForm"<<G4endl; 8692 9154 #endif … … 8732 9194 ttQPDG=G4QPDGCode(ttPDG); // Update QPDGcode defining fragment 8733 9195 ttGSM=ttQPDG.GetMass(); // Update the degraded mass value 8734 #ifdef pdebug9196 #ifdef debug 8735 9197 G4cout<<"G4QEnv::CheckGS:Hypernucleus degraded to QPDG="<<ttQPDG<<G4endl; 8736 9198 #endif … … 8756 9218 } 8757 9219 } 8758 else G4cout<<"**G4QEnv::CheckGS:M="<<ttM<<" < GSM="<<ttGSM<<ttQPDG<<G4endl; 9220 #ifdef debug 9221 else G4cout<<"-W-G4QEn::CheckGS:M="<<ttM<<" < GSM="<<ttGSM<<ttQPDG<<G4endl; 9222 #endif 8759 9223 } 8760 9224 } … … 8783 9247 if(!hNF) // Fill only final hadrons 8784 9248 { 8785 #ifdef pdebug9249 #ifdef debug 8786 9250 G4cout<<"G4QEnv::Copy&DeleteHV:#"<<ih<<", hPDG="<<inH->GetPDGCode()<<G4endl; 8787 9251 #endif … … 8793 9257 HV->clear(); // Delete pointers 8794 9258 } 8795 #ifdef pdebug9259 #ifdef debug 8796 9260 else G4cout<<"***G4QEnv::Kopy&DelHV: No hadrons in the QHadronVector"<<G4endl; 8797 9261 #endif … … 8817 9281 resSMa+=resEMa; // Minimal Split Mass of Residual Nucleus 8818 9282 G4double resTMa=reTLV.m(); // CM Mass of theResidNucleus (Quasm+Env) 8819 //#ifdef pdebug9283 //#ifdef debug 8820 9284 G4cout<<"G4QEnv::DecayInEnvQ: totM="<<reTLV<<resTMa<<" > rQM+rEM="<<resSMa<<G4endl; 8821 9285 //#endif … … 8857 9321 #endif 8858 9322 } 8859 //General function makes Random Unit 3D-Vector 8860 G4ThreeVector RndmDir()8861 {// -------- =========8862 G4double x = G4UniformRand(), y = G4UniformRand(), z = G4UniformRand();8863 G4double r2= x*x+y*y+z*z;8864 while(r2>1.||r2<.000001)8865 {8866 x = G4UniformRand(); y = G4UniformRand(); z = G4UniformRand();8867 r2=x*x+y*y+z*z;8868 }8869 G4double r=sqrt(r2), quad=G4UniformRand();8870 if(quad>0.5)8871 {8872 if(quad>0.75)8873 {8874 if(quad>0.875) return G4ThreeVector(-x/r,-y/r,-z/r);8875 else return G4ThreeVector(-x/r,-y/r, z/r);8876 }8877 else8878 {8879 if(quad>0.625) return G4ThreeVector(-x/r, y/r,-z/r);8880 else return G4ThreeVector(-x/r, y/r, z/r);8881 }8882 }8883 else8884 {8885 if(quad>0.25)8886 {8887 if(quad>0.375) return G4ThreeVector( x/r,-y/r,-z/r);8888 else return G4ThreeVector( x/r,-y/r, z/r);8889 }8890 else if(quad>0.125) return G4ThreeVector( x/r, y/r,-z/r);8891 }8892 return G4ThreeVector( x/r, y/r, z/r);8893 } // End of RndmDir9323 //General function makes Random Unit 3D-Vector -> now G4RandomDirection() is used 9324 //G4ThreeVector RndmDir() 9325 //{// -------- ========= 9326 // G4double x = G4UniformRand(), y = G4UniformRand(), z = G4UniformRand(); 9327 // G4double r2= x*x+y*y+z*z; 9328 // while(r2>1.||r2<.000001) 9329 // { 9330 // x = G4UniformRand(); y = G4UniformRand(); z = G4UniformRand(); 9331 // r2=x*x+y*y+z*z; 9332 // } 9333 // G4double r=sqrt(r2), quad=G4UniformRand(); 9334 // if(quad>0.5) 9335 // { 9336 // if(quad>0.75) 9337 // { 9338 // if(quad>0.875) return G4ThreeVector(-x/r,-y/r,-z/r); 9339 // else return G4ThreeVector(-x/r,-y/r, z/r); 9340 // } 9341 // else 9342 // { 9343 // if(quad>0.625) return G4ThreeVector(-x/r, y/r,-z/r); 9344 // else return G4ThreeVector(-x/r, y/r, z/r); 9345 // } 9346 // } 9347 // else 9348 // { 9349 // if(quad>0.25) 9350 // { 9351 // if(quad>0.375) return G4ThreeVector( x/r,-y/r,-z/r); 9352 // else return G4ThreeVector( x/r,-y/r, z/r); 9353 // } 9354 // else if(quad>0.125) return G4ThreeVector( x/r, y/r,-z/r); 9355 // } 9356 // return G4ThreeVector( x/r, y/r, z/r); 9357 //} // End of RndmDir -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QException.cc
r1055 r1196 26 26 // 27 27 // $Id: G4QException.cc,v 1.10 2009/02/23 09:49:24 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QException ---------------- -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QHadron.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QHadron.cc,v 1. 54 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QHadron.cc,v 1.64 2009/09/02 15:45:19 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QHadron ---------------- … … 39 39 // 40 40 //#define debug 41 //#define edebug 41 42 //#define pdebug 42 43 //#define sdebug … … 47 48 using namespace std; 48 49 49 G4double G4QHadron::alpha = -0.5; // changing rapidity distribution for all50 G4double G4QHadron::beta = 2.5; // changing rapidity distribution for projectile region51 G4double G4QHadron::theMinPz = 70.*MeV; // Can be from 14 to 140 MeV52 50 G4double G4QHadron::StrangeSuppress = 0.48; // ? M.K. 53 G4double G4QHadron::sigmaPt = 1.7*GeV; // Can be 0 51 G4double G4QHadron::sigmaPt = 1.7*GeV; // Can be 0 ? 54 52 G4double G4QHadron::widthOfPtSquare = 0.01*GeV*GeV; // ? M.K. 55 G4double G4QHadron::minTransverseMass = 1.*keV; // ? M.K. 56 57 G4QHadron::G4QHadron() : theQPDG(0),theMomentum(0.,0.,0.,0.),valQ(0,0,0,0,0,0),nFragm(0), 58 thePosition(0.,0.,0.),theCollisionCount(0),isSplit(false),Direction(true), 59 Color(),AntiColor(),bindE(0.),formTime(0.) {} 60 61 G4QHadron::G4QHadron(G4LorentzVector p) : theQPDG(0),theMomentum(p),valQ(0,0,0,0,0,0), 53 54 G4QHadron::G4QHadron(): theMomentum(0.,0.,0.,0.), theQPDG(0), valQ(0,0,0,0,0,0), nFragm(0), 55 thePosition(0.,0.,0.), theCollisionCount(0), isSplit(false), Direction(true), 56 Color(), AntiColor(), bindE(0.), formTime(0.) {} 57 58 G4QHadron::G4QHadron(G4LorentzVector p): theMomentum(p), theQPDG(0), valQ(0,0,0,0,0,0), 59 nFragm(0), thePosition(0.,0.,0.), theCollisionCount(0), isSplit(false), Direction(true), 60 Color(), AntiColor(), bindE(0.), formTime(0.) {} 61 62 // For Chipolino or Quasmon doesn't make any sense 63 G4QHadron::G4QHadron(G4int PDGCode, G4LorentzVector p): theMomentum(p), theQPDG(PDGCode), 62 64 nFragm(0),thePosition(0.,0.,0.),theCollisionCount(0),isSplit(false),Direction(true), 63 Color(),AntiColor(),bindE(0.),formTime(0.) {} 64 65 // For Chipolino or Quasmon doesn't make any sense 66 G4QHadron::G4QHadron(G4int PDGCode, G4LorentzVector p) : theQPDG(PDGCode),theMomentum(p), 67 nFragm(0),thePosition(0.,0.,0.),theCollisionCount(0),isSplit(false),Direction(true), 68 Color(),AntiColor(),bindE(0.),formTime(0.) 65 Color(), AntiColor(), bindE(0.), formTime(0.) 69 66 { 70 67 #ifdef debug … … 84 81 85 82 // For Chipolino or Quasmon doesn't make any sense 86 G4QHadron::G4QHadron(G4QPDGCode QPDG, G4LorentzVector p) : theQPDG(QPDG),theMomentum(p),87 nFragm(0), thePosition(0.,0.,0.),theCollisionCount(0),isSplit(false),Direction(true),88 Color(), AntiColor(),bindE(0.),formTime(0.)83 G4QHadron::G4QHadron(G4QPDGCode QPDG, G4LorentzVector p): theMomentum(p), theQPDG(QPDG), 84 nFragm(0), thePosition(0.,0.,0.), theCollisionCount(0), isSplit(false), Direction(true), 85 Color(), AntiColor(), bindE(0.), formTime(0.) 89 86 { 90 87 if(theQPDG.GetQCode()>-1) … … 102 99 103 100 // Make sense Chipolino or Quasmon 104 G4QHadron::G4QHadron(G4QContent QC, G4LorentzVector p): the QPDG(0),theMomentum(p),valQ(QC),105 nFragm(0), thePosition(0.,0.,0.),theCollisionCount(0),isSplit(false),Direction(true),106 Color(), AntiColor(),bindE(0.),formTime(0.)101 G4QHadron::G4QHadron(G4QContent QC, G4LorentzVector p): theMomentum(p),theQPDG(0),valQ(QC), 102 nFragm(0), thePosition(0.,0.,0.), theCollisionCount(0), isSplit(false), Direction(true), 103 Color(), AntiColor(), bindE(0.), formTime(0.) 107 104 { 108 105 G4int curPDG=valQ.GetSPDGCode(); … … 113 110 114 111 G4QHadron::G4QHadron(G4int PDGCode, G4double aMass, G4QContent QC) : 115 the QPDG(PDGCode),theMomentum(0.,0.,0., aMass),valQ(QC),nFragm(0),thePosition(0.,0.,0.),116 theCollisionCount(0), isSplit(false),Direction(true),Color(),AntiColor(),bindE(0.),112 theMomentum(0.,0.,0.,aMass), theQPDG(PDGCode), valQ(QC), nFragm(0),thePosition(0.,0.,0.), 113 theCollisionCount(0), isSplit(false), Direction(true), Color(), AntiColor(), bindE(0.), 117 114 formTime(0.) 118 115 {} 119 116 120 117 G4QHadron::G4QHadron(G4QPDGCode QPDG, G4double aMass, G4QContent QC) : 121 the QPDG(QPDG),theMomentum(0.,0.,0., aMass),valQ(QC),nFragm(0),thePosition(0.,0.,0.),122 theCollisionCount(0), isSplit(false),Direction(true),Color(),AntiColor(),bindE(0.),118 theMomentum(0.,0.,0.,aMass), theQPDG(QPDG), valQ(QC), nFragm(0), thePosition(0.,0.,0.), 119 theCollisionCount(0), isSplit(false), Direction(true), Color(), AntiColor(), bindE(0.), 123 120 formTime(0.) 124 121 {} 125 122 126 G4QHadron::G4QHadron(G4int PDGCode, G4LorentzVector p, G4QContent QC) : 127 theQPDG(PDGCode),theMomentum(p),valQ(QC),nFragm(0),thePosition(0.,0.,0.), 128 theCollisionCount(0),isSplit(false),Direction(true),Color(),AntiColor(),bindE(0.), 129 formTime(0.) 123 G4QHadron::G4QHadron(G4int PDGCode, G4LorentzVector p, G4QContent QC) : theMomentum(p), 124 theQPDG(PDGCode), valQ(QC), nFragm(0), thePosition(0.,0.,0.), theCollisionCount(0), 125 isSplit(false), Direction(true), Color(), AntiColor(), bindE(0.), formTime(0.) 130 126 {} 131 127 132 G4QHadron::G4QHadron(G4QPDGCode QPDG, G4LorentzVector p, G4QContent QC) : 133 theQPDG(QPDG),theMomentum(p),valQ(QC),nFragm(0),thePosition(0.,0.,0.), 134 theCollisionCount(0),isSplit(false),Direction(true),Color(),AntiColor(),bindE(0.), 135 formTime(0.) 128 G4QHadron::G4QHadron(G4QPDGCode QPDG, G4LorentzVector p, G4QContent QC) : theMomentum(p), 129 theQPDG(QPDG), valQ(QC), nFragm(0), thePosition(0.,0.,0.), theCollisionCount(0), 130 isSplit(false), Direction(true), Color(), AntiColor(), bindE(0.), formTime(0.) 136 131 {} 137 132 138 G4QHadron::G4QHadron(G4QParticle* pPart, G4double maxM) : 139 theQPDG(pPart->GetQPDG()),theMomentum(0.,0.,0.,0.),nFragm(0),thePosition(0.,0.,0.), 140 theCollisionCount(0),isSplit(false),Direction(true),Color(),AntiColor(),bindE(0.), 141 formTime(0.) 133 G4QHadron::G4QHadron(G4QParticle* pPart, G4double maxM) : theMomentum(0.,0.,0.,0.), 134 theQPDG(pPart->GetQPDG()), nFragm(0), thePosition(0.,0.,0.), theCollisionCount(0), 135 isSplit(false), Direction(true), Color(), AntiColor(), bindE(0.), formTime(0.) 142 136 { 143 137 #ifdef debug … … 567 561 else if (iM+.001<fM+sM || iM==0.) 568 562 { 569 #ifdef pdebug563 #ifdef debug 570 564 G4cerr<<"***G4QHadron::DecayIn2*** fM="<<fM<<" + sM="<<sM<<"="<<fM+sM<<" > iM="<<iM 571 565 <<", d="<<iM-fM-sM<<G4endl; … … 618 612 } 619 613 G4ThreeVector ltb = theMomentum.boostVector(); // Boost vector for backward Lor.Trans. 620 #ifdef pdebug614 #ifdef debug 621 615 G4cout<<"G4QHadron::DecIn2:LorTrans v="<<ltb<<",f4Mom="<<f4Mom<<",s4Mom="<<s4Mom<<G4endl; 622 616 #endif … … 625 619 if(s4Mom.e()+.001<s4Mom.rho())G4cerr<<"*G4QH::DecIn2:*Boost* s4M="<<s4Mom<<G4endl; 626 620 s4Mom.boost(ltb); // Lor.Trans. of 2nd hadron back to LS 627 #ifdef pdebug621 #ifdef debug 628 622 G4cout<<"G4QHadron::DecayIn2: ROOT OUTPUT f4Mom="<<f4Mom<<", s4Mom="<<s4Mom<<G4endl; 629 623 #endif … … 637 631 G4LorentzVector comp=theMomentum+fr4Mom; // 4Mom of the decaying compound system 638 632 G4double iM = comp.m(); // mass of the decaying compound system 639 #ifdef pdebug633 #ifdef debug 640 634 G4cout<<"G4QH::CMDIn2: iM="<<iM<<comp<<"=>fM="<<fM<<"+corM="<<corM<<"="<<fM+corM<<G4endl; 641 635 #endif … … 662 656 if (p2<0.) 663 657 { 664 #ifdef pdebug658 #ifdef debug 665 659 G4cerr<<"**G4QH::CMDI2:p2="<<p2<<"<0,d="<<d2*d2/4.<<"<4*fM2*hM2="<<4*fM2*corM2<<G4endl; 666 660 #endif … … 718 712 theMomentum.setVect((-1)*pVect); 719 713 theMomentum.setE(sqrt(corM2+p2)); 720 #ifdef pdebug714 #ifdef debug 721 715 G4LorentzVector dif2=comp-fr4Mom-theMomentum; 722 716 G4cout<<"G4QH::CorMDIn2:c="<<comp<<"-f="<<fr4Mom<<"-4M="<<theMomentum<<"="<<dif2<<G4endl; … … 730 724 } 731 725 theMomentum.boost(ltb); // Lor.Trans. of the Hadron back to LS 732 #ifdef pdebug726 #ifdef debug 733 727 G4LorentzVector dif3=comp-fr4Mom-theMomentum; 734 728 G4cout<<"G4QH::CorMDecIn2:OUTPUT:f4M="<<fr4Mom<<",h4M="<<theMomentum<<"d="<<dif3<<G4endl; … … 742 736 {// =============================================================== 743 737 G4double fE = fr4Mom.m(); // Energy of the Fragment 744 #ifdef pdebug738 #ifdef debug 745 739 G4cout<<"G4QH::CorEDecIn2:fE="<<fE<<fr4Mom<<">corE="<<corE<<",h4M="<<theMomentum<<G4endl; 746 740 #endif 747 741 if (fE+.001<=corE) 748 742 { 749 #ifdef pdebug743 #ifdef debug 750 744 G4cerr<<"***G4QHadron::CorEDecIn2*** fE="<<fE<<"<corE="<<corE<<", d="<<corE-fE<<G4endl; 751 745 #endif … … 770 764 ///////////G4double mM2=theMomentum.m2(); 771 765 theMomentum= G4LorentzVector(Px,Py,Pz,mE+corE); 772 #ifdef pdebug766 #ifdef debug 773 767 G4double difF=fr4Mom.m2()-fM2; 774 768 G4cout<<"G4QH::CorEDecIn2: dF="<<difF<<",out:"<<theMomentum<<fr4Mom<<G4endl; … … 1079 1073 } 1080 1074 1081 // Split hadron in partons1075 // Split the hadron in two partons ( quark = anti-diquark v.s. anti-quark = diquark) 1082 1076 void G4QHadron::SplitUp() 1083 1077 { 1084 if (IsSplit()) return; 1085 Splitting(); 1086 if (Color.empty()) return; 1087 if (GetSoftCollisionCount() == 0) 1088 { 1089 // Diffractive splitting: take the particle definition and get the partons 1078 if (isSplit) return; 1079 #ifdef pdebug 1080 G4cout<<"G4QHadron::SplitUp ***IsCalled***, before Splitting nC="<<Color.size() 1081 <<", SoftColCount="<<theCollisionCount<<G4endl; 1082 #endif 1083 isSplit=true; // PutUp isSplit flag to avoid remake 1084 if (!Color.empty()) return; // Do not split if it is already split 1085 if (!theCollisionCount) // Diffractive splitting from particDef 1086 { 1090 1087 G4QParton* Left = 0; 1091 1088 G4QParton* Right = 0; 1092 1089 GetValenceQuarkFlavors(Left, Right); 1093 Left->SetPosition(GetPosition()); 1094 Right->SetPosition(GetPosition()); 1090 G4ThreeVector Pos=GetPosition(); 1091 Left->SetPosition(Pos); 1092 Right->SetPosition(Pos); 1095 1093 1096 G4LorentzVector HadronMom = Get4Momentum(); 1097 //G4cout<<"DSU 1 - "<<HadronMom<<G4endl; 1094 G4double theMomPlus = theMomentum.plus(); // E+pz 1095 G4double theMomMinus = theMomentum.minus(); // E-pz 1096 #ifdef pdebug 1097 G4cout<<"G4QHadron::SplitUp: *Dif* possition="<<Pos<<", 4M="<<theMomentum<<G4endl; 1098 #endif 1098 1099 1099 1100 // momenta of string ends 1100 G4double pt2 = HadronMom.perp2(); 1101 G4double transverseMass2 = HadronMom.plus()*HadronMom.minus(); 1101 G4double pt2 = theMomentum.perp2(); 1102 G4double transverseMass2 = theMomPlus*theMomMinus; 1103 if(transverseMass2<0.) transverseMass2=0.; 1102 1104 G4double maxAvailMomentum2 = sqr(std::sqrt(transverseMass2) - std::sqrt(pt2)); 1103 G4ThreeVector pt(minTransverseMass, minTransverseMass, 0); 1104 if(maxAvailMomentum2/widthOfPtSquare>0.01) 1105 pt=GaussianPt(widthOfPtSquare, maxAvailMomentum2); 1106 //G4cout<<"DSU 1.1 - "<<maxAvailMomentum2<<", pt="<<pt<<G4endl; 1107 1105 G4ThreeVector pt(0., 0., 0.); // Prototype 1106 if(maxAvailMomentum2/widthOfPtSquare > 0.01) 1107 pt=GaussianPt(widthOfPtSquare, maxAvailMomentum2); 1108 #ifdef pdebug 1109 G4cout<<"G4QHadron::SplitUp: *Dif* maxMom2="<<maxAvailMomentum2<<", pt="<<pt<<G4endl; 1110 #endif 1108 1111 G4LorentzVector LeftMom(pt, 0.); 1109 1112 G4LorentzVector RightMom; 1110 RightMom.setPx( HadronMom.px() - pt.x());1111 RightMom.setPy( HadronMom.py() - pt.y());1112 //G4cout<<"DSU 2: Right4M="<<RightMom<<", Left4M= "<<LeftMom<<G4endl; 1113 1114 G4double Local1 = HadronMom.minus() + 1115 (RightMom.perp2() - LeftMom.perp2()) / HadronMom.plus();1113 RightMom.setPx(theMomentum.px() - pt.x()); 1114 RightMom.setPy(theMomentum.py() - pt.y()); 1115 #ifdef pdebug 1116 G4cout<<"G4QHadron::SplitUp: *Dif* right4m="<<RightMom<<", left4M="<<LeftMom<<G4endl; 1117 #endif 1118 G4double Local1 = theMomMinus + (RightMom.perp2() - LeftMom.perp2()) / theMomPlus; 1116 1119 G4double Local2 = std::sqrt(std::max(0., Local1*Local1 - 1117 4*RightMom.perp2()*HadronMom.minus() / HadronMom.plus())); 1118 //G4cout<<"DSU 3: L1="<< Local1 <<", L2="<<Local2<<G4endl; 1119 1120 4*RightMom.perp2()*theMomMinus / theMomPlus)); 1121 #ifdef pdebug 1122 G4cout<<"G4QHadron::SplitUp:Dif,L1="<<Local1<<",L2="<<Local2<<",D="<<Direction<<G4endl; 1123 #endif 1120 1124 if (Direction) Local2 = -Local2; 1121 1125 G4double RightMinus = 0.5*(Local1 + Local2); 1122 G4double LeftMinus = HadronMom.minus() - RightMinus; 1123 //G4cout<<"DSU 4: Rm="<<RightMinus<<", Lm="<<LeftMinus<<" "<<HadronMom.minus()<<G4endl; 1124 1125 G4double LeftPlus = LeftMom.perp2()/LeftMinus; 1126 G4double RightPlus = HadronMom.plus() - LeftPlus; 1127 //G4cout<<"DSU 5: Rp="<<RightPlus<<", Lp="<<LeftPlus<<G4endl; 1126 G4double LeftMinus = theMomentum.minus() - RightMinus; 1127 #ifdef pdebug 1128 G4cout<<"G4QHadron::SplitUp: *Dif* Rminus="<<RightMinus<<",Lminus="<<LeftMinus<<",hmm=" 1129 <<theMomentum.minus()<<G4endl; 1130 #endif 1131 G4double LeftPlus = 0.; 1132 if(LeftMinus) LeftPlus = LeftMom.perp2()/LeftMinus; 1133 G4double RightPlus = theMomentum.plus() - LeftPlus; 1134 #ifdef pdebug 1135 G4cout<<"G4QHadron::SplitUp: *Dif* Rplus="<<RightPlus<<", Lplus="<<LeftPlus<<G4endl; 1136 #endif 1128 1137 LeftMom.setPz(0.5*(LeftPlus - LeftMinus)); 1129 1138 LeftMom.setE (0.5*(LeftPlus + LeftMinus)); … … 1131 1140 RightMom.setE (0.5*(RightPlus + RightMinus)); 1132 1141 //G4cout<<"DSU 6: Left4M="<<LeftMom<<", Right4M="<<RightMom<<G4endl; 1142 #ifdef pdebug 1143 G4cout<<"G4QHadron::SplitUp: *Dif* -final- R4m="<<RightMom<<", L4M="<<LeftMom<<", L+R=" 1144 <<RightMom+LeftMom<<", D4M="<<theMomentum-RightMom+LeftMom<<G4endl; 1145 #endif 1133 1146 Left->Set4Momentum(LeftMom); 1134 1147 Right->Set4Momentum(RightMom); … … 1139 1152 { 1140 1153 // Soft hadronization splitting: sample transversal momenta for sea and valence quarks 1141 G4double phi, pts; 1142 G4double SumPy = 0.; 1143 G4double SumPx = 0.; 1144 G4ThreeVector Pos = GetPosition(); 1145 G4int nSeaPair = GetSoftCollisionCount()-1; 1146 1154 //G4double phi, pts; 1155 G4ThreeVector SumP(0.,0.,0.); // Remember the hadron position 1156 G4ThreeVector Pos = GetPosition(); // Remember the hadron position 1157 G4int nSeaPair = theCollisionCount-1; // a#of sea-pairs 1158 #ifdef pdebug 1159 G4cout<<"G4QHadron::SplitUp:*Soft* Pos="<<Pos<<", nSeaPair="<<nSeaPair<<G4endl; 1160 #endif 1147 1161 // here the condition,to ensure viability of splitting, also in cases 1148 1162 // where difractive excitation occured together with soft scattering. 1149 //G4double LightConeMomentum=(Direction)? Get4Momentum().plus():Get4Momentum().minus(); 1150 //G4double Xmin = theMinPz/LightConeMomentum; 1151 G4double Xmin = theMinPz/( Get4Momentum().e() - GetMass() ); 1152 while(Xmin>=1-(2*nSeaPair+1)*Xmin) Xmin*=0.95; 1153 1154 G4int aSeaPair; 1155 for (aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++) 1163 for (G4int aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++) // If the sea pairs exist! 1156 1164 { 1157 1165 // choose quark flavour, d:u:s = 1:1:(1/StrangeSuppress-2) … … 1160 1168 // BuildSeaQuark() determines quark spin, isospin and colour 1161 1169 // via parton-constructor G4QParton(aPDGCode) 1162 G4QParton* aParton = BuildSeaQuark(false, aPDGCode); 1163 1164 // G4cout << "G4QGSMSplitableHadron::SoftSplitUp()" << G4endl; 1165 1166 // G4cout << "Parton 1: " 1167 // << " PDGcode: " << aPDGCode 1168 // << " - Name: " << aParton->GetDefinition()->GetParticleName() 1169 // << " - Type: " << aParton->GetDefinition()->GetParticleType() 1170 // << " - Spin-3: " << aParton->GetSpinZ() 1171 // << " - Colour: " << aParton->GetColour() << G4endl; 1170 G4QParton* aParton = BuildSeaQuark(false, aPDGCode); // quark/anti-diquark creation 1172 1171 1173 1172 // save colour a spin-3 for anti-quark 1174 1173 G4int firstPartonColour = aParton->GetColour(); 1175 1174 G4double firstPartonSpinZ = aParton->GetSpinZ(); 1176 1177 SumPx += aParton->Get4Momentum().px(); 1178 SumPy += aParton->Get4Momentum().py(); 1179 Color.push_back(aParton); 1175 #ifdef pdebug 1176 G4cout<<"G4QHadron::SplitUp:*Soft* Part1 PDG="<<aPDGCode<<", Col="<<firstPartonColour 1177 <<", SpinZ="<<firstPartonSpinZ<<", 4M="<<aParton->Get4Momentum()<<G4endl; 1178 #endif 1179 SumP+=aParton->Get4Momentum(); 1180 Color.push_back(aParton); // Quark/anti-diquark is filled 1180 1181 1181 1182 // create anti-quark 1182 aParton = BuildSeaQuark(true, aPDGCode); 1183 aParton = BuildSeaQuark(true, aPDGCode); // Redefine "aParton" (working pointer) 1183 1184 aParton->SetSpinZ(-firstPartonSpinZ); 1184 1185 aParton->SetColour(-firstPartonColour); 1185 1186 // G4cout << "Parton 2: " 1187 // << " PDGcode: " << -aPDGCode 1188 // << " - Name: " << aParton->GetDefinition()->GetParticleName() 1189 // << " - Type: " << aParton->GetDefinition()->GetParticleType() 1190 // << " - Spin-3: " << aParton->GetSpinZ() 1191 // << " - Colour: " << aParton->GetColour() << G4endl; 1192 // G4cerr << "------------" << G4endl; 1193 1194 SumPx += aParton->Get4Momentum().px(); 1195 SumPy += aParton->Get4Momentum().py(); 1196 AntiColor.push_back(aParton); 1197 } 1198 // Valence quark 1199 G4QParton* pColorParton = 0; 1200 G4QParton* pAntiColorParton = 0; 1186 #ifdef pdebug 1187 G4cout<<"G4QHadron::SplUp:Sft,P2="<<aParton->Get4Momentum()<<",i="<<aSeaPair<<G4endl; 1188 #endif 1189 1190 SumP+=aParton->Get4Momentum(); 1191 AntiColor.push_back(aParton); // Anti-quark/diquark is filled 1192 #ifdef pdebug 1193 G4cout<<"G4QHadron::SplUp:*Sft* Antiquark is filled, i="<<aSeaPair<<G4endl; 1194 #endif 1195 } 1196 // ---- Create valence quarks/diquarks 1197 G4QParton* pColorParton = 0; 1198 G4QParton* pAntiColorParton = 0; 1201 1199 GetValenceQuarkFlavors(pColorParton, pAntiColorParton); 1202 1200 G4int ColorEncoding = pColorParton->GetPDGCode(); 1201 #ifdef pdebug 1203 1202 G4int AntiColorEncoding = pAntiColorParton->GetPDGCode(); 1204 1205 pts = sigmaPt*std::sqrt(-std::log(G4UniformRand())); 1206 phi = twopi*G4UniformRand();1207 G4double Px = pts*std::cos(phi);1208 G4double Py = pts*std::sin(phi); 1209 SumPx += Px;1210 SumPy += Py; 1203 G4cout<<"G4QHadron::SplUp:*Sft*,C="<<ColorEncoding<<", AC="<<AntiColorEncoding<<G4endl; 1204 #endif 1205 G4ThreeVector ptr = GaussianPt(sigmaPt, DBL_MAX); 1206 SumP += ptr; 1207 #ifdef pdebug 1208 G4cout<<"G4QHadron::SplitUp: *Sft*, ptr="<<ptr<<G4endl; 1209 #endif 1211 1210 1212 1211 if (ColorEncoding < 0) // use particle definition 1213 1212 { 1214 G4LorentzVector ColorMom(-SumP x, -SumPy, 0, 0);1213 G4LorentzVector ColorMom(-SumP, 0); 1215 1214 pColorParton->Set4Momentum(ColorMom); 1216 G4LorentzVector AntiColorMom( Px, Py, 0, 0);1215 G4LorentzVector AntiColorMom(ptr, 0.); 1217 1216 pAntiColorParton->Set4Momentum(AntiColorMom); 1218 1217 } 1219 1218 else 1220 1219 { 1221 G4LorentzVector ColorMom( Px, Py, 0, 0);1220 G4LorentzVector ColorMom(ptr, 0); 1222 1221 pColorParton->Set4Momentum(ColorMom); 1223 G4LorentzVector AntiColorMom(-SumP x, -SumPy, 0, 0);1222 G4LorentzVector AntiColorMom(-SumP, 0); 1224 1223 pAntiColorParton->Set4Momentum(AntiColorMom); 1225 1224 } 1226 1225 Color.push_back(pColorParton); 1227 1226 AntiColor.push_back(pAntiColorParton); 1228 1227 #ifdef pdebug 1228 G4cout<<"G4QHadron::SplitUp: *Soft* Col&Anticol are filled PDG="<<GetPDGCode()<<G4endl; 1229 #endif 1229 1230 // Sample X 1230 G4int nAttempt = 0; 1231 G4double SumX = 0; 1232 G4double aBeta = beta; 1233 G4double ColorX, AntiColorX; 1234 G4double HPWtest = 0; 1235 G4int aPDG=std::abs(GetPDGCode()); 1236 if (aPDG ==211 || aPDG == 22 || aPDG == 111) aBeta = 1.; 1237 else if (aPDG == 321) aBeta = 0.; 1238 else G4cout<<"-Warning-G4QHadron::SplitUp: wrong PDG="<<GetPDGCode()<<G4endl; 1239 do 1240 { 1241 SumX = 0; 1242 nAttempt++; 1243 G4int NumberOfUnsampledSeaQuarks = 2*nSeaPair; 1244 G4double beta1 = beta; 1245 if (std::abs(ColorEncoding) <= 1000 && std::abs(AntiColorEncoding) <= 1000) beta1 = 1.; //... in a meson 1246 ColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta); 1247 HPWtest = ColorX; 1248 //while (ColorX < Xmin || ColorX > 1. || 1. - ColorX <= Xmin) 1249 //{ 1250 //} 1251 Color.back()->SetX(SumX = ColorX); // this is the valenz quark. 1252 1253 std::list<G4QParton*>::iterator icolor = Color.begin(); 1254 std::list<G4QParton*>::iterator ecolor = Color.end(); 1255 std::list<G4QParton*>::iterator ianticolor = AntiColor.begin(); 1256 std::list<G4QParton*>::iterator eanticolor = AntiColor.end(); 1257 for ( ; icolor != ecolor && ianticolor != eanticolor; ++icolor, ++ianticolor) 1258 { 1259 NumberOfUnsampledSeaQuarks--; 1260 ColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta); 1261 (*icolor)->SetX(ColorX); 1262 SumX += ColorX; 1263 NumberOfUnsampledSeaQuarks--; 1264 AntiColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta); 1265 (*ianticolor)->SetX(AntiColorX); // the 'sea' partons 1266 SumX += AntiColorX; 1267 if (1. - SumX <= Xmin) break; 1268 } 1269 } while (1. - SumX <= Xmin); 1270 AntiColor.back()->SetX(1.0 - SumX); // the di-quark takes the rest, then go to momentum 1271 // and here is the bug ;-) @@@@@@@@@@@@@ 1272 if(getenv("debug_QGSMSplitableHadron")) 1273 G4cout<<"particle energy at split = "<<Get4Momentum().t()<<G4endl; 1274 G4double lightCone = ((!Direction) ? Get4Momentum().minus() : Get4Momentum().plus()); 1275 // lightCone -= 0.5*Get4Momentum().m(); 1276 // hpw testing @@@@@ lightCone = 2.*Get4Momentum().t(); 1277 if(getenv("debug_QGSMSplitableHadron") )G4cout << "Light cone = "<<lightCone<<G4endl; 1231 G4int nColor=Color.size(); 1232 G4int nAntiColor=AntiColor.size(); 1233 if(nColor!=nAntiColor || nColor != nSeaPair+1) 1234 { 1235 G4cerr<<"***G4QHadron::SplitUp: nA="<<nAntiColor<<",nAC="<<nColor<<",nSea="<<nSeaPair 1236 <<G4endl; 1237 G4Exception("G4QHadron::SplitUp:","72",FatalException,"Colours&AntiColours notSinc"); 1238 } 1239 #ifdef pdebug 1240 G4cout<<"G4QHad::SpUp:,nPartons="<<nColor+nColor<<<<G4endl; 1241 #endif 1242 G4int dnCol=nColor+nColor; 1243 // From here two algorithm of splitting can be used (All(default): New, OBO: Olg, Bad) 1244 G4double* xs=RandomX(dnCol); // All-Non-iterative CHIPS algorithm of splitting 1245 // Instead one can try one-by-one CHIPS algorithm (faster? but not exact). OBO comment. 1246 //G4double Xmax=1.; // OBO 1247 #ifdef pdebug 1248 G4cout<<"G4QHadron::SplitUp:*Sft* Loop ColorX="<<ColorX<<G4endl; 1249 #endif 1278 1250 std::list<G4QParton*>::iterator icolor = Color.begin(); 1279 1251 std::list<G4QParton*>::iterator ecolor = Color.end(); 1280 1252 std::list<G4QParton*>::iterator ianticolor = AntiColor.begin(); 1281 1253 std::list<G4QParton*>::iterator eanticolor = AntiColor.end(); 1254 G4int xi=-1; // XIndex for All-Non-interactive CHIPS algorithm 1255 //G4double X=0.; // OBO 1282 1256 for ( ; icolor != ecolor && ianticolor != eanticolor; ++icolor, ++ianticolor) 1283 1257 { 1284 (*icolor)->DefineMomentumInZ(lightCone, Direction); 1285 (*ianticolor)->DefineMomentumInZ(lightCone, Direction); 1286 } 1287 //G4cout <<G4endl<<"XSAMPLE "<<HPWtest<<G4endl; 1258 (*icolor)->SetX(xs[++xi]); // All-Non-iterative CHIPS algorithm of splitting 1259 //X=SampleCHIPSX(Xmax, dnCol); // OBO 1260 //Xmax-=X; // OBO 1261 //--dnCol; // OBO 1262 //(*icolor)->SetX(X); // OBO 1263 // ---- 1264 (*icolor)->DefineEPz(theMomentum); 1265 (*ianticolor)->SetX(xs[++xi]); // All-Non-iterative CHIPS algorithm of splitting 1266 //X=SampleCHIPSX(Xmax, dnCol); // OBO 1267 //Xmax-=X; // OBO 1268 //--dnCol; // OBO 1269 //(*ianticolor)->SetX(X); // OBO 1270 // ---- 1271 (*ianticolor)->DefineEPz(theMomentum); 1272 } 1273 delete[] xs; // The calculated array must be deleted (All) 1274 #ifdef pdebug 1275 G4cout<<"G4QHadron::SplitUp: *Soft* ===> End, ColSize="<<Color.size()<<G4endl; 1276 #endif 1288 1277 return; 1289 1278 } … … 1312 1301 } // End of BuildSeaQuark 1313 1302 1314 G4double G4QHadron::SampleX(G4double anXmin, G4int nSea, G4int totalSea, G4double aBeta) 1315 { 1316 G4double result; 1317 G4double x1, x2; 1318 G4double ymax = 0; 1319 for(G4int ii=0; ii<100; ii++) // @@ 100 is hardwired ? M.K. 1320 { 1321 G4double y = std::pow(1./G4double(ii), alpha); 1322 y*=std::pow(std::pow(1.-anXmin-totalSea*anXmin,alpha+1)-std::pow(anXmin,alpha+1),nSea); 1323 y*=std::pow(1.-anXmin-totalSea*anXmin, aBeta+1) - std::pow(anXmin, aBeta+1); 1324 if(y>ymax) ymax = y; 1325 } 1326 G4double y; 1327 G4double xMax=1.-(totalSea+1.)*anXmin; 1328 if(anXmin > xMax) 1329 { 1330 G4cerr<<"***G4QHadron::SampleX: anXmin="<<anXmin<<" > xMax="<<xMax<<", nSea="<<nSea 1331 <<", totSea="<<totalSea<<G4endl; 1332 G4Exception("G4QHadron::SampleX:","72",FatalException,"TooBigXValue"); 1333 } 1334 do 1335 { 1336 x1 = CLHEP::RandFlat::shoot(anXmin, xMax); 1337 y = std::pow(x1, alpha); 1338 y*=std::pow(std::pow(1.-x1-totalSea*anXmin,alpha+1) - std::pow(anXmin, alpha+1), nSea); 1339 y*=std::pow(1.-x1-totalSea*anXmin, aBeta+1) - std::pow(anXmin, aBeta+1); 1340 x2 = ymax*G4UniformRand(); 1341 } while(x2>y); 1342 result = x1; 1343 return result; 1344 } // End of SampleX 1345 1346 1303 // Fast non-iterative CHIPS algorithm 1304 G4double* G4QHadron::RandomX(G4int nPart) 1305 { 1306 G4double* x = 0; 1307 if(nPart<2) 1308 { 1309 G4cout<<"-Warning-G4QHadron::RandomX: nPart="<<nPart<<" < 2"<<G4endl; 1310 return x; 1311 } 1312 x = new G4double[nPart]; 1313 G4int nP1=nPart-1; 1314 x[0]=G4UniformRand(); 1315 for(G4int i=1; i<nP1; ++i) 1316 { 1317 G4double r=G4UniformRand(); 1318 G4int j=0; 1319 for( ; j<i; ++j) if(r < x[j]) 1320 { 1321 for(G4int k=i; k>j; --k) x[k]=x[k-1]; 1322 x[j]=r; 1323 break; 1324 } 1325 if(j==i) x[i]=r; 1326 } 1327 x[nP1]=1.; 1328 for(G4int i=nP1; i>0; --i) x[i]-=x[i-1]; 1329 return x; 1330 } 1331 1332 // Non-iterative recursive phase-space CHIPS algorthm 1333 G4double G4QHadron::SampleCHIPSX(G4double anXtot, G4int nSea) 1334 { 1335 G4double ns=nSea; 1336 if(nSea<1 || anXtot<=0.) G4cout<<"-Warning-G4QHad::SCX:N="<<nSea<<",tX="<<anXtot<<G4endl; 1337 if(nSea<2) return anXtot; 1338 return anXtot*(1.-std::pow(G4UniformRand(),1./ns)); 1339 } 1340 1341 // Get flavors for the valence quarks of this hadron 1347 1342 void G4QHadron::GetValenceQuarkFlavors(G4QParton* &Parton1, G4QParton* &Parton2) 1348 1343 { … … 1351 1346 G4int bEnd=0; 1352 1347 G4int HadronEncoding = GetPDGCode(); 1353 if(!(GetBaryonNumber())) SplitMeson(HadronEncoding, &aEnd,&bEnd);1354 else SplitBaryon(HadronEncoding, &aEnd, &bEnd);1348 if(!(GetBaryonNumber())) SplitMeson(HadronEncoding, &aEnd, &bEnd); 1349 else SplitBaryon(HadronEncoding, &aEnd, &bEnd); 1355 1350 1356 1351 Parton1 = new G4QParton(aEnd); … … 1404 1399 G4int absPDGcode = std::abs(PDGcode); 1405 1400 if (absPDGcode >= 1000) return false; 1406 if(absPDGcode == 22 )1401 if(absPDGcode == 22 || absPDGcode == 111) // only u-ubar, d-dbar configurations 1407 1402 { 1408 1403 G4int it=1; … … 1410 1405 *aEnd = it; 1411 1406 *bEnd = -it; 1407 } 1408 else if(absPDGcode == 130 || absPDGcode == 310) // K0-K0bar mixing 1409 { 1410 G4int it=1; 1411 if(G4UniformRand()<.5) it=-1; 1412 *aEnd = it; 1413 if(it>0) *bEnd = -3; 1414 else *bEnd = 3; 1412 1415 } 1413 1416 else … … 1439 1442 G4int nc=0; 1440 1443 G4int aPDGcode=std::abs(PDGcode); 1441 if(aPDGcode==2212) 1444 if(aPDGcode==2212) // ==> Proton 1442 1445 { 1443 1446 nc=3; … … 1446 1449 qdq[2]=make_pair(2101, 2); prb[2]=r2; // ud_0, u 1447 1450 } 1448 else if(aPDGcode==2112) 1451 else if(aPDGcode==2112) // ==> Neutron 1449 1452 { 1450 1453 nc=3; … … 1453 1456 qdq[2]=make_pair(1103, 2); prb[2]=r3; // dd_1, u 1454 1457 } 1455 else if(aPDGcode%10<3) 1456 { 1457 if(aPDGcode==3122) 1458 else if(aPDGcode%10<3) // ==> Spin 1/2 Hyperons 1459 { 1460 if(aPDGcode==3122) // Lambda 1458 1461 { 1459 1462 nc=5; … … 1464 1467 qdq[4]=make_pair(3101, 2); prb[4]=r12; // sd_0, u 1465 1468 } 1466 else if(aPDGcode==3222) 1469 else if(aPDGcode==3222) // Sigma+ 1467 1470 { 1468 1471 nc=3; 1469 qdq[0]=make_pair(2203, 3); prb[0]=r3; 1470 qdq[1]=make_pair(3203, 2); prb[1]=r6; 1471 qdq[2]=make_pair(3201, 2); prb[2]=r2; 1472 } 1473 else if(aPDGcode==3212) 1472 qdq[0]=make_pair(2203, 3); prb[0]=r3; // uu_1, s 1473 qdq[1]=make_pair(3203, 2); prb[1]=r6; // su_1, d 1474 qdq[2]=make_pair(3201, 2); prb[2]=r2; // su_0, d 1475 } 1476 else if(aPDGcode==3212) // Sigma0 1474 1477 { 1475 1478 nc=5; 1476 qdq[0]=make_pair(2103, 3); prb[0]=r3; 1477 qdq[1]=make_pair(3203, 1); prb[1]=r12; 1478 qdq[2]=make_pair(3201, 1); prb[2]=r4; 1479 qdq[3]=make_pair(3103, 2); prb[3]=r12; 1480 qdq[4]=make_pair(3101, 2); prb[4]=r4; 1481 } 1482 else if(aPDGcode==3112) 1479 qdq[0]=make_pair(2103, 3); prb[0]=r3; // ud_1, s 1480 qdq[1]=make_pair(3203, 1); prb[1]=r12; // su_1, d 1481 qdq[2]=make_pair(3201, 1); prb[2]=r4; // su_0, d 1482 qdq[3]=make_pair(3103, 2); prb[3]=r12; // sd_1, u 1483 qdq[4]=make_pair(3101, 2); prb[4]=r4; // sd_0, u 1484 } 1485 else if(aPDGcode==3112) // Sigma- 1483 1486 { 1484 1487 nc=3; 1485 qdq[0]=make_pair(1103, 3); prb[0]=r3; 1486 qdq[1]=make_pair(3103, 1); prb[1]=r6; 1487 qdq[2]=make_pair(3101, 1); prb[2]=r2; 1488 } 1489 else if(aPDGcode==3312) 1488 qdq[0]=make_pair(1103, 3); prb[0]=r3; // dd_1, s 1489 qdq[1]=make_pair(3103, 1); prb[1]=r6; // sd_1, d 1490 qdq[2]=make_pair(3101, 1); prb[2]=r2; // sd_0, d 1491 } 1492 else if(aPDGcode==3312) // Xi- 1490 1493 { 1491 1494 nc=3; 1492 qdq[0]=make_pair(3103, 3); prb[0]=r6; 1493 qdq[1]=make_pair(3101, 3); prb[1]=r2; 1494 qdq[2]=make_pair(3303, 1); prb[2]=r3; 1495 } 1496 else if(aPDGcode==3322) 1495 qdq[0]=make_pair(3103, 3); prb[0]=r6; // sd_1, s 1496 qdq[1]=make_pair(3101, 3); prb[1]=r2; // sd_0, s 1497 qdq[2]=make_pair(3303, 1); prb[2]=r3; // ss_1, d 1498 } 1499 else if(aPDGcode==3322) // Xi0 1497 1500 { 1498 1501 nc=3; 1499 qdq[0]=make_pair(3203, 3); prb[0]=r6; 1500 qdq[1]=make_pair(3201, 3); prb[1]=r2; 1501 qdq[2]=make_pair(3303, 2); prb[2]=r3; 1502 qdq[0]=make_pair(3203, 3); prb[0]=r6; // su_1, s 1503 qdq[1]=make_pair(3201, 3); prb[1]=r2; // su_0, s 1504 qdq[2]=make_pair(3303, 2); prb[2]=r3; // ss_1, u 1502 1505 } 1503 1506 else return false; … … 1508 1511 { 1509 1512 nc=1; 1510 qdq[0]=make_pair(3303, 3); prb[0]=1.; 1513 qdq[0]=make_pair(3303, 3); prb[0]=1.; // ss_1, s 1511 1514 } 1512 1515 else if(aPDGcode==2224) 1513 1516 { 1514 1517 nc=1; 1515 qdq[0]=make_pair(2203, 2); prb[0]=1.; 1518 qdq[0]=make_pair(2203, 2); prb[0]=1.; // uu_1, s 1516 1519 } 1517 1520 else if(aPDGcode==2214) 1518 1521 { 1519 1522 nc=2; 1520 qdq[0]=make_pair(2203, 1); prb[0]=r3; 1521 qdq[1]=make_pair(2103, 2); prb[1]=d3; 1523 qdq[0]=make_pair(2203, 1); prb[0]=r3; // uu_1, d 1524 qdq[1]=make_pair(2103, 2); prb[1]=d3; // ud_1, u 1522 1525 } 1523 1526 else if(aPDGcode==2114) 1524 1527 { 1525 1528 nc=2; 1526 qdq[0]=make_pair( 2103, 1); prb[0]=d3;1527 qdq[1]=make_pair(2103, 2); prb[1]=r3;1529 qdq[0]=make_pair(1103, 2); prb[0]=r3; // dd_1, u 1530 qdq[1]=make_pair(2103, 1); prb[1]=d3; // ud_1, d 1528 1531 } 1529 1532 else if(aPDGcode==1114) 1530 1533 { 1531 1534 nc=1; 1532 qdq[0]=make_pair(1103, 1); prb[0]=1.; 1535 qdq[0]=make_pair(1103, 1); prb[0]=1.; // uu_1, s 1533 1536 } 1534 1537 else if(aPDGcode==3224) 1535 1538 { 1536 1539 nc=2; 1537 qdq[0]=make_pair(2203, 3); prb[0]=r3; 1538 qdq[1]=make_pair(3203, 2); prb[1]=d3; 1539 } 1540 else if(aPDGcode==3214) 1540 qdq[0]=make_pair(2203, 3); prb[0]=r3; // uu_1, s 1541 qdq[1]=make_pair(3203, 2); prb[1]=d3; // su_1, u 1542 } 1543 else if(aPDGcode==3214) // @@ SU(3) is broken because of the s-quark mass 1541 1544 { 1542 1545 nc=3; 1543 qdq[0]=make_pair(2103, 3); prb[0]=r3; 1544 qdq[1]=make_pair(3203, 1); prb[1]=r3; 1545 qdq[2]=make_pair(3103, 2); prb[2]=r3; 1546 qdq[0]=make_pair(2103, 3); prb[0]=r3; // ud_1, s 1547 qdq[1]=make_pair(3203, 1); prb[1]=r3; // su_1, d 1548 qdq[2]=make_pair(3103, 2); prb[2]=r3; // sd_1, u 1546 1549 } 1547 1550 else if(aPDGcode==3114) 1548 1551 { 1549 1552 nc=2; 1550 qdq[0]=make_pair(1103, 3); prb[0]=r3; 1551 qdq[1]=make_pair(3103, 1); prb[1]=d3; 1553 qdq[0]=make_pair(1103, 3); prb[0]=r3; // dd_1, s 1554 qdq[1]=make_pair(3103, 1); prb[1]=d3; // sd_1, d 1552 1555 } 1553 1556 else if(aPDGcode==3324) 1554 1557 { 1555 1558 nc=2; 1556 qdq[0]=make_pair(3203, 3); prb[0]=r3; 1557 qdq[1]=make_pair(3303, 2); prb[1]=d3; 1559 qdq[0]=make_pair(3203, 3); prb[0]=r3; // su_1, s 1560 qdq[1]=make_pair(3303, 2); prb[1]=d3; // ss_1, u 1558 1561 } 1559 1562 else if(aPDGcode==3314) 1560 1563 { 1561 1564 nc=2; 1562 qdq[0]=make_pair(3103, 3); prb[0]=d3; 1563 qdq[1]=make_pair(3303, 1); prb[1]=r3; 1565 qdq[0]=make_pair(3103, 3); prb[0]=d3; // sd_1, s 1566 qdq[1]=make_pair(3303, 1); prb[1]=r3; // ss_1, d 1564 1567 } 1565 1568 else return false; … … 1579 1582 else 1580 1583 { 1581 *diQuark= -qdq[i]. first;1582 *quark = -qdq[i]. second;1584 *diQuark= -qdq[i].second; 1585 *quark = -qdq[i].first; 1583 1586 } 1584 1587 break; … … 1588 1591 } 1589 1592 1593 // This is not usual Gaussian, in fact it is dN/d(pt) ~ pt * exp(-pt^2/pt0^2) 1590 1594 G4ThreeVector G4QHadron::GaussianPt(G4double widthSquare, G4double maxPtSquare) 1591 1595 { … … 1596 1600 return G4ThreeVector(R*std::cos(phi), R*std::sin(phi), 0.); 1597 1601 } 1602 1603 G4QParton* G4QHadron::GetNextParton() 1604 { 1605 if(Color.size()==0) return 0; 1606 G4QParton* result = Color.back(); 1607 Color.pop_back(); 1608 return result; 1609 } 1610 1611 G4QParton* G4QHadron::GetNextAntiParton() 1612 { 1613 if(AntiColor.size() == 0) return 0; 1614 G4QParton* result = AntiColor.front(); 1615 AntiColor.pop_front(); 1616 return result; 1617 } 1618 1619 // Random Split of the Hadron in 2 Partons (caller is responsible for G4QPartonPair delete) 1620 G4QPartonPair* G4QHadron::SplitInTwoPartons() // If result=0: impossible to split (?) 1621 { 1622 if(std::abs(GetBaryonNumber())>1) // Not Baryons or Mesons or Anti-Baryons 1623 { 1624 G4cerr<<"***G4QHadron::SplitInTwoPartons: Can not split QC="<<valQ<< G4endl; 1625 G4Exception("G4QFragmentation::ChooseX:","72",FatalException,"NeitherMesonNorBaryon"); 1626 } 1627 std::pair<G4int,G4int> PP = valQ.MakePartonPair(); 1628 return new G4QPartonPair(new G4QParton(PP.first), new G4QParton(PP.second)); 1629 } -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QInteraction.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QInteraction.cc,v 1. 3 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QInteraction.cc,v 1.6 2009/08/28 14:49:10 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------------ … … 34 34 // Created by Mikhail Kossov Oct, 2006 35 35 // class for colliding particles (hadrons) in Parton String Models 36 // For comparison mirror member functions are taken from G4 class: 37 // G4InteractionContent 36 // For comparison mirror member function is G4InteractionContent 38 37 // --------------------------------------------------------------------- 39 38 // Short description: Classify the interaction in soft/hard/diffractive … … 43 42 #include "G4QInteraction.hh" 44 43 45 G4QInteraction::G4QInteraction(G4QHadron* aProjectile) : theProjectile(aProjectile), 46 theTarget(0),theNumberOfHard(0),theNumberOfSoft(0),theNumberOfDiffractive(0) 44 G4QInteraction::G4QInteraction(G4QHadron* aProjectile) : 45 theProjectile(aProjectile), theTarget(0), theNumberOfDINR(0), 46 theNumberOfHard(0),theNumberOfSoft(0),theNumberOfDiffractive(0) 47 47 {} 48 48 49 49 G4QInteraction::G4QInteraction(const G4QInteraction &right) : 50 50 theProjectile(right.GetProjectile()), theTarget(right.GetTarget()), 51 theNumberOf Hard(0), theNumberOfSoft(0), theNumberOfDiffractive(0)51 theNumberOfDINR(0), theNumberOfHard(0), theNumberOfSoft(0), theNumberOfDiffractive(0) 52 52 {} 53 53 54 54 G4QInteraction::~G4QInteraction() 55 {} 56 57 55 { 56 //delete theProjectile; 57 //if(theTarget) delete theTarget; 58 } -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QIsotope.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QIsotope.cc,v 1.1 1 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QIsotope.cc,v 1.13 2009/08/28 14:49:10 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QIsotope class ---------------- … … 697 697 pair<G4int, vector<pair<G4int,G4double>*>* >* nEl= newElems[j]; 698 698 G4int nEn=nEl->second->size(); 699 if(nEn) for(G4int k=0; k<nEn; k++) 700 { 701 pair<G4int,G4double>* curA=(*(nEl->second))[k]; 702 delete curA; // Delete vect<pair(N,Abundancy)*> 703 } 699 if(nEn) for(G4int k=0; k<nEn; k++) delete (*(nEl->second))[k]; // Del vect<pair(N,A)*> 700 delete nEl->second; // Delete the vector 704 701 delete nEl; // Delete vect<IndZ,vect<pair(N,Ab)*>*> newElementVector 705 702 // 706 703 pair<G4int, vector<pair<G4int,G4double>*>* >* nSA= newSumAb[j]; 707 704 G4int nSn=nSA->second->size(); 708 if(nSn) for(G4int n=0; n<nSn; n++) 709 { 710 pair<G4int,G4double>* curS=(*(nSA->second))[n]; 711 delete curS; // Delete vect<pair(N,SumAbund)*> 712 } 705 if(nSn) for(G4int n=0; n<nSn; n++) delete (*(nSA->second))[n]; // Del vect<pair(N,S)*> 706 delete nSA->second; // Delete the vector 713 707 delete nSA; // Delete vect<IndZ,vect<pair(N,SA)*>*> newSumAbunVector 714 708 // 715 709 pair<G4int, vector<pair<G4int,G4double>*>* >* nCS= newIsoCS[j]; 716 710 G4int nCn=nCS->second->size(); 717 if(nCn) for(G4int m=0; m<nCn; m++) 718 { 719 pair<G4int,G4double>* curC = (*(nCS->second))[m]; 720 delete curC; // Delete vect<pair(N,CrossSect)*> 721 } 711 if(nCn) for(G4int m=0; m<nCn; m++) delete (*(nCS->second))[m]; // Del vect<pair(N,C)*> 712 delete nCS->second; // Delete the vector 722 713 delete nCS; // Delete vect<IndZ,vect<pair(N,CS)*>*> newIsoCroSVector 723 714 // … … 1629 1620 } 1630 1621 pair<G4int,G4double>* abP= new pair<G4int,G4double>(N,abu); 1631 A->push_back(abP); 1622 A->push_back(abP); // @@ Valgrind thinks that it is not deleted (?) (Line 703) 1632 1623 pair<G4int,G4double>* saP= new pair<G4int,G4double>(N,sumAbu); 1633 S->push_back(saP); 1624 S->push_back(saP); // @@ Valgrind thinks that it is not deleted (?) (Line 713) 1634 1625 pair<G4int,G4double>* csP= new pair<G4int,G4double>(N,0.); 1635 C->push_back(csP); 1626 C->push_back(csP); // @@ Valgrind thinks that it is not deleted (?) (Line 723) 1636 1627 #ifdef debug 1637 1628 G4cout<<"G4QIsotope::InitElement: A & S & C are filled nP="<<C->size()<<G4endl; -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QNucleus.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QNucleus.cc,v 1. 96 2009/02/23 09:49:24 mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QNucleus.cc,v 1.115 2009/11/04 10:52:34 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QNucleus ---------------- … … 41 41 //#define cldebug 42 42 //#define qdebug 43 //#define cldebug 43 44 //#define pardeb 44 45 //#define ppdebug … … 57 58 G4double G4QNucleus::clustProb=4.; // clusterization probability in dense region 58 59 G4double G4QNucleus::mediRatio=1.; // relative vacuum hadronization probability 59 G4double G4QNucleus::nucleonDistance=.8*fermi; // Distance between nucleons (0.8 fm) 60 61 G4QNucleus::G4QNucleus(): G4QHadron(),Z(0),N(0),S(0),dZ(0),dN(0),dS(0),maxClust(0), 62 currentNucleon(-1),rho0(0),radius(0) 63 //probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb() 60 G4double G4QNucleus::nucleonDistance=.8*fermi; // Distance between nucleons (0.8 fm) (Body) 61 G4double G4QNucleus::WoodSaxonSurf=.545*fermi; // WoodSaxon Surface Param (0.545 fm) (Body) 62 63 G4QNucleus::G4QNucleus(): G4QHadron(), Z(0), N(0), S(0), dZ(0), dN(0), dS(0), maxClust(0), 64 theNucleons(),currentNucleon(-1), 65 rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false) 64 66 { 65 //Tb = new std::vector<G4double>;66 67 probVect[0]=mediRatio; 67 68 for(G4int i=1; i<256; i++) {probVect[i] = 0.;} … … 72 73 } 73 74 74 G4QNucleus::G4QNucleus(G4int z, G4int n, G4int s) : G4QHadron(90000000+s*1000000+z*1000+n),75 Z(z),N(n),S(s),dZ(0),dN(0),dS(0),maxClust(0),76 currentNucleon(-1),rho0(0),radius(0)77 //probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()75 G4QNucleus::G4QNucleus(G4int z, G4int n, G4int s) : 76 G4QHadron(90000000+s*1000000+z*1000+n), Z(z),N(n),S(s), dZ(0),dN(0),dS(0), maxClust(0), 77 theNucleons(), currentNucleon(-1), rho0(1.), radius(1.), 78 Tb(), TbActive(false), RhoActive(false) 78 79 { 79 //Tb = new std::vector<G4double>;80 80 probVect[0]=mediRatio; 81 81 for(G4int i=1; i<256; i++) {probVect[i] = 0.;} … … 99 99 Set4Momentum(p); 100 100 SetNFragments(0); 101 #ifdef pdebug101 #ifdef debug 102 102 G4cout<<"G4QNucleus::Constructor:(2) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb 103 103 <<", R="<<mediRatio<<G4endl; … … 105 105 } 106 106 107 G4QNucleus::G4QNucleus(G4int nucPDG): G4QHadron(nucPDG),maxClust(0),108 currentNucleon(-1),rho0(0),radius(0)109 //probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()107 G4QNucleus::G4QNucleus(G4int nucPDG): 108 G4QHadron(nucPDG), maxClust(0), theNucleons(), 109 currentNucleon(-1), rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false) 110 110 { 111 //Tb = new std::vector<G4double>;112 111 InitByPDG(nucPDG); 112 G4LorentzVector p(0.,0.,0.,GetGSMass()); 113 Set4Momentum(p); 113 114 #ifdef pardeb 114 115 G4cout<<"G4QNucleus::Constructor:(3) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb 115 <<", R="<<mediRatio<< G4endl;116 <<", R="<<mediRatio<<", 4M="<<p<<G4endl; 116 117 #endif 117 118 } 118 119 119 G4QNucleus::G4QNucleus(G4LorentzVector p, G4int nucPDG): G4QHadron(nucPDG,p),maxClust(0),120 currentNucleon(-1),rho0(0),radius(0)121 //probVect(),theImpactParameter(),theNucleons(), currentNucleon(-1),rho0(),radius(),Tb()120 G4QNucleus::G4QNucleus(G4LorentzVector p, G4int nucPDG): 121 G4QHadron(nucPDG, p), maxClust(0), theNucleons(), 122 currentNucleon(-1), rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false) 122 123 { 123 //Tb = new std::vector<G4double>;124 124 InitByPDG(nucPDG); 125 125 Set4Momentum(p); 126 126 #ifdef pardeb 127 127 G4cout<<"G4QNucleus::Constructor:(4) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb 128 <<", R="<<mediRatio<< G4endl;128 <<", R="<<mediRatio<<", 4M="<<p<<G4endl; 129 129 #endif 130 130 } 131 131 132 132 G4QNucleus::G4QNucleus(G4int z, G4int n, G4int s, G4LorentzVector p) : 133 G4QHadron(90000000+s*1000000+z*1000+n,p), Z(z),N(n),S(s),dZ(0),dN(0),dS(0),maxClust(0),134 currentNucleon(-1),rho0(0),radius(0)135 // probVect(),theImpactParameter(),theNucleons(),currentNucleon(-1),rho0(),radius(),Tb()133 G4QHadron(90000000+s*1000000+z*1000+n,p), Z(z),N(n),S(s), dZ(0),dN(0),dS(0), maxClust(0), 134 theNucleons(), currentNucleon(-1), rho0(1.),radius(1.), 135 Tb(), TbActive(false), RhoActive(false) 136 136 { 137 //Tb = new std::vector<G4double>;138 137 probVect[0]=mediRatio; 139 138 for(G4int i=1; i<256; i++) {probVect[i] = 0.;} … … 151 150 } 152 151 153 G4QNucleus::G4QNucleus(G4QContent nucQC): G4QHadron(nucQC),dZ(0),dN(0),dS(0),maxClust(0),154 currentNucleon(-1),rho0(0),radius(0)155 // probVect(),theImpactParameter(),theNucleons(),currentNucleon(-1),rho0(),radius(),Tb()152 G4QNucleus::G4QNucleus(G4QContent nucQC): 153 G4QHadron(nucQC), dZ(0), dN(0), dS(0), maxClust(0), theNucleons(), currentNucleon(-1), 154 rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false) 156 155 { 157 156 static const G4double mPi0 = G4QPDGCode(111).GetMass(); 158 //Tb = new std::vector<G4double>;159 157 #ifdef debug 160 158 G4cout<<"G4QNucleus::Construction By QC="<<nucQC<<G4endl; … … 200 198 } 201 199 202 G4QNucleus::G4QNucleus(G4QContent nucQC, G4LorentzVector p):G4QHadron(nucQC,p),dZ(0),dN(0), 203 dS(0),maxClust(0), 204 currentNucleon(-1),rho0(0),radius(0) 205 //probVect(),theImpactParameter(),theNucleons(),currentNucleon(-1),rho0(),radius(),Tb() 200 G4QNucleus::G4QNucleus(G4QContent nucQC, G4LorentzVector p): 201 G4QHadron(nucQC,p), dZ(0), dN(0), dS(0), maxClust(0), theNucleons(), currentNucleon(-1), 202 rho0(1.), radius(1.), Tb(), TbActive(false), RhoActive(false) 206 203 { 207 //Tb = new std::vector<G4double>;208 204 #ifdef debug 209 205 G4cout<<"G4QNucleus::(LV)Construction By QC="<<nucQC<<G4endl; … … 232 228 } 233 229 234 //G4QNucleus::G4QNucleus(const G4QNucleus& right) : G4QHadron(&right), currentNucleon(-1) 235 //{ 236 // //Tb = new std::vector<G4double>; 237 // //G4int lTb=right.GetBThickness()->size(); 238 // //if(lTb) for(G4int j=0; j<=lTb; j++) Tb->push_back((*right.GetBThickness())[j]); 239 // //if(lTb) for(G4int j=0; j<=lTb; j++) Tb.push_back((*right.GetBThickness())[j]); 240 // Set4Momentum (right.Get4Momentum()); 241 // SetQPDG (right.GetQPDG()); 242 // SetQC (right.GetQC()); 243 // SetNFragments (right.GetNFragments()); 244 // Z = right.Z; 245 // N = right.N; 246 // S = right.S; 247 // dZ = right.dZ; 248 // dN = right.dN; 249 // dS = right.dS; 250 // maxClust = right.maxClust; 251 // for(G4int i=0; i<=maxClust; i++) probVect[i] = right.probVect[i]; 252 // probVect[254] = right.probVect[254]; 253 // probVect[255] = right.probVect[255]; 254 //#ifdef pardeb 255 // G4cout<<"G4QNucleus::Constructor:(8) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb 256 // <<", R="<<mediRatio<<G4endl; 257 //#endif 258 //} 259 260 G4QNucleus::G4QNucleus(G4QNucleus* right) : currentNucleon(-1) 230 G4QNucleus::G4QNucleus(G4QNucleus* right, G4bool cop3D) : currentNucleon(-1) 261 231 { 262 //Tb = new std::vector<G4double>;263 //G4int lTb=right->GetBThickness()->size();264 //if(lTb) for(G4int j=0; j<=lTb; j++) Tb->push_back((*right->GetBThickness())[j]);265 //if(lTb) for(G4int j=0; j<=lTb; j++) Tb.push_back((*right->GetBThickness())[j]);266 Tb = right->Tb;267 Set4Momentum (right->Get4Momentum());268 SetQPDG (right->GetQPDG());269 SetQC (right->GetQC());270 SetNFragments (right->GetNFragments());271 232 Z = right->Z; 272 233 N = right->N; … … 279 240 probVect[254] = right->probVect[254]; 280 241 probVect[255] = right->probVect[255]; 242 Tb = right->Tb; 243 TbActive = right->TbActive; 244 RhoActive = right->RhoActive; 245 Set4Momentum (right->Get4Momentum()); 246 SetQPDG (right->GetQPDG()); 247 SetQC (right->GetQC()); 248 SetNFragments (right->GetNFragments()); 249 rho0 = right->rho0; 250 radius = right->radius; 251 if(cop3D) 252 { 253 G4int nn=right->theNucleons.size(); 254 for(G4int i=0; i<nn; ++i) 255 { 256 G4QHadron* nucleon = new G4QHadron(right->theNucleons[i]); 257 theNucleons.push_back(nucleon); 258 } 259 } 260 #ifdef pardeb 261 G4cout<<"G4QNucleus::Constructor:(8) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb 262 <<", R="<<mediRatio<<G4endl; 263 #endif 264 } 265 266 G4QNucleus::G4QNucleus(const G4QNucleus &right, G4bool cop3D): 267 G4QHadron(), currentNucleon(-1) 268 { 269 Z = right.Z; 270 N = right.N; 271 S = right.S; 272 dZ = right.dZ; 273 dN = right.dN; 274 dS = right.dS; 275 maxClust = right.maxClust; 276 for(G4int i=0; i<=maxClust; i++) probVect[i] = right.probVect[i]; 277 probVect[254] = right.probVect[254]; 278 probVect[255] = right.probVect[255]; 279 Tb = right.Tb; 280 TbActive = right.TbActive; 281 RhoActive = right.RhoActive; 282 Set4Momentum (right.Get4Momentum()); 283 SetQPDG (right.GetQPDG()); 284 SetQC (right.GetQC()); 285 SetNFragments (right.GetNFragments()); 286 rho0 = right.rho0; 287 radius = right.radius; 288 if(cop3D) 289 { 290 G4int nn=right.theNucleons.size(); 291 for(G4int i=0; i<nn; ++i) 292 { 293 G4QHadron* nucleon = new G4QHadron(right.theNucleons[i]); 294 theNucleons.push_back(nucleon); 295 } 296 } 281 297 #ifdef pardeb 282 298 G4cout<<"G4QNucleus::Constructor:(9) N="<<freeNuc<<", D="<<freeDib<<", W="<<clustProb … … 290 306 if(this != &right) // Beware of self assignment 291 307 { 292 Tb = right.Tb; 293 //Tb->clear(); 294 //G4int lTb=right.GetBThickness()->size(); 295 //if(lTb) for(G4int j=0; j<=lTb; j++) Tb->push_back((*right.GetBThickness())[j]); 296 //if(lTb) for(G4int j=0; j<=lTb; j++) Tb.push_back((*right.GetBThickness())[j]); 308 currentNucleon= -1; 309 TbActive = right.TbActive; 310 Tb = right.Tb; 311 RhoActive = right.RhoActive; 312 rho0 = right.rho0; 313 radius = right.radius; 314 G4int nn = right.theNucleons.size(); 315 for(G4int i=0; i < nn; ++i) 316 { 317 G4QHadron* nucleon = new G4QHadron(right.theNucleons[i]); 318 theNucleons.push_back(nucleon); 319 } 297 320 Set4Momentum (right.Get4Momentum()); 298 321 SetQPDG (right.GetQPDG()); … … 315 338 G4QNucleus::~G4QNucleus() 316 339 { 317 //if(theNucleons.size()) for_each(theNucleons.begin(),theNucleons.end(),DeleteQHadron());318 //Tb->clear();319 //delete Tb;320 340 for_each(theNucleons.begin(),theNucleons.end(),DeleteQHadron()); 321 341 } … … 410 430 dS=0; 411 431 G4int a = Z + N + S; // atomic number 412 #ifdef pdebug432 #ifdef debug 413 433 G4cout<<"G4QN::UpdateCl:A="<<a<<"(Z="<<Z<<",N="<<N<<",S="<<S<<"),mR="<<mediRatio<<G4endl; 414 434 #endif … … 425 445 G4int sA=static_cast<G4int>(surA); 426 446 if(surf>0.||surf<1.)sA=RandomizeBinom(surf,a); // randomize SurfaceNucleons by Binomial 427 #ifdef pdebug447 #ifdef debug 428 448 G4cout<<"G4QN::UpdateCl:surf="<<surf<<"= N="<<freeNuc<<"+D="<<freeDib<<",A="<<sA<<G4endl; 429 449 #endif … … 434 454 sA=a-2; 435 455 } 436 #ifdef pdebug456 #ifdef debug 437 457 G4cout<<"G4QN::UpdtC:dA="<<dA<<",A="<<A<<",s="<<surf<<",S="<<sA<<",C="<<maxClust<<G4endl; 438 458 #endif … … 469 489 probVect[255]= 0; // a#of dense "dibaryons" (correct) 470 490 } 471 #ifdef pdebug491 #ifdef debug 472 492 G4cout<<"G4QNucleus::UpdateClust:Only quasi-free nucleons pV[1]="<<probVect[1]<<G4endl; 473 493 #endif … … 484 504 G4double prb=rd+uA; 485 505 sum =prb; 486 #ifdef pdebug506 #ifdef debug 487 507 G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[1]=s="<<sum<<",dA="<<dA<<",uA="<<uA<<G4endl; 488 508 #endif … … 498 518 prb=rd+pA; 499 519 sum+=prb+prb; 500 #ifdef pdebug520 #ifdef debug 501 521 G4cout<<"G4QNucl::UpdateCl:sud="<<sud<<",v[2]="<<prb<<",s="<<sum<<",pA="<<pA<<G4endl; 502 522 #endif … … 522 542 rd*=wrd*(idA-i)/i; 523 543 sum+=rd*i; 524 #ifdef pdebug544 #ifdef debug 525 545 G4cout<<"G4QNucleus::UpdateCl:sud="<<sud<<", v["<<i<<"]="<<rd<<", s="<<sum<<G4endl; 526 546 #endif … … 539 559 dN = dA - dZ; 540 560 } 541 #ifdef pdebug561 #ifdef debug 542 562 G4cout<<"G4QNucleus::UpdateClusters: Sum of weighted probabilities s="<<sum<<G4endl; 543 563 #endif … … 546 566 // ===================== From here probability randomization starts =============== 547 567 // G4int rA=a; // Residual number of nucleons 548 //#ifdef pdebug568 //#ifdef debug 549 569 //G4cout<<"G4QNuc::UpdateClust:A="<<A<<",M="<<k<<",P1="<<probVect[1]<<",P2="<<probVect[2] 550 570 // <<G4endl; … … 556 576 // { 557 577 // G4double prob=probVect[j]/probSInt[j]; // Probab of the cluster in the dest nucleus 558 //#ifdef pdebug578 //#ifdef debug 559 579 // G4cout<<"G4QNucl::UpdateClusters: j="<<j<<",sP="<<probVect[j]<<",iP="<<probSInt[j] 560 580 // <<G4endl; … … 571 591 // if(j==maxClust) maxClust--; 572 592 // } 573 //#ifdef pdebug593 //#ifdef debug 574 594 // G4cout<<"G4QNucl::UpdateClust:p="<<prob<<",r="<<rA<<",m="<<jmax<<",P="<<probVect[j] 575 595 // <<G4endl; … … 588 608 // End of "UpdateClusters" 589 609 610 // Reduce the 3D Nucleus by the used nucleon + update nucleon's energies (in LS!) 611 void G4QNucleus::SubtractNucleon(G4QHadron* uNuc) 612 {// ============================================ 613 G4int NotFound=true; // Not found flag 614 G4QHadronVector::iterator u; // iterator of the used nucleon 615 for(u=theNucleons.begin(); u!=theNucleons.end(); u++) 616 { 617 #ifdef debug 618 G4cout<<"G4QNucleus::SubtractNucleon: LOOP 4M="<<(*u)->Get4Momentum()<<G4endl; 619 #endif 620 if (uNuc==*u) // Find uNuceon-pointer 621 { 622 NotFound=false; 623 break; 624 } 625 } 626 if(NotFound) throw G4QException("G4QNucleus::SubtractNucleon: The nucleon isn't found"); 627 else 628 { 629 G4int tPDG=GetPDGCode(); // Nucleus PDG before the subtraction 630 G4LorentzVector t4M=Get4Momentum(); // Nucleus 4-mom before the subtraction 631 #ifdef debug 632 G4cout<<"G4QNucleus::SubtractNucleon: InitialNucleus 4M="<<t4M<<", PDG="<<tPDG<<", nN=" 633 <<theNucleons.size()<<G4endl; 634 #endif 635 G4int uPDG=(*u)->GetPDGCode(); // PDG code of the subtracted nucleon 636 G4LorentzVector u4M=(*u)->Get4Momentum(); // 4-momentum of the subtracted nucleon 637 #ifdef debug 638 G4cout<<"G4QNucleus::SubtractNucleon: subtractNucleon 4M="<<u4M<<",PDG="<<uPDG<<G4endl; 639 #endif 640 delete *u; // Delete the nucleon as an object 641 theNucleons.erase(u); // exclude the nucleon pointer from the HV 642 --currentNucleon; // Continue selection from theSame position 643 t4M-=u4M; // Update the nucleus 4-momentum VALUE 644 if (uPDG==2212) tPDG-=1000; // Reduce the nucleus PDG Code by a proton 645 else if(uPDG==2112) tPDG--; // Reduce the nucleus PDG Code by a neutron 646 else 647 { 648 G4cerr<<"***G4QNucleus::SubtractNucleon: Unexpected Nucleon PDGCode ="<<uPDG<<G4endl; 649 throw G4QException("G4QNucleus::SubtractNucleon: Impossible nucleon PDG Code"); 650 } 651 #ifdef debug 652 G4cout<<"G4QNucleus::SubtractNucleon: theResidualNucleus PDG="<<tPDG<<", 4M="<<t4M 653 <<", nN="<<theNucleons.size()<<G4endl; 654 #endif 655 InitByPDG(tPDG); // Reinitialize the nucleus, not 3D nucleus 656 theMomentum=t4M; // Fill the residual 4-momentum 657 //#ifdef debug 658 G4double mR2=sqr(GetGSMass()); // Real squared residual nucleus mass 659 G4double tM2=t4M.m2(); // Squared residual nucleus mass from 4M 660 #ifdef debug 661 G4cout<<"G4QNucleus::SubtractNucleon: rAm2="<<mR2<<" =? 4Mm2="<<tM2<<G4endl; 662 G4int cnt=0; // Counter of nucleons for print 663 #endif 664 if(std::fabs(mR2-tM2)>.01)G4cout<<"*G4QNucleus::SubNucleon:rM="<<mR2<<"#"<<tM2<<G4endl; 665 //#endif 666 G4double tE=t4M.e(); // Energy of the residual nucleus (in CM!) 667 G4double m2p=sqr(G4QNucleus(tPDG-1000).GetGSMass()); // subResid. nuclearM2 for protons 668 G4double m2n=sqr(G4QNucleus(tPDG-1).GetGSMass()); // subResidual nuclearM2 for neutrons 669 for(u=theNucleons.begin(); u!=theNucleons.end(); u++) // Correct the nucleon's energies 670 { 671 G4LorentzVector n4M=(*u)->Get4Momentum(); // 4-mom of the current nucleon 672 G4double srP2=(t4M-n4M).vect().mag2(); // p2 of the subResNucleus 673 G4double m2=m2n; // default subResNucleusM2 (for neutrons) 674 if((*u)->GetPDGCode()==2212) m2=m2p; // change it to subResNucleusM2 for protons 675 G4double srE=std::sqrt(srP2+m2); // Energy of the subResNucleus 676 #ifdef debug 677 G4cout<<"G4QNucleus::SubtractNucleon:#"<<cnt++<<", correctedEnergy="<<tE-srE<<G4endl; 678 #endif 679 n4M.setE(tE-srE); // Update the energy of the nucleon 680 (*u)->Set4Momentum(n4M); // Update the 4-momentum of the nucleon 681 } 682 } 683 #ifdef debug 684 G4cout<<"G4QNucleus::SubtractNucleon:ResNuc4M="<<theMomentum<<",Z="<<Z<<",N="<<N<<G4endl; 685 #endif 686 } 687 688 // Delete all residual nucleons 689 void G4QNucleus::DeleteNucleons() 690 {// ============================ 691 G4QHadronVector::iterator u; // iterator for the nucleons 692 for(u=theNucleons.begin(); u!=theNucleons.end(); u++) delete *u; 693 theMomentum=G4LorentzVector(0.,0.,0.,0.); 694 } 695 590 696 // Reduce nucleus by emitted cluster with PDG Code cPDG 591 697 void G4QNucleus::Reduce(G4int cPDG) … … 606 712 //} 607 713 InitByPDG(newPDG); // Reinit the Nucleus 608 }714 } 609 715 } 610 716 else if(cPDG!=NUCPDG) G4cerr<<"***G4QN::Reduce:Subtract not nuclear PDGC="<<cPDG<<G4endl; … … 675 781 G4double totM=Get4Momentum().m(); // Real Mass value of the Nucleus 676 782 G4QContent valQC=GetQCZNS(); // Quark Content of the Nucleus 677 #ifdef pdebug783 #ifdef debug 678 784 G4cout<<"G4QNucleus::SplitBaryon: B="<<baryn<<", M="<<totM<<valQC<<G4endl; 679 785 #endif … … 685 791 G4double resMas=G4QPDGCode(resPDG).GetMass(); // GS Mass of the Residual 686 792 G4double sM=resMas+mNeut; 687 #ifdef pdebug793 #ifdef debug 688 794 G4cout<<"G4QNucleus::SplitBaryon: (neutron),sM="<<sM<<",d="<<totM-sM<<G4endl; 689 795 #endif … … 699 805 G4double sM=resMas+mProt+CB; 700 806 /////////G4double sM=resMas+mProt; 701 #ifdef pdebug807 #ifdef debug 702 808 G4cout<<"G4QNucleus::SplitBaryon: (proton),sM="<<sM<<",d="<<totM-sM<<G4endl; 703 809 #endif … … 711 817 G4double resMas=G4QPDGCode(resPDG).GetMass(); // GS Mass of the Residual 712 818 G4double sM=resMas+mLamb; 713 #ifdef pdebug819 #ifdef debug 714 820 G4cout<<"G4QNucleus::SplitBaryon: (lambda),sM="<<sM<<",d="<<totM-sM<<G4endl; 715 821 #endif … … 725 831 G4double sM=resMas+mDeut+CB; 726 832 //G4double sM=resMas+mDeut; 727 #ifdef pdebug833 #ifdef debug 728 834 G4cout<<"G4QNucleus::SplitBaryon: (deuteron),sM="<<sM<<",d="<<totM-sM<<G4endl; 729 835 #endif … … 738 844 G4double sM=resMas+mAlph; 739 845 if(NQ!=4||PQ!=4) sM+=CB; 740 #ifdef pdebug846 #ifdef debug 741 847 G4cout<<"G4QNucleus::SplitBaryon: (alpha),sM="<<sM<<",d="<<totM-sM<<G4endl; 742 848 #endif … … 757 863 G4int baryn=GetA(); // Baryon Number of the Nucleus 758 864 if(baryn<3) return false; 759 G4double totM= Get4Momentum().m(); // Real Mass value of the Nucleus865 G4double totM=theMomentum.m(); // Real Mass value of the Nucleus 760 866 G4QContent valQC=GetQCZNS(); // Quark Content of the Nucleus 761 #ifdef pdebug867 #ifdef debug 762 868 G4cout<<"G4QNucleus::Split2Baryons: B="<<baryn<<", M="<<totM<<valQC<<G4endl; 763 869 #endif … … 769 875 G4double resMas=G4QPDGCode(resPDG).GetMass();// GS Mass of the Residual Nucleus 770 876 G4double sM=resMas+mNeut+mNeut; 771 #ifdef pdebug877 #ifdef debug 772 878 G4cout<<"G4QNucleus::Split2Baryons: (2 neutrons), sM="<<sM<<", d="<<totM-sM<<G4endl; 773 879 #endif … … 781 887 G4double resMas=G4QPDGCode(resPDG).GetMass();// GS Mass of the Residual Nucleus 782 888 G4double sM=resMas+mProt+mProt; 783 #ifdef pdebug889 #ifdef debug 784 890 G4cout<<"G4QNucleus::Split2Baryons: (2 protons), sM="<<sM<<", d="<<totM-sM<<G4endl; 785 891 #endif … … 792 898 G4double resMas=G4QPDGCode(resPDG).GetMass();// GS Mass of the Residual Nucleus 793 899 G4double sM=resMas+mProt+mNeut; 794 #ifdef pdebug900 #ifdef debug 795 901 G4cout<<"G4QNucleus::Split2Baryons:(proton+neutron), sM="<<sM<<", d="<<totM-sM<<G4endl; 796 902 #endif … … 804 910 G4double resMas=G4QPDGCode(resPDG).GetMass();// GS Mass of the Residual Nucleus 805 911 G4double sM=resMas+mLamb+mNeut; 806 #ifdef pdebug912 #ifdef debug 807 913 G4cout<<"G4QNucleus::Split2Baryons:(lambda+neutron), sM="<<sM<<", d="<<totM-sM<<G4endl; 808 914 #endif … … 815 921 G4double resMas=G4QPDGCode(resPDG).GetMass();// GS Mass of the Residual Nucleus 816 922 G4double sM=resMas+mProt+mLamb; 817 #ifdef pdebug923 #ifdef debug 818 924 G4cout<<"G4QNucleus::Split2Baryons: (proton+lambda), sM="<<sM<<", d="<<totM-sM<<G4endl; 819 925 #endif … … 826 932 G4double resMas=G4QPDGCode(resPDG).GetMass();// GS Mass of the Residual Nucleus 827 933 G4double sM=resMas+mLamb+mLamb; 828 #ifdef pdebug934 #ifdef debug 829 935 G4cout<<"G4QNucleus::Split2Baryons: (two lambdas), sM="<<sM<<", d="<<totM-sM<<G4endl; 830 936 #endif … … 893 999 //if(a>4.5) evalph=2.7/sqrt(a-4.); // Probability for alpha to evaporate 894 1000 //G4double evalph=clustProb*clustProb*clustProb; 895 #ifdef pdebug1001 #ifdef debug 896 1002 G4cout<<"G4QNucleus::EvaporBaryon: *Called*, a="<<a<<GetThis()<<",alph="<<evalph<<G4endl; 897 1003 #endif … … 922 1028 G4LorentzVector h3mom; 923 1029 G4double totMass= GetMass(); // Total mass of the Nucleus 924 //if(totMass-GetGSMass()>100.)throw G4QException("****Big Mass"); 925 #ifdef pdebug 1030 #ifdef debug 926 1031 G4cout<<"G4QN::EB:pB="<<PBarr<<",aB="<<ABarr<<",ppB="<<PPBarr<<",paB="<<PABarr<<G4endl; 927 1032 #endif … … 990 1095 if(totMass<=mNP) 991 1096 { 992 #ifdef pdebug1097 #ifdef debug 993 1098 G4cout<<"G4QNucl::EvaporateBaryon: Photon ### d+g ###, dM="<<totMass-mNP<<G4endl; 994 1099 #endif … … 1114 1219 G4double eMass = 0.; // Prototype of mass of Evaporated Baryon 1115 1220 G4double fMass = 0.; // Prototype of mass of the Second Baryon 1116 #ifdef pdebug1221 #ifdef debug 1117 1222 G4cout<<"G4QNuc::EvaB:a>2, totM="<<totMass<<" > GSMass="<<GSMass<<",d="<<totMass-GSMass 1118 1223 <<G4endl; … … 1140 1245 pBnd=mProt-GSMass+GSResNp; // Binding energy for proton 1141 1246 G4double eMax=sqrt(mP2+pp2m); 1142 #ifdef pdebug1247 #ifdef debug 1143 1248 G4cout<<"G4QNuc::EvapBaryon:pm="<<eMax+sqrt(pp2m+GSResNp*GSResNp)<<" = M="<<totMass 1144 1249 <<", sm="<<GSResNp+mProt+PBarr<<",pp2="<<pp2m<<",pB="<<pBnd<<G4endl; … … 1151 1256 ppQPDG=G4QPDGCode(90000000+1000*(1000*S+Z-2)+N); 1152 1257 GSResPP=ppQPDG.GetMass(); 1153 #ifdef pdebug1258 #ifdef debug 1154 1259 G4double sm=GSResPP+mProt+mProt+SPPBarr; 1155 1260 G4cout<<"G4QNucl::EvapBaryon: ppM="<<GSResPP<<",T="<<sm-GSMass<<",E="<<totMass-sm … … 1165 1270 paQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-3)+N-2); 1166 1271 GSResPA=paQPDG.GetMass(); 1167 #ifdef pdebug1272 #ifdef debug 1168 1273 G4double s=GSResPA+mAlph+mProt+SAPBarr; 1169 1274 G4cout<<"G4QN::EB:paM="<<GSResPA<<",T="<<s-GSMass<<",E="<<totMass-s<<G4endl; … … 1244 1349 aaQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-4)+N-4); 1245 1350 GSResAA=aaQPDG.GetMass(); 1246 #ifdef pdebug1351 #ifdef debug 1247 1352 G4double s=GSResAA+mAlph+mAlph+SAABarr; 1248 1353 G4cout<<"G4QNucl::EvapBaryon: a="<<GSResNP<<",T="<<s-GSMass<<",E="<<totMass-s … … 1255 1360 naQPDG =G4QPDGCode(90000000+1000*(1000*S+Z-2)+N-3); 1256 1361 GSResNA=naQPDG.GetMass(); 1257 #ifdef pdebug1362 #ifdef debug 1258 1363 G4double s=GSResNA+mAlph+mNeut; 1259 1364 G4cout<<"G4QNucl::EvapBary: M="<<GSResNA<<",T="<<s-GSMass<<",E="<<totMass-s … … 1278 1383 aBnd=mAlph-GSMass+GSResNa; // Binding energy for ALPHA 1279 1384 G4double eMax=sqrt(mA2+ap2m); 1280 #ifdef pdebug1385 #ifdef debug 1281 1386 G4cout<<"G4QNuc::EvapBar:m="<<eMax+sqrt(ap2m+GSResNa*GSResNa)<<" = M="<<totMass 1282 1387 <<", sm="<<GSResNp+mProt+PBarr<<",pp2="<<pp2m<<",pB="<<pBnd<<G4endl; … … 1293 1398 npQPDG=G4QPDGCode(90000000+1000*(1000*S+Z-1)+N-1); 1294 1399 GSResNP=npQPDG.GetMass(); 1295 #ifdef pdebug1400 #ifdef debug 1296 1401 G4double s=GSResNP+mNeut+mProt; 1297 1402 G4cout<<"G4QNucl::EvapBaryon: npM="<<GSResNP<<",T="<<s-GSMass<<",E="<<totMass-s … … 1334 1439 NQPDG=G4QPDGCode(90000000+1000*(1000*S+Z)+N-1); 1335 1440 GSResNn=NQPDG.GetMass(); 1336 #ifdef pdebug1441 #ifdef debug 1337 1442 G4cout<<"G4QNucleus::EvapBaryon: M(A-N)="<<GSResNn<<",Z="<<Z 1338 1443 <<",N="<<N<<",S="<<S<<G4endl; … … 1346 1451 nBnd=mNeut-GSMass+GSResNn; // Binding energy for neutron 1347 1452 G4double eMax=sqrt(mN2+np2m); 1348 #ifdef pdebug1453 #ifdef debug 1349 1454 G4cout<<"G4QNuc::EvapBaryon:nm="<<eMax+sqrt(np2m+GSResNn*GSResNn)<<" = M="<<totMass 1350 1455 <<", sm="<<GSResNn+mNeut<<",np2="<<np2m<<",nB="<<nBnd<<G4endl; … … 1397 1502 lBnd=mLamb-GSMass+GSResNl; // Binding energy for lambda 1398 1503 G4double eMax=sqrt(mL2+lp2m); 1399 #ifdef pdebug1504 #ifdef debug 1400 1505 G4cout<<"G4QNuc::EvapBaryon:lm="<<eMax+sqrt(lp2m+GSResNl*GSResNl)<<" = M="<<totMass 1401 1506 <<", sm="<<GSResNl+mLamb<<",lp2="<<lp2m<<",lB="<<lBnd<<G4endl; … … 1426 1531 G4bool secB = nSecF||pSecF||lSecF||aSecF; // Possibili to decay in TwoBaryons (Alphas) 1427 1532 //G4bool thdB = nTrF||pTrF||lTrF||aTrF||naaF||paaF||laaF||aaaF;// Pos to radiate three 1428 #ifdef pdebug1533 #ifdef debug 1429 1534 G4cout<<"G4QNucl::EvapBary:n="<<nSecF<<",p="<<pSecF<<",l="<<lSecF<<",a="<<aSecF<<",nn=" 1430 1535 <<nnFlag<<", np="<<npFlag<<",pp="<<ppFlag<<",pa="<<paFlag<<",na="<<naFlag<<",aa=" … … 1440 1545 if(!lSecF) lFlag=false; 1441 1546 if(!aSecF) aFlag=false; 1442 #ifdef pdebug1547 #ifdef debug 1443 1548 G4cout<<"G4QNuc::EB:nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl; 1444 1549 #endif … … 1491 1596 good=false; 1492 1597 } 1493 #ifdef pdebug1598 #ifdef debug 1494 1599 G4cout<<"G4QNuc::EvapBary:iE="<<minE<<",aE="<<maxE<<",mi="<<mi<<",mm="<<mm<<",ma=" 1495 1600 <<ma<<G4endl; … … 1510 1615 xMi=sqrt(xMi); // @@ ? 1511 1616 xMa=sqrt(xMa); // @@ ? 1512 #ifdef pdebug1617 #ifdef debug 1513 1618 G4cout<<"G4QNuc:EvapBaryon:mi="<<mi<<",ma="<<ma<<", xi="<<xMi<<",xa="<<xMa<<G4endl; 1514 1619 #endif 1515 1620 G4double powr=1.5*a1; // Power for low & up limits 1516 1621 G4double revP=1./powr; // Reversed power for randomization 1517 #ifdef pdebug1622 #ifdef debug 1518 1623 G4cout<<"G4QNucleus::EvaporateBaryon: Power="<<powr<<",RevPower="<<revP<<G4endl; 1519 1624 #endif 1520 1625 G4double minR=pow(1.-xMa*xMa,powr); // Look on @@ ? (up) 1521 1626 G4double maxR=pow(1.-xMi*xMi,powr); 1522 #ifdef pdebug1627 #ifdef debug 1523 1628 G4cout<<"G4QNucleus::EvaporateBaryon: miR="<<minR<<", maR="<<maxR<<G4endl; 1524 1629 #endif … … 1534 1639 if(x<xMi||x>xMa) 1535 1640 { 1536 #ifdef pdebug1641 #ifdef debug 1537 1642 G4cerr<<"**G4QNucl::EvapB:R="<<R<<",xi="<<xMi<<" < "<<x<<" < xa="<<xMa<<G4endl; 1538 1643 #endif … … 1548 1653 G4double psum =0.; 1549 1654 G4double zCBPP=0.; // Probabylity for a proton 1550 #ifdef pdebug1655 #ifdef debug 1551 1656 G4cout<<"G4QNuc::EvapB:t="<<tk<<",pM="<<pMin<<",pB="<<pBnd<<",n="<<nMin<<",a=" 1552 1657 <<aMin<<G4endl; … … 1556 1661 G4double kin=tk-pBnd; 1557 1662 //if(barf) kin-=PBarr; //@@ This is a mistake 1558 #ifdef pdebug1663 #ifdef debug 1559 1664 G4cout<<"G4QN::EB:Proton="<<kin<<",CB="<<PBarr<<",B="<<pBnd<<",M="<<pMin 1560 1665 <<",p="<<CoulBarPenProb(PBarr,kin,1,1)<<G4endl; … … 1567 1672 { 1568 1673 G4double kin=tk-nBnd; 1569 #ifdef pdebug1674 #ifdef debug 1570 1675 G4cout<<"G4QN::EB:Neutron="<<kin<<",p="<<CoulBarPenProb(0.,kin,0,1)<<G4endl; 1571 1676 #endif … … 1578 1683 { 1579 1684 G4double kin=tk-lBnd; 1580 #ifdef pdebug1685 #ifdef debug 1581 1686 G4cout<<"G4QN::EB:Lambda="<<kin<<",p="<<CoulBarPenProb(0,kin,0,1)<<G4endl; 1582 1687 #endif … … 1589 1694 G4double kin=tk-aBnd; 1590 1695 //if(barf) kin-=ABarr; //@@ This is a mistake 1591 #ifdef pdebug1696 #ifdef debug 1592 1697 G4cout<<"G4QN::EB:Alpha="<<kin<<",CB="<<ABarr<<",p=" 1593 1698 <<CoulBarPenProb(ABarr,kin,2,4)<<G4endl; … … 1597 1702 } 1598 1703 G4double r = psum*G4UniformRand(); 1599 #ifdef pdebug1704 #ifdef debug 1600 1705 G4cout<<"G4QNuc::EvapB:"<<r<<",p="<<zCBPP<<",pn="<<nCBPP<<",pnl="<<lCBPP<<",t=" 1601 1706 <<psum<<G4endl; … … 1604 1709 if (r&&r>lCBPP) 1605 1710 { 1606 #ifdef pdebug1711 #ifdef debug 1607 1712 G4cout<<"G4QNuc::EvaB:ALPHA is selected for evap, r="<<r<<">"<<lCBPP<<G4endl; 1608 1713 #endif … … 1611 1716 else if(r&&r>nCBPP&&r<=lCBPP) 1612 1717 { 1613 #ifdef pdebug1718 #ifdef debug 1614 1719 G4cout<<"G4QNuc::EvaB:LAMBDA is selected for evap,r="<<r<<"<"<<lCBPP<<G4endl; 1615 1720 #endif … … 1618 1723 else if(r&&r>zCBPP&&r<=nCBPP) 1619 1724 { 1620 #ifdef pdebug1725 #ifdef debug 1621 1726 G4cout<<"G4QNuc::EvaBar: N is selected for evapor,r="<<r<<"<"<<nCBPP<<G4endl; 1622 1727 #endif … … 1625 1730 else if(r&&r<=zCBPP) 1626 1731 { 1627 #ifdef pdebug1732 #ifdef debug 1628 1733 G4cout<<"G4QNuc::EvaBar: P is selected for evapor,r="<<r<<"<"<<zCBPP<<G4endl; 1629 1734 #endif … … 1632 1737 else cond=true; 1633 1738 } 1634 #ifdef pdebug1739 #ifdef debug 1635 1740 G4cout<<"G4QNuc::EvapBar:c="<<cond<<",x="<<x<<",cnt="<<cntr<<",R="<<R<<",ma="<<ma 1636 1741 <<",rn="<<rn<<"<r="<<x/xMa<<",tk="<<tk<<",ni="<<nMin<<",pi="<<pMin<<G4endl; … … 1671 1776 tk-=nBnd-mNeut; // Pays for binding and convert to total energy 1672 1777 p2=tk*tk-mN2; 1673 #ifdef pdebug1778 #ifdef debug 1674 1779 G4cout<<"G4QNucleus::EvaporateBaryon:np2="<<p2<<",np2m="<<np2m<<G4endl; 1675 1780 #endif … … 1698 1803 else G4cerr<<"***G4QNucleus::EvaporateBaryon: PDG="<<PDG<<G4endl; 1699 1804 G4double rEn=totMass-tk; 1700 rMass=sqrt(rEn*rEn-p2); // Mass of Residual Nucleus 1805 G4double rEn2=rEn*rEn; 1806 if (rEn2 > p2) rMass=sqrt(rEn2-p2); // Mass of the Residual Nucleus 1807 else rMass=0.0; 1701 1808 // Find out if the ResidualNucleus is below of the SecondBaryonDecayLimit 1702 1809 //@@ Calculate it depending on PDG !!!!!!! … … 1725 1832 G4bool aaCond = !aaFlag || (aaFlag && GSResAA+mAlph+AABarr > rMass); 1726 1833 if(barf) aaCond = !aaFlag || (aaFlag && GSResAA+mAlph+SAABarr > rMass); 1727 #ifdef pdebug1834 #ifdef debug 1728 1835 G4cout<<"G4QNucl::EvaB:"<<PDG<<", E="<<tk<<", rM="<<rMass<<", "; 1729 1836 if(PDG==pPDG) G4cout<<"PN="<<GSResNP+mNeut<<"("<<pnCond<<"),PP=" … … 1750 1857 if(PDG==pPDG&&(pnCond&&ppCond&&plCond&&paCond))//p+RN decay, p+b+RN dec is closed 1751 1858 { 1752 #ifdef pdebug1859 #ifdef debug 1753 1860 G4cout<<"G4QN::EB:*p*: n="<<pnCond<<",p="<<ppCond<<",l="<<plCond<<",a="<<paCond 1754 1861 <<G4endl; … … 1783 1890 } 1784 1891 G4double r = aLim*G4UniformRand(); 1785 #ifdef pdebug1892 #ifdef debug 1786 1893 G4cout<<"G4QNuc::EvaB:p, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a=" 1787 1894 <<aLim<<G4endl; … … 1795 1902 rMass = GSResPA; 1796 1903 rQPDG = paQPDG; 1797 #ifdef pdebug1904 #ifdef debug 1798 1905 G4cout<<"G4QNucleus::EvaporateBary: P+A"<<G4endl; 1799 1906 #endif … … 1805 1912 rMass = GSResPL; 1806 1913 rQPDG = plQPDG; 1807 #ifdef pdebug1914 #ifdef debug 1808 1915 G4cout<<"G4QNucleus::EvaporateBary: P+L"<<G4endl; 1809 1916 #endif … … 1815 1922 rMass = GSResPP; 1816 1923 rQPDG = ppQPDG; 1817 #ifdef pdebug1924 #ifdef debug 1818 1925 G4cout<<"G4QNucleus::EvaporateBary: P+P"<<G4endl; 1819 1926 #endif … … 1825 1932 rMass = GSResNP; 1826 1933 rQPDG = npQPDG; 1827 #ifdef pdebug1934 #ifdef debug 1828 1935 G4cout<<"G4QNucleus::EvaporateBary: P+N"<<G4endl; 1829 1936 #endif … … 1833 1940 else if(PDG==nPDG&&(nnCond&&npCond&&nlCond&&naCond)) // n+b+RN decay can't happen 1834 1941 { //@@ Take into account Coulomb Barier Penetration Probability 1835 #ifdef pdebug1942 #ifdef debug 1836 1943 G4cout<<"G4QN::EB:*n*: n="<<nnCond<<",p="<<npCond<<",l="<<nlCond<<",a="<<naCond 1837 1944 <<G4endl; … … 1860 1967 } 1861 1968 G4double r = aLim*G4UniformRand(); 1862 #ifdef pdebug1969 #ifdef debug 1863 1970 G4cout<<"G4QN::EB:n, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim 1864 1971 <<G4endl; … … 1872 1979 rMass = GSResNA; 1873 1980 rQPDG = naQPDG; 1874 #ifdef pdebug1981 #ifdef debug 1875 1982 G4cout<<"G4QNucleus::EvaporateBary: N+A"<<G4endl; 1876 1983 #endif … … 1882 1989 rMass = GSResNL; 1883 1990 rQPDG = nlQPDG; 1884 #ifdef pdebug1991 #ifdef debug 1885 1992 G4cout<<"G4QNucleus::EvaporateBary: N+L"<<G4endl; 1886 1993 #endif … … 1892 1999 rMass = GSResNP; 1893 2000 rQPDG = npQPDG; 1894 #ifdef pdebug2001 #ifdef debug 1895 2002 G4cout<<"G4QNucleus::EvaporateBary: N+P"<<G4endl; 1896 2003 #endif … … 1902 2009 rMass = GSResNN; 1903 2010 rQPDG = nnQPDG; 1904 #ifdef pdebug2011 #ifdef debug 1905 2012 G4cout<<"G4QNucleus::EvaporateBary: N+N"<<G4endl; 1906 2013 #endif … … 1937 2044 } 1938 2045 G4double r = aLim*G4UniformRand(); 1939 #ifdef pdebug2046 #ifdef debug 1940 2047 G4cout<<"G4QN::EB:l, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim 1941 2048 <<G4endl; … … 1949 2056 rMass = GSResLA; 1950 2057 rQPDG = laQPDG; 1951 #ifdef pdebug2058 #ifdef debug 1952 2059 G4cout<<"G4QNucleus::EvaporateBary: L+A"<<G4endl; 1953 2060 #endif … … 1959 2066 rMass = GSResLL; 1960 2067 rQPDG = llQPDG; 1961 #ifdef pdebug2068 #ifdef debug 1962 2069 G4cout<<"G4QNucleus::EvaporateBary: L+L"<<G4endl; 1963 2070 #endif … … 1969 2076 rMass = GSResPL; 1970 2077 rQPDG = plQPDG; 1971 #ifdef pdebug2078 #ifdef debug 1972 2079 G4cout<<"G4QNucleus::EvaporateBary: L+P"<<G4endl; 1973 2080 #endif … … 1979 2086 rMass = GSResNL; 1980 2087 rQPDG = nlQPDG; 1981 #ifdef pdebug2088 #ifdef debug 1982 2089 G4cout<<"G4QNucleus::EvaporateBary: L+N"<<G4endl; 1983 2090 #endif … … 1987 2094 else if(PDG==aPDG&&(anCond&&apCond&&alCond&&aaCond)) // a+b+RN decay can't happen 1988 2095 { //@@ Take into account Coulomb Barier Penetration Probability 1989 #ifdef pdebug2096 #ifdef debug 1990 2097 G4cout<<"G4QN::EB:*a*: n="<<anCond<<",p="<<apCond<<",l="<<alCond<<",a="<<aaCond 1991 2098 <<G4endl; … … 2020 2127 } 2021 2128 G4double r = aLim*G4UniformRand(); 2022 #ifdef pdebug2129 #ifdef debug 2023 2130 G4cout<<"G4QN::EB:a, r="<<r<<",n="<<nLim<<",z="<<zLim<<",s="<<sLim<<",a="<<aLim 2024 2131 <<G4endl; … … 2032 2139 rMass = GSResAA; 2033 2140 rQPDG = aaQPDG; 2034 #ifdef pdebug2141 #ifdef debug 2035 2142 G4cout<<"G4QNucleus::EvaporateBary: A+A"<<G4endl; 2036 2143 #endif … … 2042 2149 rMass = GSResLA; 2043 2150 rQPDG = laQPDG; 2044 #ifdef pdebug2151 #ifdef debug 2045 2152 G4cout<<"G4QNucleus::EvaporateBary: A+L"<<G4endl; 2046 2153 #endif … … 2052 2159 rMass = GSResPA; 2053 2160 rQPDG = paQPDG; 2054 #ifdef pdebug2161 #ifdef debug 2055 2162 G4cout<<"G4QNucleus::EvaporateBary: A+P"<<G4endl; 2056 2163 #endif … … 2062 2169 rMass = GSResNA; 2063 2170 rQPDG = naQPDG; 2064 #ifdef pdebug2171 #ifdef debug 2065 2172 G4cout<<"G4QNucleus::EvaporateBary: A+N"<<G4endl; 2066 2173 #endif … … 2075 2182 else if(rQPDG==lQPDG)rMass=mLamb; 2076 2183 } 2077 #ifdef pdebug2184 #ifdef debug 2078 2185 G4cout<<"G4QNucleus::EvaporateBary:evaBar="<<eMass<<bQPDG<<",resN="<<rMass<<rQPDG 2079 2186 <<",secB="<<fMass<<",three="<<three<<G4endl; … … 2111 2218 } 2112 2219 G4double r = aLim*G4UniformRand(); 2113 #ifdef pdebug2220 #ifdef debug 2114 2221 G4cout<<"G4QNucl::EvapBar:2Decay r="<<r<<",nLim="<<nLim<<",zLim="<<zLim<<",sLim=" 2115 2222 <<sLim<<",nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl; … … 2145 2252 else 2146 2253 { 2147 #ifdef pdebug2254 #ifdef debug 2148 2255 G4cout<<"G4QNucleus::EvaporateBaryon: Photon #2-B#, dM="<<totMass-GSMass<<G4endl; 2149 2256 #endif … … 2153 2260 rMass=GSMass; 2154 2261 } 2155 #ifdef pdebug2262 #ifdef debug 2156 2263 G4cout<<"G4QNucl::EvaporateBaryon: b="<<eMass<<bQPDG<<",r="<<rMass<<rQPDG<<G4endl; 2157 2264 #endif … … 2159 2266 if(three) // Decay in two baryons + Residual Nucleus 2160 2267 { 2161 #ifdef pdebug2268 #ifdef debug 2162 2269 G4cout<<"G4QNucl::EvaporateBaryon:Decay in 3 particles"<<G4endl; 2163 2270 #endif … … 2180 2287 if(eMass+rMass<totMass&&cntr<cntm) 2181 2288 { 2182 #ifdef pdebug2289 #ifdef debug 2183 2290 G4cout<<"G4QN::EvaB:eM="<<eMass<<"+rM="<<rMass<<" ="<<eMass+rMass<<" < "<<totMass 2184 2291 <<",c="<<cntr<<" < cm="<<cntm<<", bPDG="<<bQPDG<<", rPDG="<<rQPDG<<G4endl; … … 2195 2302 else if(totMass>mNeut+GSResNn) // Neutron if 2-Decay failed 2196 2303 { 2197 #ifdef pdebug2304 #ifdef debug 2198 2305 G4cout<<"G4QNucl::EvaporateBaryon: Neutron , dM="<<totMass-GSResNn-mNeut<<G4endl; 2199 2306 #endif … … 2205 2312 else if(totMass>mProt+PBarr+GSResNp) // Proton if 2-Decay failed 2206 2313 { 2207 #ifdef pdebug2314 #ifdef debug 2208 2315 G4cout<<"G4QNucl::EvaporateBaryon: Proton , dM="<<totMass-GSResNp-mProt<<G4endl; 2209 2316 #endif … … 2215 2322 else if(totMass>mAlph+ABarr+GSResNa) // Alpha if 2-Decay failed 2216 2323 { 2217 #ifdef pdebug2324 #ifdef debug 2218 2325 G4cout<<"G4QNucl::EvaporateBaryon: Alpha , dM="<<totMass-GSResNa-mAlph<<G4endl; 2219 2326 #endif … … 2225 2332 else if(totMass>GSMass) // Photon if 2-Decay failed 2226 2333 { 2227 #ifdef pdebug2334 #ifdef debug 2228 2335 G4cout<<"G4QNucl::EvaporateBaryon:Photon ### 2 ###, dM="<<totMass-GSMass<<G4endl; 2229 2336 #endif … … 2245 2352 //if(2>3) 2246 2353 { 2247 #ifdef pdebug2354 #ifdef debug 2248 2355 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in 2 baryons"<<G4endl; 2249 2356 #endif … … 2313 2420 rQPDG=aaQPDG; 2314 2421 rMass=GSResAA; 2315 #ifdef pdebug2422 #ifdef debug 2316 2423 G4cout<<"G4QNuc::EvapBaryon: A+A, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2317 2424 #endif … … 2324 2431 rQPDG=laQPDG; 2325 2432 rMass=GSResLA; 2326 #ifdef pdebug2433 #ifdef debug 2327 2434 G4cout<<"G4QNuc::EvapBaryon: A+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2328 2435 #endif … … 2335 2442 rQPDG=paQPDG; 2336 2443 rMass=GSResPA; 2337 #ifdef pdebug2444 #ifdef debug 2338 2445 G4cout<<"G4QNuc::EvapBaryon: A+P, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2339 2446 #endif … … 2346 2453 rQPDG=naQPDG; 2347 2454 rMass=GSResNA; 2348 #ifdef pdebug2455 #ifdef debug 2349 2456 G4cout<<"G4QNuc::EvapBaryon: A+N, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2350 2457 #endif … … 2357 2464 rQPDG=llQPDG; 2358 2465 rMass=GSResLL; 2359 #ifdef pdebug2466 #ifdef debug 2360 2467 G4cout<<"G4QNuc::EvapBaryon: L+L, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2361 2468 #endif … … 2368 2475 rQPDG=plQPDG; 2369 2476 rMass=GSResPL; 2370 #ifdef pdebug2477 #ifdef debug 2371 2478 G4cout<<"G4QNuc::EvapBaryon: L+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2372 2479 #endif … … 2379 2486 rQPDG=nlQPDG; 2380 2487 rMass=GSResNL; 2381 #ifdef pdebug2488 #ifdef debug 2382 2489 G4cout<<"G4QNuc::EvapBaryon: L+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2383 2490 #endif … … 2391 2498 rQPDG=ppQPDG; 2392 2499 rMass=GSResPP; 2393 #ifdef pdebug2500 #ifdef debug 2394 2501 G4cout<<"G4QNuc::EvapBaryon: p+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2395 2502 #endif … … 2402 2509 rQPDG=npQPDG; 2403 2510 rMass=GSResNP; 2404 #ifdef pdebug2511 #ifdef debug 2405 2512 G4cout<<"G4QNuc::EvapBaryon: n+p, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2406 2513 #endif … … 2413 2520 rQPDG=nnQPDG; 2414 2521 rMass=GSResNN; 2415 #ifdef pdebug2522 #ifdef debug 2416 2523 G4cout<<"G4QNuc::EvapBaryon: n+n, e="<<eMass<<",f="<<fMass<<",r="<<rMass<<G4endl; 2417 2524 #endif … … 2420 2527 else if(nFlag) 2421 2528 { 2422 #ifdef pdebug2529 #ifdef debug 2423 2530 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in neutron ###"<<G4endl; 2424 2531 #endif … … 2431 2538 else if(pFlag) 2432 2539 { 2433 #ifdef pdebug2540 #ifdef debug 2434 2541 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in proton ###"<<G4endl; 2435 2542 #endif … … 2442 2549 else if(aFlag) 2443 2550 { 2444 #ifdef pdebug2551 #ifdef debug 2445 2552 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in alpha ###"<<G4endl; 2446 2553 #endif … … 2453 2560 else if(lFlag) 2454 2561 { 2455 #ifdef pdebug2562 #ifdef debug 2456 2563 G4cout<<"G4QNucleus::EvaporateBaryon:Photon ### Decay in Lambda ###"<<G4endl; 2457 2564 #endif … … 2464 2571 else 2465 2572 { 2466 #ifdef pdebug2573 #ifdef debug 2467 2574 G4cout<<"G4QNuc::EvaporBaryon: Photon ### 3-Big ###,dM="<<totMass-GSMass<<G4endl; 2468 2575 #endif … … 2480 2587 if(!DecayIn3(h1mom,h2mom,h3mom)) 2481 2588 { 2482 #ifdef pdebug2589 #ifdef debug 2483 2590 G4cout<<"*G4QNucl::EvaporateBaryon:Decay M="<<totMass<<",b="<<eMass<<bQPDG 2484 2591 <<",f="<<fMass<<fQPDG<<",r="<<rMass<<rQPDG<<G4endl; … … 2488 2595 h1mom+=h3mom; 2489 2596 bQPDG=dbQPDG; 2490 #ifdef pdebug2597 #ifdef debug 2491 2598 G4double sma=h1mom.m(); 2492 2599 G4double dma=sma-eMass-fMass; … … 2507 2614 if(!DecayIn2(h1mom,h2mom)) 2508 2615 { 2509 #ifdef pdebug2616 #ifdef debug 2510 2617 G4cout<<"***G4QNucleus::EvaporateBaryon: Emergency Decay M="<<totMass<<",b=" 2511 2618 <<bQPDG<<h1->GetQC()<<eMass<<",r="<<rQPDG<<h2->GetQC()<<rMass<<G4endl; … … 2517 2624 h1->Set4Momentum(h1mom); 2518 2625 h2->Set4Momentum(h2mom); 2519 #ifdef pdebug2626 #ifdef debug 2520 2627 G4cout<<"G4QNuc::EvapBaryon: Emergency decay is done for b="<<bQPDG<<h1->GetQC() 2521 2628 <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl; … … 2526 2633 else // Only decay in Baryon+Residual is possible 2527 2634 { 2528 #ifdef pdebug2635 #ifdef debug 2529 2636 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in Baryon+Resid"<<G4endl; 2530 2637 #endif … … 2556 2663 aLim+=CoulBarPenProb(ABarr,ken,2,4)*sqrt(ken)*evalph*Z*(Z-1)*N*(N-1) 2557 2664 *6/a1/(a-2)/(a-3); 2558 #ifdef pdebug2665 #ifdef debug 2559 2666 G4cout<<"G4QNucleus::EvaporateBaryon:al="<<evalph<<",k="<<ken<<",P=" 2560 2667 <<CoulBarPenProb(ABarr,ken,2,4)<<G4endl; … … 2562 2669 } 2563 2670 G4double r = aLim*G4UniformRand(); 2564 #ifdef pdebug2671 #ifdef debug 2565 2672 G4cout<<"G4QN::EB:DecIn2#2#r="<<r<<",nL="<<nLim<<",zL="<<zLim<<",sL="<<sLim<<",aL=" 2566 2673 <<aLim<<",nF="<<nFlag<<",pF="<<pFlag<<",lF="<<lFlag<<",aF="<<aFlag<<G4endl; … … 2572 2679 rQPDG=AQPDG; 2573 2680 rMass=GSResNa; 2574 #ifdef pdebug2681 #ifdef debug 2575 2682 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in A + rA="<<GSResNa+mAlph<<G4endl; 2576 2683 #endif … … 2592 2699 rQPDG=PQPDG; 2593 2700 rMass=GSResNp; 2594 #ifdef pdebug2701 #ifdef debug 2595 2702 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in P + rA="<<GSResNp+mProt<<G4endl; 2596 2703 #endif … … 2602 2709 rQPDG=NQPDG; 2603 2710 rMass=GSResNn; 2604 #ifdef pdebug2711 #ifdef debug 2605 2712 G4cout<<"G4QNucleus::EvaporateBaryon: Decay in N + rA="<<GSResNn+mNeut<<G4endl; 2606 2713 #endif … … 2608 2715 else if(mProt+GSResNp<totMass) 2609 2716 { 2610 #ifdef pdebug2717 #ifdef debug 2611 2718 G4cout<<"G4QNucl::EvapBar: Emergency Proton, dM="<<totMass-GSResNp-mProt<<G4endl; 2612 2719 #endif … … 2618 2725 else if(mAlph+GSResNa<totMass) 2619 2726 { 2620 #ifdef pdebug2727 #ifdef debug 2621 2728 G4cout<<"G4QNucl::EvapBar: Emergency Alpha, dM="<<totMass-GSResNa-mAlph<<G4endl; 2622 2729 #endif … … 2628 2735 else 2629 2736 { 2630 #ifdef pdebug2737 #ifdef debug 2631 2738 G4cout<<"G4QNuc::EvapBaryon: Photon ### 4-Big ###, dM="<<totMass-GSMass<<G4endl; 2632 2739 #endif … … 2648 2755 if(!DecayIn2(h1mom,h2mom)) 2649 2756 { 2650 #ifdef pdebug2757 #ifdef debug 2651 2758 G4cout<<"*G4QNucleus::EvaporateBaryon: Decay M="<<totMass<<",b="<<bQPDG<<h1->GetQC() 2652 2759 <<eMass<<",r="<<rQPDG<<h2->GetQC()<<rMass<<G4endl; … … 2654 2761 return false; 2655 2762 } 2656 #ifdef pdebug2763 #ifdef debug 2657 2764 G4cout<<"G4QN::EvaB: **RESULT** b="<<bQPDG<<h1mom<<", r="<<rQPDG<<h2mom<<G4endl; 2658 2765 #endif … … 2661 2768 h1->Set4Momentum(h1mom); 2662 2769 h2->Set4Momentum(h2mom); 2663 #ifdef pdebug2770 #ifdef debug 2664 2771 G4cout<<"G4QNucleus::EvaporateBaryon: Evaporation is done for b="<<bQPDG<<h1->GetQC() 2665 2772 <<h1mom<<h1mom.m()<<", r="<<rQPDG<<h2->GetQC()<<h2mom<<h2mom.m()<<G4endl; … … 2669 2776 else if(a==1) 2670 2777 { 2671 #ifdef pdebug2778 #ifdef debug 2672 2779 G4cerr<<"***G4QNucleus::EvaporateBaryon: ??? A=1"<<G4endl; 2673 2780 #endif … … 3089 3196 static const G4double mNeut= G4QPDGCode(2112).GetMass(); // Mass of neutron 3090 3197 static const G4double mProt= G4QPDGCode(2212).GetMass(); // Mass of proton 3091 if(!cZ && !cA) return Z*mProt+N*mNeut-G 4QNucleus(Z,N,0).GetGSMass(); // For QGSM3198 if(!cZ && !cA) return Z*mProt+N*mNeut-GetGSMass(); // Total binding energy far all 3092 3199 G4double GSM=GetGSMass(); 3093 3200 G4int iZ=static_cast<int>(cZ); … … 3209 3316 sR=sqrt(CBD/ED); 3210 3317 //sR=sqrt(wD/ED); 3211 #ifdef pdebug3318 #ifdef debug 3212 3319 G4cout<<"G4QN::CBPP:s="<<sR<<",E="<<E<<",w="<<wD<<",CB="<<CB<<",B="<<B<<",C="<<C<<G4endl; 3213 3320 #endif … … 3229 3336 } 3230 3337 while(x*x+y*y > 1.); 3338 std::pair<G4double, G4double> theImpactParameter; 3231 3339 theImpactParameter.first = x*maxImpact; 3232 3340 theImpactParameter.second = y*maxImpact; … … 3237 3345 void G4QNucleus::ChooseNucleons() 3238 3346 { 3347 #ifdef debug 3348 G4cout<<"G4QNucleus::ChooseNucleons: Nucleons search is started"<<rho0<<G4endl; 3349 #endif 3239 3350 G4int protons =0; 3240 3351 G4int nucleons=0; 3241 G4int myA=GetA();3242 while (nucleons < myA)3243 { 3244 if(protons<Z && G4UniformRand() < G4double(Z-protons)/G4double( myA-nucleons) )3352 G4int theA=GetA(); 3353 while (nucleons < theA) 3354 { 3355 if(protons<Z && G4UniformRand() < G4double(Z-protons)/G4double(theA-nucleons) ) 3245 3356 { 3246 3357 protons++; … … 3249 3360 theNucleons.push_back(proton); 3250 3361 } 3251 else if ( (nucleons-protons) < (myA-Z))3362 else if ( (nucleons-protons) < N ) 3252 3363 { 3253 3364 nucleons++; … … 3265 3376 static const G4double mProt= G4QPDGCode(2212).GetMass(); 3266 3377 static const G4double mProt2= mProt*mProt; 3267 G4int i=0; // general index 3268 G4int myA=GetA(); // cashed value of A 3269 G4ThreeVector aPos; // Prototype of nucleon position 3270 G4ThreeVector delta; // Prototype of distance between nucleons 3271 G4ThreeVector* places = new G4ThreeVector[myA]; // Vector of 3D positions 3272 G4double* placeM = new G4double[myA]; // Vector of radii 3273 G4bool freeplace; // flag of free space available 3274 G4double nucDist2 = nucleonDistance*nucleonDistance; // @@ can be a common static 3275 G4double maxR=GetRadius(0.01); // there are no nucleons at this density 3276 while(i<myA) // LOOP over all nucleons 3277 { 3278 aPos = maxR*RandomUnitSphere(); // Get random position of nucleon iside maxR 3279 G4double density=GetRelativeDensity(aPos); 3378 static const G4double third= 1./3.; 3379 #ifdef debug 3380 G4cout<<"G4QNucl::ChoosePositions: is called"<<G4endl; 3381 #endif 3382 G4int i=0; // nucleon index 3383 G4int theA=GetA(); // cashed value of A 3384 G4int lastN=theA-1; // cashed value of A-1 (theLastNucleon index) 3385 G4ThreeVector aPos(0.,0.,0.); // Prototype of the nucleon position 3386 G4double rPos=0.; // Radius of the nucleon position 3387 G4ThreeVector delta(0.,0.,0.); // Prototype of the distance between nucleons 3388 G4ThreeVector* places= new G4ThreeVector[theA]; // Vector of 3D positions 3389 G4bool freeplace= false; // flag of free space available 3390 G4double nucDist2= nucleonDistance*nucleonDistance; // @@ can be a common static 3391 G4double maxR= GetRadius(0.01); // there are cond no nucleons at this density 3392 G4ThreeVector sumPos(0.,0.,0.); // Vector of the current 3D sum 3393 while(i<theA) // LOOP over all nucleons 3394 { 3395 rPos = maxR*pow(G4UniformRand(),third); // Get random radius of the nucleon position 3396 G4double density=rPos*rPos; // Density at R (temporary squared radius) 3397 if(theA<17) density=GetRelOMDensity(density); // Oscilator model (M.K.?) 3398 else density=GetRelWSDensity(rPos); // Wood-Saxon model 3399 #ifdef debug 3400 G4cout<<"G4QNucl::ChoosePositions: i="<<i<<", pos="<<aPos<<", dens="<<density<<G4endl; 3401 #endif 3280 3402 if(G4UniformRand()<density) // Try this position with frequency ~Density 3281 3403 { 3404 // @@ Gaussian oscilator distribution is good only up to He4 (s-wave). Above: p-wave 3405 // (1+k*(r^2/R^2)]*exp[-r^2/R^2]. A=s+p=4+3*4=16 (M.K.) So Li,Be,C,N,O are wrong 3406 if(i==lastN) aPos=-rPos*sumPos.unit(); // TheLast tries to compensate CenterOfGravity 3407 else aPos=rPos*G4RandomDirection(); // It uses the standard G4 function 3282 3408 freeplace = true; // Imply that there is a free space 3283 3409 for(G4int j=0; j<i && freeplace; j++) // Check that there is no overlap with others 3284 3410 { 3285 3411 delta = places[j] - aPos; // Distance to nucleon j 3286 freeplace= delta.mag2()>nucDist2; // If false break the LOOP (M.K.) 3287 if(!freeplace) break; // M.K. acceleration 3412 freeplace= delta.mag2()>nucDist2; // If false break the LOOP 3288 3413 } 3289 3414 // protons must at least have binding energy of CoulombBarrier (@@ ? M.K.), so 3290 3415 // assuming Fermi Energy corresponds to Potential, we must place protons such 3291 3416 // that the Fermi Energy > CoulombBarrier (?) 3292 if(freeplace && theNucleons[i]->GetPDGCode() == 2212) // Free Space Protons 3417 // @@ M.K.: 1. CoulBar depends on aPos; 2. Makes Isotopic assymetry (!); 3. Perform. 3418 G4int nucPDG= theNucleons[i]->GetPDGCode(); 3419 #ifdef debug 3420 G4cout<<"G4QNucl::ChoosePositions: frpl="<<freeplace<<", nucPDG="<<nucPDG<<G4endl; 3421 #endif 3422 if(freeplace && nucPDG == 2212) // Free Space Protons 3293 3423 { 3294 3424 G4double pFermi=GetFermiMomentum(GetDensity(aPos)); 3295 G4double eFermi= sqrt(pFermi*pFermi+mProt2)-mProt; // Kinetic energy3425 G4double eFermi= sqrt(pFermi*pFermi+mProt2)-mProt; // Kinetic energy 3296 3426 if (eFermi <= CoulombBarrier()) freeplace=false; 3297 3427 } 3298 3428 if(freeplace) 3299 3429 { 3430 #ifdef debug 3431 G4cout<<"G4QNucl::ChoosePositions: fill nucleon i="<<i<<", V="<<aPos<<G4endl; 3432 #endif 3300 3433 places[i]=aPos; 3434 sumPos+=aPos; 3301 3435 ++i; 3302 3436 } 3303 3437 } 3304 3438 } 3305 ReduceSum(places,placeM); // Reduce center of mass shift (equalWeight) 3306 for(i=0; i<myA; i++) theNucleons[i]->SetPosition(places[i]); 3439 #ifdef debug 3440 G4cout<<"G4QNucl::ChoosePositions: Out of the positioning LOOP"<<G4endl; 3441 #endif 3442 if(theA > 2) ReduceSum(places,sumPos); // Reduce the CM shift (equal weights) 3443 #ifdef debug 3444 G4cout<<"G4QNucl::ChoosePositions: The reduced summ is made"<<G4endl; 3445 #endif 3446 for(i=0; i<theA; i++) theNucleons[i]->SetPosition(places[i]); 3307 3447 delete [] places; 3308 delete [] placeM; 3309 #ifdef debug 3310 G4cout << "G4QNucleus::ChoosePositions: A="<<myA<<G4endl; 3448 #ifdef debug 3449 G4cout << "G4QNucleus::ChoosePositions: The positions are defined for A="<<theA<<G4endl; 3311 3450 #endif 3312 3451 } // End of ChoosePositions … … 3315 3454 void G4QNucleus::InitDensity() 3316 3455 { 3317 static const G4double deld=0.545*fermi; // Surface thickness 3318 static const G4double r0sq=0.8133*fermi*fermi; // Base for A-dep of rel.mean.radius 3456 static const G4double r0sq=0.8133*fermi*fermi; // Base for A-dep of rel.mean.radius 3319 3457 static const G4double third=1./3.; 3320 3458 G4int iA = GetA(); … … 3322 3460 G4double At = pow(rA,third); 3323 3461 G4double At2= At*At; 3324 if(iA<17) // Gaussian density distribution 3325 { 3326 radius = r0sq*At2; // Mean Squared Radius (fm^2) 3327 rho0 = pow(pi*radius, -1.5); // Central Density 3328 } 3329 else // Wood-Saxon density distribution 3330 { 3331 G4double r0=1.16*(1.-1.16/At2)*fermi; // Base for A-dependent radius 3332 G4double rd=deld/r0; // Relative thickness of the surface 3333 radius = r0*At; // Half Density Radius (fm) 3334 rho0=0.75/(pi*pow(r0,3.)*iA*(1.+rd*rd*pi2)); // Central Density 3335 } 3462 #ifdef debug 3463 G4cout<<"G4QNucleus::InitDensity: rA=iA=A="<<iA<<", A^1/3="<<At<<", A^2/3="<<At2<<G4endl; 3464 #endif 3465 if(iA<17) // Gaussian density distribution 3466 { 3467 radius = r0sq*At2; // R2 Mean Squared Radius (fm^2) 3468 if(radius<=0.) 3469 { 3470 G4cout<<"-Warning-G4QNucl::ChoosePositions:L,iA="<<iA<<",Radius(?)="<<radius<<G4endl; 3471 radius=1.; 3472 } 3473 rho0 = pow(2*pi*radius, -1.5); // Central Density (M.K. 2 is added) 3474 // V=4pi*R2*sqrt(pi*R2/2)=(sqrt(2*pi*R2))^3 3475 } 3476 else // Wood-Saxon density distribution 3477 { 3478 G4double r0=1.16*(1.-1.16/At2)*fermi; // Base for A-dependent radius 3479 radius = r0*At; // Half Density Radius (fm) 3480 if(radius<=0.) 3481 { 3482 G4cout<<"-Warning-G4QNucl::ChoosePositions:H,iA="<<iA<<",Radius(?)="<<radius<<G4endl; 3483 radius=1.; 3484 } 3485 G4double rd=WoodSaxonSurf/radius; // Relative thickness of the surface 3486 if(!(rd<=0.1) && !(rd>-0.1)) // NAN for rd 3487 { 3488 G4cout<<"-Warning-G4QNucl::ChoosePositions:H,NAN,iA="<<iA<<", rd="<<rd<<G4endl; 3489 rd=1.; 3490 } 3491 rho0=0.75/(pi*pow(radius,3)*(1.+rd*rd*pi2)); // Central Density 3492 } 3493 RhoActive=true; 3336 3494 } // End of InitDensity 3337 3495 3338 // Calculates Derivity of the nuclear density (for Binary Cascade, can be absolete)3496 // Calculates Derivity of the nuclear density 3339 3497 G4double G4QNucleus::GetDeriv(const G4ThreeVector& aPosition) 3340 3498 { 3341 static const G4double deld=0.545*fermi; // Surface thickness3342 3499 if(radius==0.) InitDensity(); 3343 3500 G4double rPos=aPosition.mag(); … … 3345 3502 // Wood-Saxon density distribution 3346 3503 G4double dens=GetRelativeDensity(aPosition); 3347 return -exp((rPos-radius)/ deld)*dens*dens*rho0/deld;3504 return -exp((rPos-radius)/WoodSaxonSurf)*dens*dens*rho0/WoodSaxonSurf; 3348 3505 } // End of GetDeriv 3349 3506 3350 // Radius of the deffinit % of nuclear density 3507 // Radius of the deffinit % of nuclear density (very strange solution ?? @@ M.K.) 3351 3508 G4double G4QNucleus::GetRadius(const G4double maxRelDens) 3352 3509 { 3353 static const G4double deld=0.545*fermi; // Surface thickness3354 3510 if(radius==0.) InitDensity(); 3355 3511 if(GetA()<17) // Gaussian density distribution 3356 return (maxRelDens>0 && maxRelDens <= 1. ) ? sqrt(-radius*log(maxRelDens) ) : DBL_MAX;3512 return (maxRelDens>0 && maxRelDens <= 1. ) ? sqrt(-radius*log(maxRelDens) ) : DBL_MAX; 3357 3513 // Wood-Saxon density distribution 3358 return (maxRelDens>0 && maxRelDens <= 1. ) ? 3359 (radius + deld*log((1.-maxRelDens+exp(-radius/deld))/maxRelDens)) : DBL_MAX;3360 } // End of GetRadius 3514 return (maxRelDens>0 && maxRelDens <= 1. ) ? (radius + WoodSaxonSurf* 3515 log((1.-maxRelDens+exp(-radius/WoodSaxonSurf))/maxRelDens) ) : DBL_MAX; 3516 } // End of GetRadius (check @@ radius=sqr0 (fm^2) for A<17, r0 (fm) for A>16 (units) 3361 3517 3362 3518 // Calculates Densyty/rho0 3363 3519 G4double G4QNucleus::GetRelativeDensity(const G4ThreeVector& aPosition) 3364 3520 { 3365 static const G4double deld=0.545*fermi; // Surface thickness3366 3521 if(radius==0.) InitDensity(); 3367 if(GetA()<17)return exp(-aPosition.mag2()/radius);// Gaussian distribution 3368 // Wood-Saxon density distribution 3369 return 1./(1.+exp((aPosition.mag()-radius)/deld)); 3522 if(GetA()<17) return GetRelOMDensity(aPosition.mag2());// Gaussian distribution (OscMod?) 3523 return GetRelWSDensity(aPosition.mag()); // Wood-Saxon density distribution 3370 3524 } // End of GetRelativeDensity 3371 3525 … … 3383 3537 static const G4double mProt= G4QPDGCode(2212).GetMass(); // Mass of proton 3384 3538 static const G4double mProt2= mProt*mProt; 3385 static const G4double mNeut= G4QPDGCode(2112).GetMass(); // Mass of neutron 3539 //static const G4double mNeut= G4QPDGCode(2112).GetMass(); // Mass of neutron 3540 static const G4double third= 1./3.; 3386 3541 G4int i=0; 3387 G4double density=0; 3388 G4int myA=GetA(); 3389 G4ThreeVector* momentum = new G4ThreeVector[myA]; 3390 G4double* fermiM = new G4double[myA]; 3391 for(i=0; i<myA; i++) // momenta for all, including the last, in case we swap nucleons 3542 G4double density=0.; // Prototype of density for Loop calc 3543 G4int theA=GetA(); // Atomic weight of the nucleus 3544 G4int am1=theA-1; // The last index in the Loop 3545 G4ThreeVector* momentum = new G4ThreeVector[theA]; // Temporary array for nucleon's moms 3546 G4ThreeVector sumMom(0.,0.,0.); // Sum of all momenta for mom-conserv 3547 #ifdef debug 3548 G4cout<<"G4QNucleus::ChooseFermiMomentum is called for Z="<<Z<<", N="<<N<<G4endl; 3549 #endif 3550 for(i=0; i<theA; i++) // momenta for all, including the last, in case we swap nucleons 3392 3551 { 3393 3552 density=GetDensity(theNucleons[i]->GetPosition());// density around nucleon i 3394 G4double ferm = GetFermiMomentum(density); // module of momentun for nucleon i 3395 fermiM[i] = ferm; // module of momentun for nucleon i 3396 G4ThreeVector mom=ferm*RandomUnitSphere(); // 3-vector for nucleon mpomentum 3397 if(theNucleons[i]->GetPDGCode() == 2212) // the nucleon is proton 3553 G4double ferm = GetFermiMomentum(density); // module of momentum for nucleon i 3554 G4ThreeVector mom(0.,0.,0.); // proto 3vector for nucleon momentum 3555 G4double rn3=pow(G4UniformRand(),third); // Spherical randomization 3556 G4ThreeVector dir(0.,0.,0.); // proto 3vector for the momDirection 3557 if( i == am1) dir=-sumMom.unit(); // try to compensate the mom noncons. 3558 else dir=G4RandomDirection(); // free randomization for i < A-1 3559 if(theNucleons[i]->GetPDGCode() == 2212) // the nucleon is a proton 3398 3560 { 3399 3561 G4double eMax = sqrt(ferm*ferm+mProt2)-CoulombBarrier(); 3400 if(eMax>mProt) 3401 { 3402 G4double pmax2= eMax*eMax - mProt2; 3403 fermiM[i] = sqrt(pmax2); // modify proton momentum 3404 while(mom.mag2() > pmax2) mom=Get3DFermiMomentum(density, fermiM[i]); 3405 } 3406 else 3407 { 3408 G4cerr<<"G4QNucleus: difficulty finding proton momentum -> mom=0"<<G4endl; 3409 mom=0; 3410 } 3411 } 3562 if(eMax>mProt) mom=sqrt(eMax*eMax - mProt2)*rn3*dir; // 3D proton momentum 3563 #ifdef debug 3564 else G4cerr<<"-Warning-G4QNucleus::ChooseFermM: FailToGetProtonMomentum,p=0"<<G4endl; 3565 #endif 3566 } 3567 else mom=ferm*rn3*dir; // 3-vector for the neutron momentum 3412 3568 momentum[i]= mom; 3413 } 3414 ReduceSum(momentum,fermiM); // Reduse momentum nonconservation 3415 for(i=0; i< myA ; i++ ) 3416 { 3417 G4double mN=mNeut; 3418 if(theNucleons[i]->GetPDGCode() == 2212) mN=mProt; 3419 G4double energy = mN - BindingEnergy()/myA; 3420 G4LorentzVector tempV(momentum[i],energy); 3569 sumMom+= mom; 3570 #ifdef pdebug 3571 G4cout<<"G4QNucleus::ChooseFermiMomentum: for i="<<i<<", candidate mom="<<mom<<G4endl; 3572 #endif 3573 } 3574 if(theA > 2) SimpleSumReduction(momentum, sumMom); // Reduse momentum nonconservation 3575 //G4double bindEn=BindingEnergy()/theA; 3576 G4int thisPDG=GetPDG(); 3577 G4double rMp=G4QPDGCode(thisPDG-1000).GetMass(); // Residual for the proton 3578 G4double rMn=G4QPDGCode(thisPDG-1).GetMass(); // Residual for the neutron 3579 G4double rMp2=rMp*rMp; 3580 G4double rMn2=rMn*rMn; 3581 G4double rM=rMn; 3582 G4double rM2=rMn2; 3583 G4double thisM=GetGSMass(); 3584 #ifdef pdebug 3585 G4LorentzVector sum(0.,0.,0.,0.); 3586 #endif 3587 for(i=0; i< theA ; i++ ) 3588 { 3589 if(theNucleons[i]->GetPDGCode() == 2212) 3590 { 3591 rM=rMp; 3592 rM2=rMp2; 3593 } 3594 else 3595 { 3596 rM=rMn; 3597 rM2=rMn2; 3598 } 3599 G4ThreeVector curMom = momentum[i]; 3600 G4double energy = thisM-std::sqrt(rM2+curMom.mag2()); // @@ update after splitting 3601 G4LorentzVector tempV(curMom,energy); 3602 #ifdef pdebug 3603 G4cout<<"G4QNucleus::ChooseFermiMomentum: FINALLY for i="<<i<<", 4mom="<<tempV<<G4endl; 3604 sum+=tempV; 3605 #endif 3421 3606 theNucleons[i]->Set4Momentum(tempV); 3422 3607 } 3608 #ifdef pdebug 3609 G4cout<<"G4QNucleus::ChooseFermiMomentum: FINALLY sum4M="<<sum<<G4endl; 3610 #endif 3423 3611 delete [] momentum; 3424 delete [] fermiM;3425 3612 } // End of ChooseFermiMomenta 3426 3613 3427 // Reduce momentum nonconservation (reenterable attempts3428 G4bool G4QNucleus::ReduceSum(G4ThreeVector* momentum, G4double* pFermiM)3614 // Reduce momentum nonconservation or center of mass shift (Changes the momena!) 3615 void G4QNucleus::SimpleSumReduction(G4ThreeVector* vect, G4ThreeVector sum) 3429 3616 { 3430 G4int myA=GetA(); 3431 if(myA<2) // Can not reduce only one nucleon 3432 { 3433 G4cout<<"-W-G4QNucleus::ReduceSum: *Failed* A="<<myA<<" < 2"<<G4endl; 3617 G4int theA=GetA(); // A#of nucleons 3618 sum/=theA; 3619 for(G4int i=0; i<theA; i++) vect[i]-=sum; // Simple reduction 3620 } 3621 3622 // Reduce momentum nonconservation or center of mass shift (Keep values of momena) @@Bug!@@ 3623 G4bool G4QNucleus::ReduceSum(G4ThreeVector* vect, G4ThreeVector sum) 3624 { 3625 G4int theA=GetA(); // A#of nucleons 3626 if(theA<3) // Can not reduce for 1 or 2 nucleons 3627 { 3628 G4cout<<"-Warning-G4QNucleus::ReduceSum: *Failed* A="<<theA<<" < 3"<<G4endl; 3434 3629 return false; 3435 3630 } 3436 G4int i=0; // To avoid declaration in j-LOOP 3437 G4ThreeVector sum(0.,0.,0.); // The sum which must be reduced 3438 G4double minV=DBL_MAX; // Min value of Fermi Momentum 3439 G4double maxV=0.; // Max value of Fermi Momentum 3440 G4int maxI=-1; // Index of maximum Fermi Momentum 3441 for(i=0; i<myA; i++) 3442 { 3443 sum+=momentum[i]; // Make sum of 3D Momenta 3444 G4double pfi=pFermiM[i]; // To avoid multiple call by index 3445 if(pfi<minV) minV=pfi; // Find the minimum Fermi Momentum 3446 if(pfi>maxV) // Better maximum is found 3447 { 3448 maxV=pfi; // Find the maximum Fermi Momentum 3449 maxI=i; // Index of maximum Fermi Momentum 3450 } 3451 } 3452 minV*=0.01; // Value to estimate residual (@@par) 3453 if(sum.mag()<minV) // Probably reduction is not needed 3454 { 3455 momentum[maxI]-=sum; // add residual to maximum momentum 3456 pFermiM[maxI]=momentum[maxI].mag(); // udate only one Fermi Momentum 3457 return true; 3458 } 3459 G4double* fm2 = new G4double[myA]; // collect temporary squared FermiMom 3460 for(i=0; i<myA; i++) fm2[i]=pFermiM[i]*pFermiM[i]; // calculate squared Fermi Momenta 3461 G4int myA1=myA-1; // to avoid calculation in the j-LOOP 3462 for(G4int j=0; j<myA; j++) // Not more than myA attempts 3463 { 3464 G4double minP=DBL_MAX; // Minimal progection value 3465 G4int minI=-1; // Minimal projection index 3466 for(i=0; i<myA; i++) // Sirch for minimum projection 3467 { 3468 G4double proj=fabs(sum.dot(momentum[i])/fm2[i]);// abs value of |sum|*cos(theta) 3469 if(proj<minP) 3470 { 3471 minP=proj; 3631 // The last vector must have the same direction as the SUM (do not take into account 3632 G4int am1=theA-1; // A-1 elements, which canBeCorrected 3633 G4double sum2=sum.mag2(); // Initial squared sum 3634 G4double hsum2=sum2/2; // Half squared sum 3635 G4double* dp= new G4double[am1]; // Displacements 3636 G4int m=am1; // #0fVectors used for correction 3637 G4double minS=DBL_MAX; // Min value of Fermi Momentum 3638 G4int minI=0; // Index of maximum Fermi Momentum 3639 for(G4int i=0; i<am1; i++) dp[i]=sum.dot(vect[i]);// Calculation of dot-products 3640 while(m) 3641 { 3642 m=0; 3643 for(G4int i=0; i<am1; i++) if(dp[i]>0 && dp[i]<sum2) // can be used for the reduction 3644 { 3645 m++; 3646 G4double shift=fabs(dp[i]-hsum2); 3647 if(shift < minS) 3648 { 3649 minS=shift; 3472 3650 minI=i; 3473 3651 } 3474 3652 } 3475 G4ThreeVector cand=momentum[minI]-sum; 3476 G4double canV=cand.mag(); // what we've got 3477 if(canV<0.000001) // Never should come in 3478 { 3479 G4cout<<"-W-G4QNucleus::ReduceSumm: *Failed* A="<<myA<<",C="<<canV<<",j="<<j<<G4endl; 3480 return false; 3481 } 3482 cand = cand*pFermiM[minI]/canV; // pFermiM is unchanged ! 3483 sum += cand-momentum[minI]; // sum is updated 3484 momentum[minI] = cand; // Update direction of the momentum 3485 if(sum.mag()<minV || j == myA1) // Two resons to finish reduction 3486 { 3487 momentum[maxI]-=sum; // add residual to maximum momentum 3488 pFermiM[maxI]=momentum[maxI].mag(); // update the biggest momentum 3489 } 3490 } 3653 if(m) // There is a vector reducing the sum 3654 { 3655 G4ThreeVector x=(dp[minI]/hsum2)*sum; // turn-reduction of the sum-vector 3656 vect[minI]-=x; // turn the minI-th vector 3657 sum-=x; // reduce the sum 3658 sum2=sum.mag2(); // Current squared sum 3659 hsum2=sum2/2; // Current half squared sum 3660 } 3661 } 3662 if(sum2 > 0.) 3663 { 3664 sum/=theA; 3665 for(G4int i=0; i<theA; i++) vect[i]-=sum; // Final reduction 3666 } 3667 delete[] dp; 3491 3668 return true; 3492 3669 } // End of ReduceSum … … 3498 3675 G4cout<<"G4QNucleus::Init3D: is called currentNucleon="<<currentNucleon<<G4endl; 3499 3676 #endif 3500 if(currentNucleon>-1) return; // This is a global parameter in Body 3501 G4int myA = GetA(); 3502 #ifdef debug 3503 G4cout<<"G4QNucleus::Init3D: A="<<myA<<", Z="<<Z<<G4endl; 3677 for_each(theNucleons.begin(),theNucleons.end(),DeleteQHadron()); 3678 theNucleons.clear(); 3679 G4int theA = GetA(); 3680 ChooseNucleons(); 3681 #ifdef debug 3682 G4cout<<"G4QNucleus::Init3D: Nucleons are initialized, nN="<<theNucleons.size()<<G4endl; 3504 3683 #endif 3505 3684 InitDensity(); 3506 ChooseNucleons(); 3507 ChoosePositions(); 3508 ChooseFermiMomenta(); 3509 G4double Ebind= BindingEnergy()/myA; 3510 for (G4int i=0; i<myA; i++) theNucleons[i]->SetBindingEnergy(Ebind); // @@ ? M.K. 3685 #ifdef debug 3686 G4cout<<"G4QNucl::Init3D: DensityPars for A="<<theA<<":R="<<radius <<",r0="<<rho0<<G4endl; 3687 #endif 3688 ChoosePositions(); // CMS positions! No Lorentz boost! Use properely! 3689 #ifdef debug 3690 G4cout<<"G4QNucleus::Init3D: Nucleons are positioned in the coordinate space"<<G4endl; 3691 #endif 3692 ChooseFermiMomenta(); // CMS Fermi Momenta! Must be transfered to the LS if not at rest! 3693 G4ThreeVector n3M=Get3Momentum(); // Velocity of the nucleus in LS 3694 if(n3M.x() || n3M.y() || n3M.z()) // Boost the nucleons to LS 3695 { 3696 n3M/=GetEnergy(); // Now this is the boost velocity 3697 DoLorentzBoost(n3M); // Now nucleons are in LS 3698 } 3699 #ifdef debug 3700 G4cout<<"G4QNucleus::Init3D: Nucleons are positioned in the momentum space"<<G4endl; 3701 #endif 3702 G4double Ebind= BindingEnergy()/theA; 3703 for (G4int i=0; i<theA; i++) theNucleons[i]->SetBindingEnergy(Ebind); // @@ ? M.K. 3511 3704 currentNucleon=0; // Automatically starts the LOOP 3512 return; 3705 return; 3513 3706 } // End of Init3D 3514 3707 … … 3517 3710 { 3518 3711 G4double maxradius2=0; 3519 G4int myA=theNucleons.size();3520 if( myA) for(G4int i=0; i<myA; i++)3712 G4int theA=theNucleons.size(); 3713 if(theA) for(G4int i=0; i<theA; i++) 3521 3714 { 3522 3715 G4double nucr2=theNucleons[i]->GetPosition().mag2(); … … 3525 3718 return sqrt(maxradius2)+nucleonDistance; 3526 3719 } // End of GetOuterRadius 3527 3528 //3529 void G4QNucleus::DoLorentzBoost(const G4LorentzVector& theBoost)3530 {3531 G4int myA=theNucleons.size();3532 if(myA) for(G4int i=0; i<myA; i++) theNucleons[i]->Boost(theBoost);3533 } // End of DoLorentzBoost(G4LorentzVector)3534 3535 //3536 void G4QNucleus::DoLorentzBoost(const G4ThreeVector& theBoost)3537 {3538 G4int myA=theNucleons.size();3539 if(myA) for(G4int i=0; i<myA; i++) theNucleons[i]->Boost(theBoost);3540 } // End of DoLorentzBoost(G4ThreeVector)3541 3720 3542 3721 // … … 3545 3724 G4double bet2=theBeta.mag2(); 3546 3725 G4double factor=(1.-sqrt(1.-bet2))/bet2; // 1./(beta2*gamma2) 3547 G4int myA=theNucleons.size();3548 if( myA) for (G4int i=0; i< myA; i++)3726 G4int theA=theNucleons.size(); 3727 if(theA) for (G4int i=0; i< theA; i++) 3549 3728 { 3550 3729 G4ThreeVector pos=theNucleons[i]->GetPosition(); … … 3557 3736 void G4QNucleus::DoTranslation(const G4ThreeVector& theShift) 3558 3737 { 3559 G4int myA=theNucleons.size();3560 if( myA) for(G4int i=0; i<myA; i++)3738 G4int theA=theNucleons.size(); 3739 if(theA) for(G4int i=0; i<theA; i++) 3561 3740 theNucleons[i]->SetPosition(theNucleons[i]->GetPosition() + theShift); 3562 3741 } // End of DoTranslation … … 3565 3744 G4bool G4QNucleus::StartLoop() 3566 3745 { 3567 G4int myA=theNucleons.size();3568 if( myA) currentNucleon=0;3746 G4int theA=theNucleons.size(); 3747 if(theA) currentNucleon=0; 3569 3748 else G4cout<<"-Warning-G4QNucleus::StartLoop: LOOP starts for uninited nucleons"<<G4endl; 3570 return myA;3749 return theA; 3571 3750 } // End of StartLoop 3572 3751 … … 3595 3774 T=C*E/(1.+E); // T(b) in fm^-2 3596 3775 } 3776 TbActive=true; // Flag of activation 3597 3777 } // End of "ActivateBThickness" 3598 3778 3599 // Randomize position inside 3D UnitRadius Sphere 3600 G4ThreeVector G4QNucleus::RandomUnitSphere() 3601 { // ================== 3602 G4double x=G4UniformRand(), y=G4UniformRand(), z=G4UniformRand(); 3603 G4double r2= x*x+y*y+z*z; 3604 while(r2>1.) 3605 { 3606 x = G4UniformRand(); y = G4UniformRand(); z = G4UniformRand(); 3607 r2=x*x+y*y+z*z; 3608 } 3609 return G4ThreeVector(x, y, z); 3610 } // End of RandomUnitSphere 3779 // Calculate the integral of T(b) 3780 G4double G4QNucleus::GetTbIntegral() // Calculate the integral of T(b) 3781 //================================== 3782 { 3783 if(!TbActive) ActivateBThickness(); 3784 G4int nt = Tb.size(); 3785 G4double sum=0.; 3786 for(G4int i=0; i<nt; ++i) sum+=i*Tb[i]; 3787 sum*=.02*pi; 3788 #ifdef debug 3789 G4cout<<"G4QNucleus::GetTbIntegral:TI="<<sum<<", RI="<<4*pi*rho0*pow(radius,3)/3<<G4endl; 3790 #endif 3791 return sum; 3792 } 3793 3794 // Calculates T(b) 3795 G4double G4QNucleus::GetBThickness(G4double b) 3796 //============================================ 3797 { 3798 static const G4double dfermi=fermi/10.; 3799 static const G4double sfermi=fermi*fermi; 3800 if(!TbActive) ActivateBThickness(); 3801 G4double bf = b/dfermi; 3802 G4int nb = static_cast<int>(bf); 3803 G4int eb = nb+1; 3804 G4int nt = Tb.size(); 3805 if(eb>=nt) return 0.; 3806 G4double nT=Tb[nb]; 3807 G4double eT=Tb[eb]; 3808 return (nT-(bf-nb)*(nT-eT))/sfermi; // Independent units 3809 } 3810 3811 // Calculates T(b)/rho0 3812 G4double G4QNucleus::GetThickness(G4double b) 3813 //=========================================== 3814 { 3815 G4int tA=GetA(); 3816 if(tA<1) 3817 { 3818 G4cout<<"-Warning-G4QNucleus::GetThickness: for A="<<tA<<", => return 0"<<G4endl; 3819 return 0.; 3820 } 3821 else if(tA==1) return 0.; 3822 if(!TbActive) ActivateBThickness(); 3823 if(!RhoActive) InitDensity(); 3824 return GetBThickness(b)/rho0/tA; 3825 } 3611 3826 3612 3827 // Add Cluster 3613 3828 G4QNucleus G4QNucleus::operator+=(const G4QNucleus& rhs) 3614 //==================================================== 3829 //====================================================== 3615 3830 { 3616 3831 Z+=rhs.Z; … … 3621 3836 dS+=rhs.dS; 3622 3837 // Atributes of aHadron 3623 G4int newPDG= GetPDGCode() 3838 G4int newPDG= GetPDGCode() + rhs.GetPDGCode() - 90000000; 3624 3839 SetQPDG (newPDG); 3625 G4QContent newQC = GetQC() 3840 G4QContent newQC = GetQC() + rhs.GetQC(); 3626 3841 SetQC (newQC); 3627 G4LorentzVector newLV = Get4Momentum() + rhs.Get4Momentum(); 3628 Set4Momentum (newLV); 3842 theMomentum += rhs.Get4Momentum(); 3629 3843 return *this; 3630 3844 } … … 3645 3859 G4QContent newQC = GetQC() - rhs.GetQC(); 3646 3860 SetQC (newQC); 3647 G4LorentzVector newLV = Get4Momentum() - rhs.Get4Momentum(); 3648 Set4Momentum (newLV); 3861 theMomentum -= rhs.Get4Momentum(); 3649 3862 return *this; 3650 3863 } … … 3665 3878 G4QContent newQC = rhs*GetQC(); 3666 3879 SetQC (newQC); 3667 G4LorentzVector newLV = rhs*Get4Momentum(); 3668 Set4Momentum (newLV); 3880 theMomentum *= rhs; 3669 3881 return *this; 3670 3882 } … … 3751 3963 if(theBN<1 || thePDG<80000000 || thePDG==90000000) // Hadron, anti-nucleous, or vacuum 3752 3964 { 3753 #ifdef pdebug3965 #ifdef debug 3754 3966 G4cout<<"G4QNucleus::EvaporateNucleus: Nucleus="<<thePDG<<qH->Get4Momentum()<<G4endl; 3755 3967 #endif … … 3778 3990 if(thePDG>91000000) //@@MadeForGeant4@@: If there is a Lambda, substitute it by A neutron 3779 3991 { 3780 G4int SSS=(thePDG-90000000)/1000000; 3992 G4int SSS=(thePDG-90000000)/1000000; // A # of Lambdas 3781 3993 thePDG-=SSS*999999; // S Neutrons instead of S Lambdas 3782 3994 qH->SetQPDG(G4QPDGCode(thePDG)); 3995 theQC = qH->GetQC(); // Quark Content of the hadron 3996 #ifdef debug 3997 G4cout<<"=>Hyper Change=>G4QNucleus::EvaporateNuceus: NewNucPDG="<<thePDG<<G4endl; 3998 #endif 3783 3999 } 3784 4000 /// @@@ *** ^^^ END OF TEMPORARY ^^^ *** @@@ 3785 4001 if(thePDG<80000000) 3786 4002 { 3787 #ifdef pdebug4003 #ifdef debug 3788 4004 G4cout<<"G4QN::EvaporateNuc: FundamentalParticle="<<thePDG<<qH->Get4Momentum()<<G4endl; 3789 4005 #endif … … 3799 4015 G4double totGSM = G4QNucleus(thePDG).GetGSMass();// TheGroundStateMass of theTotalNucleus 3800 4016 G4double totMass = q4M.m(); // Get the Real(Excited?)Mass of theTotalNucleus 3801 #ifdef pdebug4017 #ifdef debug 3802 4018 G4cout<<"G4QNucleus::EvaporateNucleus(EVA):===IN==> PDG="<<thePDG<<",4Mom="<<q4M<<", B=" 3803 4019 <<theBN<<", Z="<<theC<<", N="<<theN<<", S="<<theS<<G4endl; … … 3811 4027 if(fabs(totMass-gsM)<.001) 3812 4028 { 3813 #ifdef pdebug4029 #ifdef debug 3814 4030 G4cout<<"G4QNu::EvaporateNucl:GSM="<<gsM<<", H="<<thePDG<<qH->Get4Momentum()<<G4endl; 3815 4031 #endif … … 3836 4052 { 3837 4053 G4double d=totMass-gsM; 3838 #ifdef pdebug4054 #ifdef debug 3839 4055 G4cout<<"G4QN::EvaporNucl: PDG="<<thePDG<<",M="<<totMass<<">"<<gsM<<",d="<<d<<G4endl; 3840 4056 #endif … … 3878 4094 throw G4QException("G4QNucleus::EvaporateNucleus:BaryonDecay In Baryon+Gam Error"); 3879 4095 } 3880 #ifdef pdebug4096 #ifdef debug 3881 4097 G4cout<<"G4QNucl::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+g="<<g4Mom<<",n=" 3882 4098 <<evaHV->size()<<G4endl; 3883 4099 #endif 3884 4100 G4QHadron* curH = new G4QHadron(thePDG,h4Mom); 3885 #ifdef pdebug4101 #ifdef debug 3886 4102 G4cout<<"G4QNucleus::EvaporateNucleus: Hadr="<<thePDG<<h4Mom<<G4endl; 3887 4103 #endif 3888 4104 evaHV->push_back(curH); // Fill Baryon (delete equiv.) 3889 4105 G4QHadron* curG = new G4QHadron(decPDG,g4Mom); 3890 #ifdef pdebug4106 #ifdef debug 3891 4107 G4cout<<"G4QNucleus::EvaporateNucleus: Gamma(pion)4M="<<g4Mom<<G4endl; 3892 4108 #endif … … 3916 4132 if(fabs(totMass-gsM-mPi)<.001) 3917 4133 { 3918 #ifdef pdebug4134 #ifdef debug 3919 4135 G4cout<<"G4QN::EvaporateNuc:(D)GSM="<<gsM<<",H="<<thePDG<<qH->Get4Momentum()<<G4endl; 3920 4136 #endif … … 3965 4181 throw G4QException("G4QNucleus::EvaporateNucleus: DeltaDecInBaryon+Pi Error"); 3966 4182 } 3967 #ifdef pdebug4183 #ifdef debug 3968 4184 G4cout<<"G4QNuc::EvaNuc:"<<totMass<<q4M<<"->"<<thePDG<<h4Mom<<"+pi="<<g4Mom<<", nH=" 3969 4185 <<evaHV->size()<<G4endl; 3970 4186 #endif 3971 4187 G4QHadron* curH = new G4QHadron(barPDG,h4Mom); 3972 #ifdef pdebug4188 #ifdef debug 3973 4189 G4cout<<"G4QNucleus::EvaporateNucl: Nucleon="<<thePDG<<h4Mom<<G4endl; 3974 4190 #endif 3975 4191 evaHV->push_back(curH); // Fill the nucleon (delete equiv.) 3976 4192 G4QHadron* curG = new G4QHadron(mesPDG,g4Mom); 3977 #ifdef pdebug4193 #ifdef debug 3978 4194 G4cout<<"G4QE::EvaporateR: Pion="<<g4Mom<<G4endl; 3979 4195 #endif … … 4050 4266 #endif 4051 4267 G4QHadron* h1H = new G4QHadron(nucPDG,n14M); 4052 #ifdef pdebug4268 #ifdef debug 4053 4269 G4cout<<"G4QNucleus::EvaporateNucleus: Bar1="<<nucPDG<<n14M<<G4endl; 4054 4270 #endif 4055 4271 evaHV->push_back(h1H); // (delete equivalent) 4056 4272 G4QHadron* h2H = new G4QHadron(nucPDG,n24M); 4057 #ifdef pdebug4273 #ifdef debug 4058 4274 G4cout<<"G4QNucleus::EvaporateNucleus: Bar2="<<nucPDG<<n24M<<G4endl; 4059 4275 #endif 4060 4276 evaHV->push_back(h2H); // (delete equivalent) 4061 4277 G4QHadron* piH = new G4QHadron(piPDG,pi4M); 4062 #ifdef pdebug4278 #ifdef debug 4063 4279 G4cout<<"G4QNucleus::EvaporateNucleus: Pi="<<piPDG<<pi4M<<G4endl; 4064 4280 #endif … … 4125 4341 #endif 4126 4342 G4QHadron* h1H = new G4QHadron(n1PDG,n14M); 4127 #ifdef pdebug4343 #ifdef debug 4128 4344 G4cout<<"G4QNucleus::EvaporateNucleus: Bar1="<<n1PDG<<n14M<<G4endl; 4129 4345 #endif 4130 4346 evaHV->push_back(h1H); // (delete equivalent) 4131 4347 G4QHadron* h2H = new G4QHadron(n2PDG,n24M); 4132 #ifdef pdebug4348 #ifdef debug 4133 4349 G4cout<<"G4QNucleus::EvaporateNucleus: Bar2="<<n2PDG<<n24M<<G4endl; 4134 4350 #endif 4135 4351 evaHV->push_back(h2H); // (delete equivalent) 4136 4352 G4QHadron* piH = new G4QHadron(piPDG,pi4M); 4137 #ifdef pdebug4353 #ifdef debug 4138 4354 G4cout<<"G4QNucleus::EvaporateNucleus: Pi="<<piPDG<<pi4M<<G4endl; 4139 4355 #endif … … 4157 4373 else if(fabs(totMass-totGSM)<.001) // Fill as it is or decay Be8, He5, Li5 (@@ add more) 4158 4374 { 4159 #ifdef pdebug4375 #ifdef debug 4160 4376 G4cout<<"G4QNucleus::EvaNuc:GS "<<qH->GetQC()<<qH->Get4Momentum()<<" FillAsIs"<<G4endl; 4161 4377 #endif … … 4248 4464 #endif 4249 4465 G4QHadron* k1H = new G4QHadron(k1PDG,k14M); 4250 #ifdef pdebug4466 #ifdef debug 4251 4467 G4cout<<"G4QNucleus::EvaporateNucleus: k1="<<k1PDG<<k14M<<G4endl; 4252 4468 #endif 4253 4469 evaHV->push_back(k1H); // (delete equivalent) 4254 4470 G4QHadron* k2H = new G4QHadron(k2PDG,k24M); 4255 #ifdef pdebug4471 #ifdef debug 4256 4472 G4cout<<"G4QNucleus::EvaporateNucleus: k2="<<k2PDG<<k24M<<G4endl; 4257 4473 #endif 4258 4474 evaHV->push_back(k2H); // (delete equivalent) 4259 4475 G4QHadron* nH = new G4QHadron(nucPDG,n4M); 4260 #ifdef pdebug4476 #ifdef debug 4261 4477 G4cout<<"G4QNucleus::EvaporateNucleus: Nuc="<<nucPDG<<n4M<<G4endl; 4262 4478 #endif … … 4280 4496 G4int bN =qNuc.GetN(); // A#of neutrons in theTotal ResidualNucleus 4281 4497 G4int bS =qNuc.GetS(); // A#of lambdas in theTotal Residual Nucleus 4282 #ifdef pdebug4498 #ifdef debug 4283 4499 if(bZ==2&&bN==5)G4cout<<"G4QNucleus::EvaNucl: (2,5) GSM="<<GSMass<<" > " 4284 4500 <<G4QPDGCode(2112).GetNuclMass(2,4,0)+mNeut<<G4endl; … … 4291 4507 G4int bsCond =qNuc.SplitBaryon(); // (Bary/Deut/Alph)SeparCond for TotResNucl 4292 4508 G4bool dbsCond=qNuc.Split2Baryons(); // (Two Baryons)SeparCond for TotResidNucl 4293 #ifdef pdebug4509 #ifdef debug 4294 4510 G4cout<<"G4QNucleus::EvaporateNuc: bs="<<bsCond<<", dbs="<<dbsCond<<", A="<<bA<<G4endl; 4295 4511 #endif 4296 4512 if(fabs(totMass-GSMass)<.003&&!bsCond&&!dbsCond) // GS or can't split 1(2)B FillAsItIs 4297 4513 { 4298 #ifdef pdebug4514 #ifdef debug 4299 4515 G4cout<<"G4QN::EvaNuc: GS direct "<<qH->GetQC()<<qH->Get4Momentum()<<" AsIs"<<G4endl; 4300 4516 #endif … … 4308 4524 //else if(2>3) // Close "Fuse&Decay Technology"***@@@*** 4309 4525 { 4310 #ifdef pdebug4526 #ifdef debug 4311 4527 G4cout<<"G4QN::EvaN:SplitBar, s="<<bsCond<<",M="<<totMass<<" > GSM="<<GSMass<<G4endl; 4312 4528 #endif … … 4319 4535 G4int nFrag = theLast->GetNFragments(); 4320 4536 //////////////////G4int gam = theLast->GetPDGCode(); 4321 #ifdef pdebug4537 #ifdef debug 4322 4538 G4cout<<"G4QN::EvaNuc:*BackFus*,BN="<<lastBN<<",nF="<<nFrag<<",n="<<nOfOUT<<G4endl; 4323 4539 #endif … … 4327 4543 nFrag = thePrev->GetNFragments(); 4328 4544 G4int prevBN = thePrev->GetBaryonNumber(); 4329 #ifdef pdebug4545 #ifdef debug 4330 4546 G4int prevPDG = thePrev->GetPDGCode(); 4331 4547 G4cout<<"G4QNucl::EvaNucl: DelTheLast, nFr="<<nFrag<<", pPDG="<<prevPDG<<G4endl; … … 4358 4574 G4int totBN=totQC.GetBaryonNumber();// BaryonNumber of the Total Residual Nucleus 4359 4575 G4double dM=totMass-GSMass-lastM; 4360 #ifdef pdebug4576 #ifdef debug 4361 4577 G4cout<<"G4QN::EvaNuc: tM="<<totMass<<"-LM="<<lastM<<lastQC<<"-GSM="<<GSMass<<"=" 4362 4578 <<dM<<G4endl; … … 4377 4593 qH=0; // @Not necessary@ 4378 4594 #endif 4379 #ifdef pdebug4595 #ifdef debug 4380 4596 G4cout<<"G4QNucleus::EvaporateNucl: EVH "<<totPDG<<q4M<<" fill AsIs"<<G4endl; 4381 4597 #endif … … 4398 4614 qH=0; // @Not necessary@ 4399 4615 #endif 4400 #ifdef pdebug4616 #ifdef debug 4401 4617 G4cout<<"***G4QNucleus::EvaNucl: EVH "<<totPDG<<q4M<<" fill AsIs"<<G4endl; 4402 4618 #endif 4403 4619 evaHV->push_back(evH);// Fill TRN to Vect as it is (delete equivalent) 4404 #ifdef pdebug4620 #ifdef debug 4405 4621 G4cout<<"***G4QN::EvaN:DecayIn L"<<lastQC<<"+RN"<<totQC<<" failed"<<G4endl; 4406 4622 #endif … … 4419 4635 theLast->Set4Momentum(last4M);// Already exists:don't create&fill,->set4Mom 4420 4636 G4QHadron* nucH = new G4QHadron(thePDG,r4Mom); // Create QHadron for qH-nuc 4421 #ifdef pdebug4637 #ifdef debug 4422 4638 G4cout<<"G4QNucleus::EvaNuc:fill NH "<<totPDG<<r4Mom<<G4endl; 4423 4639 #endif … … 4455 4671 throw G4QException("G4QNucleus::EvaporateNucleus: Decay in Gamma failed"); 4456 4672 } 4457 #ifdef pdebug4673 #ifdef debug 4458 4674 G4cout<<"G4QNuc::EvaNuc: "<<q4M<<"->totResN="<<thePDG<<h4Mom<<"+g="<<g4Mom<<G4endl; 4459 4675 #endif 4460 4676 G4QHadron* curH = new G4QHadron(thePDG,h4Mom); 4461 #ifdef pdebug4677 #ifdef debug 4462 4678 G4cout<<"G4QNucleus::EvaporateNucleus: Fill a Fragment="<<thePDG<<h4Mom<<G4endl; 4463 4679 #endif … … 4465 4681 else evaHV->push_back(curH); // Fill the TotalResidualNucleus (del.equiv.) 4466 4682 G4QHadron* curG = new G4QHadron(22,g4Mom); 4467 #ifdef pdebug4683 #ifdef debug 4468 4684 G4cout<<"G4QNucleus::EvaporateNucleus: Fill a Gamma="<<g4Mom<<G4endl; 4469 4685 #endif … … 4495 4711 else if(totMass<GSMass+.003&&(bsCond||dbsCond))//==>" M<GSM but decay is possible" case 4496 4712 { 4497 #ifdef pdebug4713 #ifdef debug 4498 4714 G4cout<<"G4QN::EvN:2B="<<dbsCond<<",B="<<bsCond<<",M="<<totMass<<"<"<<GSMass<<G4endl; 4499 4715 #endif … … 4637 4853 else llResM =resN.GetMZNS(); // min mass of the Residual Nucleus 4638 4854 } 4639 #ifdef pdebug4855 #ifdef debug 4640 4856 G4cout<<"G4QNucleus::EvaNucl: rP="<<pResPDG<<",rN="<<nResPDG<<",rL="<<lResPDG<<",N=" 4641 4857 <<bN<<",Z="<<bZ<<",nL="<<bS<<",totM="<<totMass<<",n="<<totMass-nResM-mNeut … … 4806 5022 #endif 4807 5023 G4QHadron* HadrB = new G4QHadron(barPDG,a4Mom); 4808 #ifdef pdebug5024 #ifdef debug 4809 5025 G4cout<<"G4QNucleus::EvaNucleus:(1) Baryon="<<barPDG<<a4Mom<<G4endl; 4810 5026 #endif 4811 5027 evaHV->push_back(HadrB); // Fill the baryon (delete equivalent) 4812 5028 G4QHadron* HadrR = new G4QHadron(resPDG,b4Mom); 4813 #ifdef pdebug5029 #ifdef debug 4814 5030 G4cout<<"G4QNucleus::EvaNucleus:(1) Residual="<<resPDG<<b4Mom<<G4endl; 4815 5031 #endif … … 4846 5062 #endif 4847 5063 G4QHadron* HadrB = new G4QHadron(barPDG,a4Mom); 4848 #ifdef pdebug5064 #ifdef debug 4849 5065 G4cout<<"G4QNucleus::EvaporateNucleus:(2) Baryon1="<<barPDG<<a4Mom<<G4endl; 4850 5066 #endif 4851 5067 evaHV->push_back(HadrB); // Fill the first baryon (del.equiv.) 4852 5068 G4QHadron* HadrC = new G4QHadron(thdPDG,c4Mom); 4853 #ifdef pdebug5069 #ifdef debug 4854 5070 G4cout<<"G4QNucleus::EvaporateNucleus:(2) Baryon2="<<thdPDG<<c4Mom<<G4endl; 4855 5071 #endif 4856 5072 evaHV->push_back(HadrC); // Fill the second baryon (del.equiv.) 4857 5073 G4QHadron* HadrR = new G4QHadron(resPDG,b4Mom); 4858 #ifdef pdebug5074 #ifdef debug 4859 5075 G4cout<<"G4QNucleus::EvaporateNucleus:(2) Residual="<<resPDG<<b4Mom<<G4endl; 4860 5076 #endif … … 4867 5083 else if (fabs(totMass-GSMass)<.003) // @@ Looks like a duplication of the prev. check 4868 5084 { 4869 #ifdef pdebug5085 #ifdef debug 4870 5086 G4cout<<"*|*|*|*G4QNucleus::EvaporateNuc: fill AsIs. Should never be here"<<G4endl; 4871 5087 #endif … … 4878 5094 else // "System is below mass shell and can't decay" case 4879 5095 { 4880 #ifdef pdebug5096 #ifdef debug 4881 5097 G4cout<<"***G4QNucl::EvaNuc: tM="<<totMass<<"("<<thePDG<<") < GSM="<<GSMass<<", d=" 4882 5098 <<totMass-GSMass<<", QC="<<qH->GetQC()<<qH->Get4Momentum()<<"*AsIs*"<<G4endl; … … 4891 5107 else // ===> Evaporation of excited system 4892 5108 { 4893 #ifdef pdebug5109 #ifdef debug 4894 5110 G4cout<<"G4QN::EvaNuc:***EVA***tPDG="<<thePDG<<",M="<<totMass<<">GSM="<<GSMass<<",d=" 4895 5111 <<totMass-GSMass<<", N="<<qNuc.Get4Momentum()<<qNuc.Get4Momentum().m()<<G4endl; … … 4916 5132 if(!qNuc.EvaporateBaryon(bHadron,rHadron)) // Evaporation did not succeed 4917 5133 { 4918 #ifdef pdebug5134 #ifdef debug 4919 5135 G4cout<<"***G4QNuc::EvaNuc:***EVA Failed***PDG="<<thePDG<<",M="<<totMass<<G4endl; 4920 5136 #endif 4921 5137 delete bHadron; 4922 5138 delete rHadron; 4923 #ifdef pdebug5139 #ifdef debug 4924 5140 G4cout<<"***G4QNucl::EvaNuc: Residual="<<qH->GetQC()<<qH->Get4Momentum()<<G4endl; 4925 5141 #endif … … 4949 5165 //if(b4M.e()-b4M.m()<bCB&&evcn<evcm) evC=true; 4950 5166 } // End of while 4951 #ifdef pdebug5167 #ifdef debug 4952 5168 G4cout<<"G4QNucl::EvaNuc:*** EVA IS DONE *** F="<<bPDG<<b4M<<",bB="<<bB<<", ResNuc=" 4953 5169 <<rPDG<<r4M<<",rB="<<rB<<G4endl; … … 4977 5193 { 4978 5194 G4double rGSM = rHadron->GetQPDG().GetMass(); // Ground State mass of the dibaryon 4979 #ifdef pdebug5195 #ifdef debug 4980 5196 G4cout<<"G4QNuc::EvaNuc:ResidDibM="<<rM<<",GSM="<<rGSM<<",M-GSM="<<rM-rGSM<<G4endl; 4981 5197 #endif … … 4994 5210 else evaHV->push_back(rHadron); // Fill ResidNucl=Baryon to OutputHadronVector 4995 5211 } // End of Evaporation of excited system 4996 #ifdef pdebug5212 #ifdef debug 4997 5213 G4cout<<"G4QNucleus::EvaporateNucleus: === End of the evaporation attempt"<<G4endl; 4998 5214 #endif … … 5000 5216 else // => "Decay if impossible evaporate" case 5001 5217 { 5002 #ifdef pdebug5218 #ifdef debug 5003 5219 G4cout<<"*G4QNucleus::EvaporateNucleus: InputHadron4M="<<q4M<<", PDG="<<thePDG<<G4endl; 5004 5220 #endif … … 5031 5247 } 5032 5248 G4QHadron* H2 = new G4QHadron(h2.GetPDGCode(),qe4M); 5033 #ifdef pdebug5249 #ifdef debug 5034 5250 G4cout<<"G4QNucleus::EvaporateNucleus:(2) h2="<<h2.GetPDGCode()<<qe4M<<G4endl; 5035 5251 #endif 5036 5252 evaHV->push_back(H2); // (delete equivalent) 5037 5253 G4QHadron* H1 = new G4QHadron(h1.GetPDGCode(),fq4M); 5038 #ifdef pdebug5254 #ifdef debug 5039 5255 G4cout<<"G4QNucleus::EvaporateNucleus:(2) h1="<<h1.GetPDGCode()<<fq4M<<G4endl; 5040 5256 #endif … … 5060 5276 if(fabs(totMass-totM)<0.001||abs(thePDG)-10*(abs(thePDG)/10)>2) 5061 5277 { 5062 #ifdef pdebug5278 #ifdef debug 5063 5279 G4cout<<"**G4QNuc::EvaNuc:EmerFill(2) "<<qH->GetQC()<<qH->Get4Momentum()<<G4endl; 5064 5280 #endif … … 5086 5302 } 5087 5303 G4QHadron* H1 = new G4QHadron(211,fq4M); 5088 #ifdef pdebug5304 #ifdef debug 5089 5305 G4cout<<"G4QNucleus::EvaporateNucleus:(3) PiPlus="<<fq4M<<G4endl; 5090 5306 #endif 5091 5307 evaHV->push_back(H1); // (delete equivalent) 5092 5308 G4QHadron* H2 = new G4QHadron(-211,qe4M); 5093 #ifdef pdebug5309 #ifdef debug 5094 5310 G4cout<<"G4QNucleus::EvaporateNucleus:(3) PiMinus="<<qe4M<<G4endl; 5095 5311 #endif … … 5114 5330 } 5115 5331 G4QHadron* H1 = new G4QHadron(111,fq4M); 5116 #ifdef pdebug5332 #ifdef debug 5117 5333 G4cout<<"G4QNucleus::EvaporateNucleus:(4) Pi01="<<fq4M<<G4endl; 5118 5334 #endif 5119 5335 evaHV->push_back(H1); // (delete equivalent) 5120 5336 G4QHadron* H2 = new G4QHadron(111,qe4M); 5121 #ifdef pdebug5337 #ifdef debug 5122 5338 G4cout<<"G4QNucleus::EvaporateNucleus:(4) Pi02="<<qe4M<<G4endl; 5123 5339 #endif … … 5142 5358 } 5143 5359 G4QHadron* H2 = new G4QHadron(thePDG,qe4M); 5144 #ifdef pdebug5360 #ifdef debug 5145 5361 G4cout<<"G4QNucleus::EvaporateNucleus:(5) tot="<<thePDG<<qe4M<<G4endl; 5146 5362 #endif 5147 5363 evaHV->push_back(H2); // (delete equivalent) 5148 5364 G4QHadron* H1 = new G4QHadron(22,fq4M); 5149 #ifdef pdebug5365 #ifdef debug 5150 5366 G4cout<<"G4QNucleus::EvaporateNucleus:(5) GamFortot="<<fq4M<<G4endl; 5151 5367 #endif … … 5170 5386 } 5171 5387 G4QHadron* H2 = new G4QHadron(22,qe4M); 5172 #ifdef pdebug5388 #ifdef debug 5173 5389 G4cout<<"G4QNucleus::EvaporateNucleus:(6) gam1="<<qe4M<<G4endl; 5174 5390 #endif 5175 5391 evaHV->push_back(H2); // (delete equivalent) 5176 5392 G4QHadron* H1 = new G4QHadron(22,fq4M); 5177 #ifdef pdebug5393 #ifdef debug 5178 5394 G4cout<<"G4QNucleus::EvaporateNucleus:(6) gam2="<<fq4M<<G4endl; 5179 5395 #endif … … 5219 5435 } 5220 5436 #endif 5221 #ifdef pdebug5437 #ifdef debug 5222 5438 G4cout<<"G4QNucleus::EvaporateNucleus: ===>>>> End. "<<G4endl; 5223 5439 #endif … … 5242 5458 G4int qC=qQC.GetCharge(); // Charge of the IsoNucleus 5243 5459 G4int qS=qQC.GetStrangeness(); // Strangness of the IsoNucleus 5244 #ifdef pdebug5460 #ifdef debug 5245 5461 G4cout<<"G4QNuc:DecayIson:QC="<<qQC<<",M="<<qM<<",B="<<qBN<<",S="<<qS<<",C="<<qC<<G4endl; 5246 5462 #endif … … 5531 5747 else if(!qS && (qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom))) 5532 5748 { 5533 #ifdef pdebug5749 #ifdef debug 5534 5750 G4cout<<"***G4QNuc::DecIsonuc:fPDG="<<fPDG<<"*"<<qBN<<"(fM="<<fMass<<")+sPDG="<<sPDG 5535 5751 <<"*"<<qPN<<"(sM="<<sMass<<")"<<"="<<sum<<" > TotM="<<qM<<q4M<<qQC<<qS<<G4endl; … … 5543 5759 else if(qS && (qM<sum || !G4QHadron(q4M).DecayIn3(f4Mom, s4Mom, t4Mom))) 5544 5760 { 5545 #ifdef pdebug5761 #ifdef debug 5546 5762 G4cout<<"***G4QNuc::DecIsonuc: "<<fPDG<<"*"<<qBN<<"("<<fMass<<")+"<<sPDG<<"*"<<qPN<<"(" 5547 5763 <<sMass<<")+Lamb*"<<qS<<"="<<sum<<" > TotM="<<qM<<q4M<<qQC<<G4endl; … … 5553 5769 return; 5554 5770 } 5555 #ifdef pdebug5771 #ifdef debug 5556 5772 G4cout<<"G4QNuc::DecayIsonucleus: *DONE* n="<<qPN<<f4Mom<<fPDG<<", m="<<qPN<<s4Mom<<sPDG 5557 5773 <<", l="<<qS<<t4Mom<<G4endl; … … 5634 5850 G4double qM = q4M.m(); 5635 5851 G4double rM = qM+eps; // Just to avoid the computer accuracy 5636 #ifdef pdebug5852 #ifdef debug 5637 5853 G4cout<<"G4QNucl::DecayDibaryon: *Called* PDG="<<qPDG<<",4Mom="<<q4M<<", M="<<qM<<G4endl; 5638 5854 #endif … … 5800 6016 return; 5801 6017 } 5802 #ifdef pdebug6018 #ifdef debug 5803 6019 G4cout<<"G4QNucleus::DecayDibaryon:(2) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG 5804 6020 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl; … … 5835 6051 return; 5836 6052 } 5837 #ifdef pdebug6053 #ifdef debug 5838 6054 G4cout<<"G4QNucleus::DecayDibaryon:(3) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG 5839 6055 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl; … … 5860 6076 throw G4QException("G4QNucleus::DecayDibaryon: General DecayIn2 error"); 5861 6077 } 5862 #ifdef pdebug6078 #ifdef debug 5863 6079 G4cout<<"G4QNucl::DecayDibaryon:(4) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG 5864 6080 <<", s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl; … … 5894 6110 return; 5895 6111 } 5896 #ifdef pdebug6112 #ifdef debug 5897 6113 G4cout<<"G4QNuc::DecayDibaryon:(5) *DONE* f4M="<<f4Mom<<",fPDG="<<fPDG<<", s4M="<<s4Mom 5898 6114 <<",sPDG="<<sPDG<<", t4M="<<t4Mom<<",tPDG="<<tPDG<<G4endl; … … 5935 6151 G4int qB = qH->GetBaryonNumber(); // BaryonNumber of the AntiStrangeNuclearSt. 5936 6152 G4int qP = qH->GetCharge(); // Charge of the AntiStranNuclState (a#of p) 5937 #ifdef pdebug6153 #ifdef debug 5938 6154 G4cout<<"G4QNuc::DecAntS:QC="<<qQC<<",S="<<qS<<",B="<<qB<<",C="<<qP<<",4M="<<q4M<<G4endl; 5939 6155 #endif … … 6037 6253 G4int qPDG=90000000+(qP-n2)*1000+(qN-n1); // PDG of the Residual Nucleus 6038 6254 G4double nucM = G4QNucleus(qPDG).GetGSMass(); // Mass of the Residual Nucleus 6039 #ifdef pdebug6255 #ifdef debug 6040 6256 G4cout<<"G4QNucleus::DecayAnStran:nK0="<<n1<<",nK+="<<n2<<", nucM="<<nucM<<G4endl; 6041 6257 #endif … … 6053 6269 n2=m2; 6054 6270 } 6055 #ifdef pdebug6271 #ifdef debug 6056 6272 G4cout<<"G4QNucleus::DecayAnStran: n1="<<n1<<", n2="<<n2<<", nM="<<nucM<<G4endl; 6057 6273 #endif … … 6085 6301 else k1M=mK0; // Only anti-K0's (default k1PDG) 6086 6302 } 6087 #ifdef pdebug6303 #ifdef debug 6088 6304 G4int naPDG=90000000+(qP-1)*1000+qN; // Prot PDG of the Alternative Residual Nucleus 6089 6305 G4double naM=G4QNucleus(naPDG).GetGSMass(); // Prot Mass of the Alt. Residual Nucleus … … 6134 6350 else if(qM<sum || !G4QHadron(q4M).DecayIn2(f4Mom, s4Mom)) 6135 6351 { 6136 #ifdef pdebug6352 #ifdef debug 6137 6353 G4cout<<"--Warning--G4QNuc::DASt:AsItIs, H="<<qQC<<q4M<<qM<<" < sum="<<sum<<"=(F)" 6138 6354 <<nucM<<"+(kK)"<<n1M<<G4endl; … … 6141 6357 return; 6142 6358 } 6143 #ifdef pdebug6359 #ifdef debug 6144 6360 G4cout<<"G4QNuc::DecAntiS: nK+N "<<n1<<"*K="<<k1PDG<<f4Mom<<",N="<<qPDG<<s4Mom<<G4endl; 6145 6361 #endif … … 6183 6399 return; 6184 6400 } 6185 #ifdef pdebug6401 #ifdef debug 6186 6402 G4cout<<"G4QNuc::DecAntiS:*DONE* nPDG="<<qPDG<<",1="<<f4Mom<<",2="<<s4Mom<<",n="<<t4Mom 6187 6403 <<G4endl; … … 6232 6448 G4int qPDG = qH->GetPDGCode(); // PDG Code of the decaying multybar 6233 6449 G4QContent qQC = qH->GetQC(); // PDG Code of the decaying multibar 6234 #ifdef pdebug6450 #ifdef debug 6235 6451 G4cout<<"G4QNuc::DecayMultyBaryon: *Called* PDG="<<qPDG<<",4M="<<q4M<<qQC<<G4endl; 6236 6452 #endif … … 6260 6476 throw G4QException("***G4QNuc::DecayMultyBaryon: Can not decay this PDG Code"); 6261 6477 } 6262 #ifdef pdebug6478 #ifdef debug 6263 6479 else 6264 6480 { … … 6291 6507 return; 6292 6508 } 6293 #ifdef pdebug6509 #ifdef debug 6294 6510 G4cout<<"G4QNucleus::DecMulBar:*DONE* fPDG="<<fPDG<<",f="<<f4Mom<<",s="<<s4Mom<<G4endl; 6295 6511 #endif … … 6324 6540 return; 6325 6541 } 6326 #ifdef pdebug6542 #ifdef debug 6327 6543 G4cout<<"G4QNuc::DecMBar:*DONE*, fPDG="<<fPDG<<",f="<<f4Mom<<",s="<<s4Mom<<",t=" 6328 6544 <<t4Mom<<G4endl; … … 6344 6560 // !! OK !! Checked by the warning print that they are mostly in the Ground State !! 6345 6561 G4LorentzVector f4Mom=q4M/totBN; // @@ Too simple solution (split in two parts!) 6346 #ifdef pdebug6562 #ifdef debug 6347 6563 // Warning for the future development 6348 6564 G4cout<<"*G4QNul::DecMulBar:SplitMultiBar inEqParts M="<<totBN<<"*"<<f4Mom.m()<<G4endl; … … 6380 6596 G4double qM = q4M.m(); // Real mass of the AlphaDibaryon 6381 6597 G4int qPDG = qH->GetPDGCode(); // PDG Code of the decayin AlphaDybaryon 6382 #ifdef pdebug6598 #ifdef debug 6383 6599 G4cout<<"G4QNuc::DecayAlphaDiN: *Called* PDG="<<qPDG<<",4M="<<q4M<<G4endl; 6384 6600 #endif … … 6437 6653 return; 6438 6654 } 6439 #ifdef pdebug6655 #ifdef debug 6440 6656 G4cout<<"G4QNuc::DecAl2N: fPDG="<<fPDG<<",f="<<f4Mom<<",s="<<s4Mom<<",t="<<t4Mom<<G4endl; 6441 6657 #endif … … 6466 6682 G4int qPDG = qH->GetPDGCode(); // PDG Code of the decayin Alpha-Baryon 6467 6683 G4QContent qQC = qH->GetQC(); // PDG Code of the decaying Alpha-Bar 6468 #ifdef pdebug6684 #ifdef debug 6469 6685 G4cout<<"G4QNucleus::DecayAlphaBar: *Called* PDG="<<qPDG<<",4M="<<q4M<<qQC<<G4endl; 6470 6686 #endif … … 6524 6740 return; 6525 6741 } 6526 #ifdef pdebug6742 #ifdef debug 6527 6743 G4cout<<"G4QNucleus::DecAlB:*DONE*, fPDG="<<fPDG<<f4Mom<<",sPDG="<<sPDG<<s4Mom<<G4endl; 6528 6744 #endif … … 6576 6792 return; 6577 6793 } 6578 #ifdef pdebug6794 #ifdef debug 6579 6795 G4cout<<"G4QNucl::DecAlB: *DONE*, f="<<fPDG<<f4Mom<<", s="<<sPDG<<s4Mom<<t4Mom<<G4endl; 6580 6796 #endif … … 6635 6851 return; 6636 6852 } 6637 #ifdef pdebug6853 #ifdef debug 6638 6854 G4cout<<"G4QNuc::DecAlphaB: *DONE*, fPDG="<<fPDG<<f4Mom<<",sPDG="<<sPDG<<s4Mom<<G4endl; 6639 6855 #endif … … 6679 6895 if(dM>0.&&dM<1.) 6680 6896 { 6681 #ifdef pdebug6897 #ifdef debug 6682 6898 G4cout<<"***Corrected***G4QNuc::DecayAlphaBar:fPDG="<<fPDG<<"(fM="<<fMass<<")+ sPDG=" 6683 6899 <<sPDG<<"(sM="<<sMass<<")="<<fMass+sMass<<" > TotM="<<qM<<q4M<<G4endl; … … 6707 6923 return; 6708 6924 } 6709 #ifdef pdebug6925 #ifdef debug 6710 6926 G4cout<<"G4QNucl::DecAlBar:*DONE*a4M="<<f4Mom<<",s4M="<<s4Mom<<",sPDG="<<sPDG<<G4endl; 6711 6927 #endif … … 6748 6964 G4LorentzVector q4M = qH->Get4Momentum(); // Get 4-momentum of the Dibaryon 6749 6965 G4double qM=q4M.m(); 6750 #ifdef pdebug6966 #ifdef debug 6751 6967 G4cout<<"G4QNucleus::DecayAlAl: *Called* PDG="<<qPDG<<",M="<<qM<<q4M<<">"<<aaGSM<<G4endl; 6752 6968 #endif … … 6775 6991 return; 6776 6992 } 6777 #ifdef pdebug6993 #ifdef debug 6778 6994 G4cout<<"G4QNucleus::DecayAlphaAlpha: *DONE* gam4M="<<f4Mom<<", aa4M="<<s4Mom<<G4endl; 6779 6995 #endif … … 6803 7019 return; 6804 7020 } 6805 #ifdef pdebug7021 #ifdef debug 6806 7022 G4cout<<"G4QNucleus::DecayAlphaAlpha: *DONE* fal4M="<<f4Mom<<", sal4M="<<s4Mom<<G4endl; 6807 7023 #endif -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPDGCode.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QPDGCode.cc,v 1. 57 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QPDGCode.cc,v 1.63 2009/11/03 16:13:37 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QPDGCode ---------------- … … 56 56 G4cout<<"G4QPDGCode:Constructer is called with PDGCode="<<PDGCode<<G4endl; 57 57 #endif 58 if(PDGCode==130) PDGCode= 311; // Safety. Should not happen. 59 if(PDGCode==310) PDGCode=-311; // Safety. Should not happen. 58 60 if(PDGCode) theQCode=MakeQCode(PDGCode); 59 61 else … … 242 244 91001999 , 90001002 , 90002001 , 91000002 , 91001001 , //110 243 245 91002000 , 92000001 , 92001000 , 90999003 , 90001003 , 244 90002002 , 90003001 , 91001002 , 91002001 , 92000002 , //120246 90002002 , 90003001 , 91001002 , 91002001 , 92000002 , //120 245 247 92001001 , 92002000}; 246 248 static G4int aC[15] = {1,1000,999001,1000000,1000999,1999000,1999999, // sum 1 … … 268 270 {// =========================== 269 271 static G4bool iniFlag=true; 270 static G4double m[nQHM]={.511, 0., 105.65837, 0., 1777., 0., 0., 91 .188, 80.425, 140.00271 ,120.000, 800., 980., 1370., 134.98, 139.57, 547. 75, 497.65, 493.68, 957.78272 ,939.5654,938.272, 1115.683, 1197.45, 1192.64, 1189.37, 1321.3, 1314.8, 775.8, 775.8273 , 782.6, 896.1, 891.66, 1019.456, 1232., 1232., 1232., 1232., 1519.5, 1387.2272 static G4double m[nQHM]={.511, 0., 105.65837, 0., 1777., 0., 0., 91188., 80403., 140.00 273 ,120.000, 800., 980., 1370., 134.98, 139.57, 547.51, 497.65, 493.68, 957.78 274 ,939.5654,938.272, 1115.683, 1197.45, 1192.64, 1189.37,1321.31,1314.83, 775.5, 775.5 275 , 782.65, 896.0, 891.66, 1019.46, 1232., 1232., 1232., 1232., 1519.5, 1387.2 274 276 , 1383.7, 1382.8, 1535., 1531.8, 1672.45, 1318.3, 1318.3, 1275.4, 1432.4, 1425.6 275 277 , 1525., 1680., 1680., 1820., 1915., 1915., 1915., 2025., 2025., 1691. … … 1926 1928 if(A==256 && Z==128) m=256000.; 1927 1929 else m=k+G4NucleiProperties::GetNuclearMass(A,Z); 1928 //if(G4NucleiPropertiesTable::IsInTable(Z,A))1929 // m=k+G4NucleiProperties::GetNuclearMass(A,Z);1930 //else if(A==256 && Z==128) m=256000.;1931 //else1932 // m=k+G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z)->GetPDGMass();1933 //m+=-sh[Z]-sh[N]+b1*D*D*pow(fA,b2)+b3*(1.-2./(1.+exp(b4*D)))+Z*Z*(b5*pow(fA,b9)+b6/fA);1934 1930 } 1935 1931 //@@//G4double maxM= k+Z*mP+N*mN+S*mL+eps; // @@ eps -- Wings of the Mass parabola … … 1968 1964 // G4ParticleTable::GetParticleTable()->FindIon(Zm,Am,0,Zm) creates new Ion! 1969 1965 mm=km+G4NucleiProperties::GetNuclearMass(Am,Zm); 1970 //G4double fA=Am;1971 //if(G4NucleiPropertiesTable::IsInTable(Zm,Am))1972 // mm=km+G4NucleiProperties::GetNuclearMass(Am,Zm);1973 //else1974 // mm=km+G4ParticleTable::GetParticleTable()->FindIon(Zm,Am,0,Zm)->GetPDGMass();1975 // //mm+=-sh[Zm]-sh[Nm]+b1*Dm*Dm*pow(fA,b2)+b3*(1.-2./(1.+exp(b4*Dm)))1976 // // +Zm*Zm*(b5*pow(fA,b9)+b6/Am);1977 1966 } 1978 1967 //@@//G4double mM= km+Zm*mP+Nm*mN+eps; … … 2024 2013 else if(ab<99) 2025 2014 { 2015 if (thePDGCode== 11) return G4QContent(1,0,0,0,1,0); 2016 else if(thePDGCode==-11) return G4QContent(0,1,0,1,0,0); 2017 else if(thePDGCode== 13) return G4QContent(1,0,0,0,1,0); 2018 else if(thePDGCode==-13) return G4QContent(0,1,0,1,0,0); 2019 else if(thePDGCode== 15) return G4QContent(1,0,0,0,1,0); 2020 else if(thePDGCode==-15) return G4QContent(0,1,0,1,0,0); 2026 2021 #ifdef debug 2027 2022 if (ab==22) G4cout<<"-W-G4QPDGC::GetQuarkCont: For the Photon? - Return 0"<<G4endl; … … 2344 2339 return; 2345 2340 } 2341 2342 // Only for irreducable DiQaDiQ! L1!=R1 && L1!=R2 && L2!=R1 && L2!=R2 2343 std::pair<G4int,G4int> G4QPDGCode::MakeTwoBaryons(G4int L1, G4int L2, G4int R1, G4int R2) 2344 {// ==================================================================================== 2345 G4int dl=0; 2346 G4int ul=0; 2347 //G4int sl=0; 2348 if (L1==1) ++dl; 2349 else if(L1==2) ++ul; 2350 //else if(L1==3) ++sl; 2351 if (L2==1) ++dl; 2352 else if(L2==2) ++ul; 2353 //else if(L2==3) ++sl; 2354 if (R1==1) ++dl; 2355 else if(R1==2) ++ul; 2356 //else if(R1==3) ++sl; 2357 if (R2==1) ++dl; 2358 else if(R2==2) ++ul; 2359 //else if(R2==3) ++sl; 2360 if (dl==2 && ul==2) return make_pair(1114,2212); // @@ can be (2112,2224) 2361 else if(dl==1 && ul==2) return make_pair(3112,2212); 2362 else if(dl==0 && ul==2) return make_pair(3212,3212); // @@ can be (3312,2212) 2363 else if(dl==2 && ul==1) return make_pair(3222,2112); 2364 else if(dl==1 && ul==1) return make_pair(3312,2112); // @@ can be (3322,2212) 2365 else if(dl==2 && ul==0) return make_pair(3112,3112); // @@ can be (3322,1122) 2366 //#ifdef debug 2367 else G4cout<<"-Warning-G4QPDGCode::MakeTwoBaryons: Irreduceble? L1="<<L1<<",L2="<<L2 2368 <<",R1="<<R1<<",R2="<<R2<<G4endl; 2369 //#endif 2370 return make_pair(2212,2112); // @@ Just theMinimum, makeException 2371 } -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QParentCluster.cc
r1055 r1196 26 26 // 27 27 // $Id: G4QParentCluster.cc,v 1.26 2009/02/23 09:49:24 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QParentCluster ---------------- -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QParticle.cc
r1055 r1196 26 26 // 27 27 // $Id: G4QParticle.cc,v 1.34 2009/02/23 09:49:24 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ---------------- G4QParticle ---------------- -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QParton.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QParton.cc,v 1. 4 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QParton.cc,v 1.9 2009/07/17 16:54:57 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------ … … 40 40 // are quarks and some times gluons. 41 41 // ------------------------------------------------------------------------ 42 43 //#define debug 44 42 45 #include "G4QParton.hh" 43 46 44 G4QParton::G4QParton(G4int PDGcode) 45 { 46 PDGencoding=PDGcode; 47 theX = 0; 48 theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding); 49 G4int aPDG=std::abs(PDGcode); 50 //___________quarks__ 2 possible codes for gluons _ Condition for di-quarks 51 if(!aPDG || (aPDG>3 && PDGcode!=9 && PDGcode!=21 && 52 (aPDG>3303||aPDG<1103||aPDG%100>3)) || theDefinition==0) 53 { 54 G4cerr<<"***G4QParton::Constructor: wrong quark/diquark PDG="<<PDGcode<<G4endl; 55 G4Exception("G4QParton::Constructor:","72",FatalException,"WrongPartonPDG"); 56 } 47 G4QParton::G4QParton() // By default creates only quarks (not di-quarks) 48 { 49 // CHIPS is working only with u, d, and s quarks (SU(3)xSU(3)) (no gluons! M.K.) 50 // Random Flavor/Colour/Spin definition for default constructor (with .3 s-suppresion) 51 PGGCode=(G4int)(2.3*G4UniformRand())+1; //@@ Additional parameter of s/u (M.K.) 52 theType=1; 53 #ifdef debug 54 G4cout<<"....G4QParton::DefConstructer: PDG = "<<PGGCode<<", Type="<<theType<<G4endl; 55 #endif 56 // random colour (1,2,3)=(R,G,B) for quarks and (-1,-2,-3)=(aR,aG,aB) for anti-quarks 57 theColour = (G4int)(3*G4UniformRand())+1; 58 if(theColour>3) theColour = 3; // Should never happend 59 theSpinZ = (G4int)(2*G4UniformRand()) - 0.5; 60 QCont = G4QContent(0,0,0,0,0,0); 61 // Default definition (initialization) 62 theX = 0.; 63 thePosition=G4ThreeVector(0.,0.,0.); 64 theMomentum=G4LorentzVector(0.,0.,0.,0.); 65 } 66 67 G4QParton::G4QParton(G4int PDG) 68 { 69 SetPDGCode(PDG); 70 // Default definition (initialization) 71 theX = 0.; 72 thePosition=G4ThreeVector(0.,0.,0.); 73 theMomentum=G4LorentzVector(0.,0.,0.,0.); 74 } 75 76 G4QParton::G4QParton(const G4QParton &right) 77 { 78 PGGCode = right.PGGCode; 79 QCont = right.QCont; 80 theType = right.theType; 81 theMomentum = right.theMomentum; 82 thePosition = right.thePosition; 83 theX = right.theX; 84 theColour = right.theColour; 85 theSpinZ = right.theSpinZ; 86 #ifdef debug 87 G4cout<<"G4QParton::RCopyConstructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz=" 88 <<theSpinZ<<G4endl; 89 #endif 90 } 91 92 G4QParton::G4QParton(const G4QParton* right) 93 { 94 PGGCode = right->PGGCode; 95 QCont = right->QCont; 96 theType = right->theType; 97 theMomentum = right->theMomentum; 98 thePosition = right->thePosition; 99 theX = right->theX; 100 theColour = right->theColour; 101 theSpinZ = right->theSpinZ; 102 #ifdef debug 103 G4cout<<"G4QParton::PCopyConstructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz=" 104 <<theSpinZ<<G4endl; 105 #endif 106 } 107 108 const G4QParton& G4QParton::operator=(const G4QParton &right) 109 { 110 if(this != &right) // Beware of self assignment 111 { 112 PGGCode = right.GetPDGCode(); 113 QCont = right.QCont; 114 theType = right.GetType(); 115 theMomentum = right.Get4Momentum(); 116 thePosition = right.GetPosition(); 117 theX = right.theX; 118 theColour = right.theColour; 119 theSpinZ = right.theSpinZ; 120 #ifdef debug 121 G4cout<<"G4QParton::=Constructer: PDG="<<PGGCode<<", Col="<<theColour<<", Sz=" 122 <<theSpinZ<<G4endl; 123 #endif 124 } 125 return *this; 126 } 127 128 G4QParton::~G4QParton() {} 129 130 // Redefine the parton nature without changing x, 4Mom, Pos etc. 131 void G4QParton::SetPDGCode(G4int PDG) 132 { 133 PGGCode=PDG; 134 G4int aPDG=std::abs(PDG); 135 if(aPDG < 3304 && aPDG > 1100 && aPDG%100 < 4) // di-quark 136 { 137 theType=2; 138 G4int cPDG=aPDG/100; 139 if(PDG>0) 140 { 141 if (cPDG==11) QCont=G4QContent(2,0,0,0,0,0); // dd 142 else if(cPDG==21) QCont=G4QContent(1,1,0,0,0,0); // ud 143 else if(cPDG==22) QCont=G4QContent(0,2,0,0,0,0); // uu 144 else if(cPDG==31) QCont=G4QContent(1,0,1,0,0,0); // sd 145 else if(cPDG==32) QCont=G4QContent(0,1,1,0,0,0); // su 146 else if(cPDG==33) QCont=G4QContent(0,0,2,0,0,0); // ss 147 else 148 { 149 G4cerr<<"***G4QParton::SetPDGCode: bad di-quark PDG="<<PDG<<G4endl; 150 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) DiQuark"); 151 } 152 } 153 else 154 { 155 if (cPDG==11) QCont=G4QContent(0,0,0,2,0,0); // anti-dd 156 else if(cPDG==21) QCont=G4QContent(0,0,0,1,1,0); // anti-ud 157 else if(cPDG==22) QCont=G4QContent(0,0,0,0,2,0); // anti-uu 158 else if(cPDG==31) QCont=G4QContent(0,0,0,1,0,1); // anti-sd 159 else if(cPDG==32) QCont=G4QContent(0,0,0,0,1,1); // anti-su 160 else if(cPDG==33) QCont=G4QContent(0,0,0,0,0,2); // anti-ss 161 else 162 { 163 G4cerr<<"***G4QParton::SetPDGCode: bad anti-di-quark PDG="<<PDG<<G4endl; 164 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) AntiDiQuark"); 165 } 166 } 167 } 168 else if(aPDG && aPDG<4) // quark 169 { 170 theType=1; 171 if(PDG>0) 172 { 173 if (PDG==1) QCont=G4QContent(1,0,0,0,0,0); // d 174 else if(PDG==2) QCont=G4QContent(0,1,0,0,0,0); // u 175 else if(PDG==3) QCont=G4QContent(0,0,1,0,0,0); // s 176 else 177 { 178 G4cerr<<"***G4QParton::SetPDGCode: bad quark PDG="<<PDG<<G4endl; 179 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) Quark"); 180 } 181 } 182 else 183 { 184 if (PDG==-1) QCont=G4QContent(0,0,0,1,0,0); // anti-d 185 else if(PDG==-2) QCont=G4QContent(0,0,0,0,1,0); // anti-u 186 else if(PDG==-3) QCont=G4QContent(0,0,0,0,0,1); // anti-s 187 else 188 { 189 G4cerr<<"***G4QParton::SetPDGCode: bad anti-quark PDG="<<PDG<<G4endl; 190 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"Not SU(3) Anti-Quark"); 191 } 192 } 193 } 194 else if(aPDG==9 || aPDG==21) // gluon 195 { 196 theType=0; 197 QCont=G4QContent(0,0,0,0,0,0); 198 } 199 else 200 { 201 G4cerr<<"***G4QParton::SetPDGCode: wrong gluon/quark/diquark PDG="<<PDG<<G4endl; 202 G4Exception("G4QParton::SetPDGCode:","72",FatalException,"WrongPartonPDG"); 203 } 204 #ifdef debug 205 G4cout<<"....G4QParton::SetPDGCode: PDG = "<<PDG<<", Type="<<theType<<G4endl; 206 #endif 57 207 // 58 208 // colour by random in (1,2,3)=(R,G,B) for quarks and 59 209 // in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks: 60 G4int RGB=(G4int)(3*G4UniformRand())+1; 61 G4String name=theDefinition->GetParticleType(); 62 if(name == "quarks") 63 { 64 if(PDGcode>0) theColour = RGB; 65 else theColour =-RGB; 210 G4int RGB=(G4int)(3*G4UniformRand())+1; 211 if(theType==1) 212 { 213 if(PDG>0) theColour = RGB; 214 else theColour =-RGB; 66 215 } 67 216 // colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and 68 217 // in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks: 69 else if( name == "diquarks")70 { 71 if(PDG code>0) theColour =-RGB;72 else 218 else if(theType==2) 219 { 220 if(PDG>0) theColour =-RGB; 221 else theColour = RGB; 73 222 } 74 223 // ColourByRandom (-11,-12,-13,-21,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons 75 else if(name == "gluons") theColour = -(RGB*10 + (G4int)(3*G4UniformRand())+1); 76 else 77 { 78 G4cerr<<"***G4QParton::Constructor: not quark/diquark/gluon = " 79 <<theDefinition->GetParticleType()<<G4endl; 80 G4Exception("G4QParton::Constructor:","72",FatalException,"WrongParton"); 81 } 82 // isospin-z from PDG-encoded isospin-z for 83 // quarks, anti-quarks, di-quarks, and anti-di-quarks: 84 if(name == "quarks" || name == "diquarks") theIsoSpinZ = theDefinition->GetPDGIsospin3(); 85 // isospin-z choosen at random from PDG-encoded isospin for gluons (should be zero): 86 else 87 { 88 G4int thisPDGiIsospin=theDefinition->GetPDGiIsospin(); 89 if (thisPDGiIsospin == 0) theIsoSpinZ = 0; 90 //@@ ? M.K. 91 else theIsoSpinZ=((G4int)((thisPDGiIsospin+1)*G4UniformRand())) - thisPDGiIsospin*0.5; 92 } 224 else theColour = -(RGB*10 + (G4int)(3*G4UniformRand())+1); 93 225 // 94 226 // spin-z choosen at random from PDG-encoded spin: 95 227 // 96 G4int thisPDGiSpin=theDefinition->GetPDGiSpin(); 97 if(thisPDGiSpin == 0) theSpinZ = 0; 98 else theSpinZ = (G4int)((thisPDGiSpin+1)*G4UniformRand())-thisPDGiSpin*0.5;; 99 } 100 101 G4QParton::G4QParton(const G4QParton &right) 102 { 103 PDGencoding = right.PDGencoding; 104 theMomentum = right.theMomentum; 105 thePosition = right.thePosition; 106 theX = right.theX; 107 theDefinition = right.theDefinition; 108 theColour = right.theColour; 109 theIsoSpinZ = right.theIsoSpinZ; 110 theSpinZ = right.theSpinZ; 111 } 112 113 G4QParton::G4QParton(const G4QParton* right) 114 { 115 PDGencoding = right->PDGencoding; 116 theMomentum = right->theMomentum; 117 thePosition = right->thePosition; 118 theX = right->theX; 119 theDefinition = right->theDefinition; 120 theColour = right->theColour; 121 theIsoSpinZ = right->theIsoSpinZ; 122 theSpinZ = right->theSpinZ; 123 } 124 125 const G4QParton& G4QParton::operator=(const G4QParton &right) 126 { 127 if(this != &right) // Beware of self assignment 128 { 129 PDGencoding=right.GetPDGCode(); 130 theMomentum=right.Get4Momentum(); 131 thePosition=right.GetPosition(); 132 theX = right.theX; 133 theDefinition = right.theDefinition; 134 theColour = right.theColour; 135 theIsoSpinZ = right.theIsoSpinZ; 136 theSpinZ = right.theSpinZ; 137 } 138 return *this; 139 } 140 141 G4QParton::~G4QParton() 142 { 143 //G4cout << "G4QParton::~G4QParton(): this = "<<this <<G4endl; 144 //G4cout << "break here"<<this <<G4endl; 145 } 146 228 G4double dPDGSpin=1.; // Quark 2S 229 if (theType==0) dPDGSpin=2.; // Gluon 2S 230 else if(theType==2) dPDGSpin=aPDG%10-1; // Di-quark 2S 231 theSpinZ = (G4int)((dPDGSpin+1)*G4UniformRand())-dPDGSpin/2; 232 } 233 234 // QGS x+/x- logic of the Energy and Pz calculation 147 235 void G4QParton::DefineMomentumInZ(G4double aLightConeMomentum, G4bool aDirection) 148 236 { 149 G4double Mass = GetMass();150 237 G4LorentzVector a4Momentum = Get4Momentum(); 151 238 aLightConeMomentum*=theX; 152 G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()) + sqr(Mass);239 G4double TransverseMass2 = sqr(a4Momentum.px()) + sqr(a4Momentum.py()); 153 240 a4Momentum.setPz(0.5*(aLightConeMomentum - TransverseMass2/aLightConeMomentum) * 154 241 (aDirection? 1: -1)); … … 156 243 Set4Momentum(a4Momentum); 157 244 } 245 246 // Reduce DiQ-aDiQ to Q-aQ (true if succeeded). General function of the QPartons operations 247 G4bool G4QParton::ReduceDiQADiQ(G4QParton* d1, G4QParton* d2) 248 { 249 G4bool result=false; 250 G4int sPDG=d1->GetPDGCode(); 251 G4int nPDG=d2->GetPDGCode(); 252 #ifdef debug 253 G4cout<<"G4QParton::ReduceDiQADiQ: **Called** LPDG="<<sPDG<<", RPDG="<<nPDG<<G4endl; 254 #endif 255 G4int qPDG=sPDG; 256 if(qPDG<-99) qPDG=(-qPDG)/100; 257 else qPDG/=100; 258 G4int dPDG=nPDG; 259 if(dPDG<-99) dPDG=(-dPDG)/100; 260 else dPDG/=100; 261 G4int L1=qPDG/10; 262 G4int L2=qPDG%10; 263 G4int R1=dPDG/10; 264 G4int R2=dPDG%10; 265 if(L1==R1 || L1==R2 || L2==R1 || L2==R2) // Annihilation condition 266 { 267 if (L1==R1) 268 { 269 if(sPDG>0) sPDG=L2; 270 else sPDG=-L2; 271 if(nPDG>0) nPDG=R2; 272 else nPDG=-R2; 273 #ifdef debug 274 G4cout<<"G4QParton::ReDiQADiQ:L2="<<L2<<",R2="<<R2<<",L="<<sPDG<<",R="<<nPDG<<G4endl; 275 #endif 276 } 277 else if(L1==R2) 278 { 279 if(sPDG>0) sPDG=L2; 280 else sPDG=-L2; 281 if(nPDG>0) nPDG=R1; 282 else nPDG=-R1; 283 #ifdef debug 284 G4cout<<"G4QParton::ReDiQADiQ:L2="<<L2<<",R1="<<R1<<",L="<<sPDG<<",R="<<nPDG<<G4endl; 285 #endif 286 } 287 else if(L2==R1) 288 { 289 if(sPDG>0) sPDG=L1; 290 else sPDG=-L1; 291 if(nPDG>0) nPDG=R2; 292 else nPDG=-R2; 293 #ifdef debug 294 G4cout<<"G4QParton::ReDiQADiQ:L1="<<L1<<",R2="<<R2<<",L="<<sPDG<<",R="<<nPDG<<G4endl; 295 #endif 296 } 297 else //(L2==R2) 298 { 299 if(sPDG>0) sPDG=L1; 300 else sPDG=-L1; 301 if(nPDG>0) nPDG=R1; 302 else nPDG=-R1; 303 #ifdef debug 304 G4cout<<"G4QParton::ReDiQADiQ:L1="<<L1<<",R1="<<R1<<",L="<<sPDG<<",R="<<nPDG<<G4endl; 305 #endif 306 } 307 d1->SetPDGCode(sPDG); // Reset the left quark 308 d2->SetPDGCode(nPDG); // Reset the right quark 309 result=true; 310 #ifdef debug 311 G4cout<<"G4QParton::ReduceDiQADiQ:AfterReduction,L="<<sPDG<<",R="<<nPDG<<G4endl; 312 #endif 313 } 314 #ifdef debug 315 else G4cout<<"-Warning-G4QParton::ReduceDiQADiQ:DQ-aDQ reduction to Q-aQ Failed"<<G4endl; 316 #endif 317 return result; 318 } -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QPartonPair.cc
r1055 r1196 27 27 // 28 28 // $Id: G4QPartonPair.cc,v 1.2 2009/02/23 09:49:24 mkossov Exp $ 29 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $29 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 30 30 // 31 31 // ------------------------------------------------------------ -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4QString.cc
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4QString.cc,v 1. 5 2009/02/23 09:49:24mkossov Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4QString.cc,v 1.17 2009/09/04 14:38:00 mkossov Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------ … … 50 50 51 51 //#define debug 52 //#define pdebug 53 //#define edebug 52 54 53 55 #include "G4QString.hh" … … 55 57 // Static parameters definition 56 58 G4double G4QString::MassCut=350.*MeV; // minimum mass cut for the string 57 G4double G4QString::ClusterMass=150.*MeV; // minimum cluster mass for fragmentation58 59 G4double G4QString::SigmaQT=0.5*GeV; // quarkTransverseMomentum distribution parameter 59 60 G4double G4QString::DiquarkSuppress=0.1; // is Diquark suppression parameter … … 62 63 G4double G4QString::StrangeSuppress=0.435;// Strangeness suppression (u:d:s=1:1:0.3 ?M.K.) 63 64 G4double G4QString::widthOfPtSquare=-0.72*GeV*GeV; // pt -width2 forStringExcitation 64 G4int G4QString::StringLoopInterrupt=999; // String fragmentation LOOP limit 65 G4int G4QString::ClusterLoopInterrupt=500;// Cluster fragmentation LOOP limit 66 67 G4QString::G4QString() : theDirection(0),thePosition(G4ThreeVector(0.,0.,0.)), 68 hadronizer(new G4QHadronBuilder){} 69 70 G4QString::G4QString(G4QParton* Color, G4QParton* AntiColor, G4int Direction) : 71 hadronizer(new G4QHadronBuilder) 72 { 65 66 G4QString::G4QString() : theDirection(0), thePosition(G4ThreeVector(0.,0.,0.)) {} 67 68 G4QString::G4QString(G4QParton* Color, G4QParton* AntiColor, G4int Direction) 69 { 70 #ifdef debug 71 G4cout<<"G4QString::PPD-Constructor: Direction="<<Direction<<G4endl; 72 #endif 73 73 ExciteString(Color, AntiColor, Direction); 74 #ifdef debug 75 G4cout<<"G4QString::PPD-Constructor: >>> String is excited"<<G4endl; 76 #endif 77 } 78 79 G4QString::G4QString(G4QPartonPair* CAC) 80 { 81 #ifdef debug 82 G4cout<<"G4QString::PartonPair-Constructor: Is CALLED"<<G4endl; 83 #endif 84 ExciteString(CAC->GetParton1(), CAC->GetParton2(), CAC->GetDirection()); 85 #ifdef debug 86 G4cout<<"G4QString::PartonPair-Constructor: >>> String is excited"<<G4endl; 87 #endif 74 88 } 75 89 76 90 G4QString::G4QString(G4QParton* QCol,G4QParton* Gluon,G4QParton* QAntiCol,G4int Direction): 77 theDirection(Direction), thePosition(QCol->GetPosition()),hadronizer(new G4QHadronBuilder)91 theDirection(Direction), thePosition(QCol->GetPosition()) 78 92 { 79 93 thePartons.push_back(QCol); 94 G4LorentzVector sum=QCol->Get4Momentum(); 80 95 thePartons.push_back(Gluon); 96 sum+=Gluon->Get4Momentum(); 81 97 thePartons.push_back(QAntiCol); 98 sum+=QAntiCol->Get4Momentum(); 99 Pplus =sum.e() + sum.pz(); 100 Pminus=sum.e() - sum.pz(); 101 decaying=None; 82 102 } 83 103 84 104 G4QString::G4QString(const G4QString &right) : theDirection(right.GetDirection()), 85 thePosition(right.GetPosition()), hadronizer(new G4QHadronBuilder){} 105 thePosition(right.GetPosition()) 106 { 107 //LeftParton=right.LeftParton; 108 //RightParton=right.RightParton; 109 Ptleft=right.Ptleft; 110 Ptright=right.Ptright; 111 Pplus=right.Pplus; 112 Pminus=right.Pminus; 113 decaying=right.decaying; 114 } 86 115 87 116 G4QString::~G4QString() 88 {if(thePartons.size())std::for_each(thePartons.begin(),thePartons.end(),DeleteQParton());}117 {if(thePartons.size()) std::for_each(thePartons.begin(),thePartons.end(),DeleteQParton());} 89 118 90 119 G4LorentzVector G4QString::Get4Momentum() const … … 101 130 } 102 131 103 void G4QString::InsertParton(G4QParton* aParton, const G4QParton* addafter) 104 { 105 G4QPartonVector::iterator insert_index; // Begin by default (? M.K.) 106 107 if(addafter != NULL) 108 { 109 insert_index=std::find(thePartons.begin(), thePartons.end(), addafter); 110 if (insert_index == thePartons.end()) // No object addafter in thePartons 111 { 112 G4cerr<<"***G4QString::InsertParton: Address Parton is not found"<<G4endl; 113 G4Exception("G4QString::InsertParton:","72",FatalException,"NoAddressParton"); 114 } 115 } 116 thePartons.insert(insert_index+1, aParton); 117 } 118 119 G4LorentzRotation G4QString::TransformToCenterOfMass() 120 { 121 G4LorentzRotation toCms(-1*Get4Momentum().boostVector()); 122 for(unsigned i=0; i<thePartons.size(); i++) 123 thePartons[i]->Set4Momentum(toCms*thePartons[i]->Get4Momentum()); 124 return toCms; 125 } 126 127 G4LorentzRotation G4QString::TransformToAlignedCms() 128 { 129 G4LorentzVector momentum=Get4Momentum(); 130 G4LorentzRotation toAlignedCms(-1*momentum.boostVector()); 131 momentum= toAlignedCms* thePartons[0]->Get4Momentum(); 132 toAlignedCms.rotateZ(-1*momentum.phi()); 133 toAlignedCms.rotateY(-1*momentum.theta()); 134 for(unsigned index=0; index<thePartons.size(); index++) 135 { 136 momentum=toAlignedCms * thePartons[index]->Get4Momentum(); 137 thePartons[index]->Set4Momentum(momentum); 138 } 139 return toAlignedCms; 140 } 132 //void G4QString::InsertParton(G4QParton* aParton, const G4QParton* addafter) 133 //{ 134 // G4QPartonVector::iterator insert_index; // Begin by default (? M.K.) 135 // if(addafter != NULL) 136 // { 137 // insert_index=std::find(thePartons.begin(), thePartons.end(), addafter); 138 // if (insert_index == thePartons.end()) // No object addafter in thePartons 139 // { 140 // G4cerr<<"***G4QString::InsertParton: Addressed Parton is not found"<<G4endl; 141 // G4Exception("G4QString::InsertParton:","72",FatalException,"NoAddressParton"); 142 // } 143 // } 144 // thePartons.insert(insert_index+1, aParton); 145 //} 141 146 142 147 void G4QString::Boost(G4ThreeVector& Velocity) … … 150 155 } 151 156 152 G4QParton* G4QString::GetColorParton(void) const153 {154 G4QParton* start = *(thePartons.begin());155 G4QParton* end = *(thePartons.end()-1);156 G4int Encoding = start->GetPDGCode();157 if (Encoding<-1000 || (Encoding < 1000 && Encoding > 0)) return start;158 return end;159 }160 161 G4QParton* G4QString::GetAntiColorParton(void) const162 {163 G4QParton* start = *(thePartons.begin());164 G4QParton* end = *(thePartons.end()-1);165 G4int Encoding = start->GetPDGCode();166 if (Encoding < -1000 || (Encoding < 1000 && Encoding > 0)) return end;167 return start;168 }157 //G4QParton* G4QString::GetColorParton(void) const 158 //{ 159 // G4QParton* start = *(thePartons.begin()); 160 // G4QParton* end = *(thePartons.end()-1); 161 // G4int Encoding = start->GetPDGCode(); 162 // if (Encoding<-1000 || (Encoding < 1000 && Encoding > 0)) return start; 163 // return end; 164 //} 165 166 //G4QParton* G4QString::GetAntiColorParton(void) const 167 //{ 168 // G4QParton* start = *(thePartons.begin()); 169 // G4QParton* end = *(thePartons.end()-1); 170 // G4int Encoding = start->GetPDGCode(); 171 // if (Encoding < -1000 || (Encoding < 1000 && Encoding > 0)) return end; 172 // return start; 173 //} 169 174 170 175 // Fill parameters 171 void G4QString::SetParameters(G4double mCut, G4double clustM, G4double sigQT,G4double DQSup,172 G4double DQBU, G4double smPar, G4double SSup, G4double SigPt, G4int SLmax, G4int CLmax)176 void G4QString::SetParameters(G4double mCut, G4double sigQT, G4double DQSup, G4double DQBU, 177 G4double smPar, G4double SSup, G4double SigPt) 173 178 {// ============================================================================= 174 179 MassCut = mCut; // minimum mass cut for the string 175 ClusterMass = clustM; // minimum cluster mass for the fragmentation176 180 SigmaQT = sigQT; // quark transverse momentum distribution parameter 177 181 DiquarkSuppress = DQSup; // is Diquark suppression parameter … … 180 184 StrangeSuppress = SSup; // Strangeness suppression parameter 181 185 widthOfPtSquare = -2*SigPt*SigPt; // width^2 of pt for string excitation 182 StringLoopInterrupt = SLmax; // String fragmentation LOOP limit183 ClusterLoopInterrupt= CLmax; // Cluster fragmentation LOOP limit184 186 } 185 187 … … 194 196 195 197 // Diffractively excite the string 196 void G4QString::DiffString(G4QHadron* hadron, G4bool isProjectile)197 {198 hadron->SplitUp();199 G4QParton* start = hadron->GetNextParton();200 if( start==NULL)201 {202 G4cerr<<"***G4QString::DiffString: No start parton found, nothing is done"<<G4endl;203 return;204 }205 G4QParton* end = hadron->GetNextParton();206 if( end==NULL)207 {208 G4cerr<<"***G4QString::DiffString: No end parton found, nothing is done"<<G4endl;209 return;210 }211 if(isProjectile) ExciteString(end, start, 1); // 1 = Projectile212 else ExciteString(start, end,-1); // -1 = Target213 SetPosition(hadron->GetPosition());214 // momenta of string ends215 G4double ptSquared= hadron->Get4Momentum().perp2();216 G4double hmins=hadron->Get4Momentum().minus();217 G4double hplus=hadron->Get4Momentum().plus();218 G4double transMassSquared=hplus*hmins;219 G4double maxMomentum = std::sqrt(transMassSquared) - std::sqrt(ptSquared);220 G4double maxAvailMomentumSquared = maxMomentum * maxMomentum;221 G4ThreeVector pt=GaussianPt(widthOfPtSquare,maxAvailMomentumSquared);222 G4LorentzVector Pstart(G4LorentzVector(pt,0.));223 G4LorentzVector Pend(hadron->Get4Momentum().px(), hadron->Get4Momentum().py(), 0.);224 Pend-=Pstart;225 G4double tm1=hmins+(Pend.perp2()-Pstart.perp2())/hplus;226 G4double tm2=std::sqrt( std::max(0., tm1*tm1-4*Pend.perp2()*hmins/hplus ) );227 G4int Sign= isProjectile ? TARGET : PROJECTILE;228 G4double endMinus = 0.5 * (tm1 + Sign*tm2);229 G4double startMinus= hmins - endMinus;230 G4double startPlus = Pstart.perp2() / startMinus;231 G4double endPlus = hplus - startPlus;232 Pstart.setPz(0.5*(startPlus - startMinus));233 Pstart.setE (0.5*(startPlus + startMinus));234 Pend.setPz (0.5*(endPlus - endMinus));235 Pend.setE (0.5*(endPlus + endMinus));236 start->Set4Momentum(Pstart);237 end->Set4Momentum(Pend);238 #ifdef debug239 G4cout<<"G4QString::DiffString: StartQ="<<start->GetPDGCode()<<start->Get4Momentum()<<"("240 <<start->Get4Momentum().mag()<<"), EndQ="<<end->GetPDGCode()<<end ->Get4Momentum()241 <<"("<<end->Get4Momentum().mag()<<"), sumOfEnds="<<Pstart+Pend<<", H4M(original)="242 <<hadron->Get4Momentum()<<G4endl;243 #endif244 } // End of DiffString (The string is excited diffractively)198 //void G4QString::DiffString(G4QHadron* hadron, G4bool isProjectile) 199 //{ 200 // hadron->SplitUp(); 201 // G4QParton* start = hadron->GetNextParton(); 202 // if( start==NULL) 203 // { 204 // G4cerr<<"***G4QString::DiffString: No start parton found, nothing is done"<<G4endl; 205 // return; 206 // } 207 // G4QParton* end = hadron->GetNextParton(); 208 // if( end==NULL) 209 // { 210 // G4cerr<<"***G4QString::DiffString: No end parton found, nothing is done"<<G4endl; 211 // return; 212 // } 213 // if(isProjectile) ExciteString(end, start, 1); // 1 = Projectile 214 // else ExciteString(start, end,-1); // -1 = Target 215 // SetPosition(hadron->GetPosition()); 216 // // momenta of string ends 217 // G4double ptSquared= hadron->Get4Momentum().perp2(); 218 // G4double hmins=hadron->Get4Momentum().minus(); 219 // G4double hplus=hadron->Get4Momentum().plus(); 220 // G4double transMassSquared=hplus*hmins; 221 // G4double maxMomentum = std::sqrt(transMassSquared) - std::sqrt(ptSquared); 222 // G4double maxAvailMomentumSquared = maxMomentum * maxMomentum; 223 // G4ThreeVector pt=GaussianPt(widthOfPtSquare,maxAvailMomentumSquared); 224 // G4LorentzVector Pstart(G4LorentzVector(pt,0.)); 225 // G4LorentzVector Pend(hadron->Get4Momentum().px(), hadron->Get4Momentum().py(), 0.); 226 // Pend-=Pstart; 227 // G4double tm1=hmins+(Pend.perp2()-Pstart.perp2())/hplus; 228 // G4double tm2=std::sqrt( std::max(0., tm1*tm1-4*Pend.perp2()*hmins/hplus ) ); 229 // G4int Sign= isProjectile ? TARGET : PROJECTILE; 230 // G4double endMinus = 0.5 * (tm1 + Sign*tm2); 231 // G4double startMinus= hmins - endMinus; 232 // G4double startPlus = Pstart.perp2() / startMinus; 233 // G4double endPlus = hplus - startPlus; 234 // Pstart.setPz(0.5*(startPlus - startMinus)); 235 // Pstart.setE (0.5*(startPlus + startMinus)); 236 // Pend.setPz (0.5*(endPlus - endMinus)); 237 // Pend.setE (0.5*(endPlus + endMinus)); 238 // start->Set4Momentum(Pstart); 239 // end->Set4Momentum(Pend); 240 //#ifdef debug 241 // G4cout<<"G4QString::DiffString: StartQ="<<start->GetPDGCode()<<start->Get4Momentum()<<"(" 242 // <<start->Get4Momentum().mag()<<"), EndQ="<<end->GetPDGCode()<<end ->Get4Momentum() 243 // <<"("<<end->Get4Momentum().mag()<<"), sumOfEnds="<<Pstart+Pend<<", H4M(original)=" 244 // <<hadron->Get4Momentum()<<G4endl; 245 //#endif 246 //} // End of DiffString (The string is excited diffractively) 245 247 246 248 // Excite the string by two partons 247 249 void G4QString::ExciteString(G4QParton* Color, G4QParton* AntiColor, G4int Direction) 248 250 { 251 #ifdef debug 252 G4cout<<"G4QString::ExciteString: **Called**, direction="<<Direction<<G4endl; 253 #endif 254 if(thePartons.size()) std::for_each(thePartons.begin(),thePartons.end(),DeleteQParton()); 255 thePartons.clear(); 249 256 theDirection = Direction; 250 257 thePosition = Color->GetPosition(); 258 #ifdef debug 259 G4cout<<"G4QString::ExciteString: ColourPosition = "<<thePosition<<", beg="<<Color->GetPDGCode() 260 <<",end="<<AntiColor->GetPDGCode()<<G4endl; 261 #endif 251 262 thePartons.push_back(Color); 252 thePartons.push_back(AntiColor); 263 G4LorentzVector sum=Color->Get4Momentum(); 264 thePartons.push_back(AntiColor); // @@ Complain of Valgrind 265 sum+=AntiColor->Get4Momentum(); 266 Pplus =sum.e() + sum.pz(); 267 Pminus=sum.e() - sum.pz(); 268 decaying=None; 269 #ifdef debug 270 G4cout<<"G4QString::ExciteString: ***Done***, beg="<<(*thePartons.begin())->GetPDGCode() 271 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 272 #endif 253 273 } // End of ExciteString 254 274 … … 257 277 G4QHadron* pHadron, G4double Px, G4double Py) 258 278 { 259 260 261 262 263 264 265 266 267 268 269 270 271 272 279 static const G4double alund = 0.7/GeV/GeV; 280 // If blund get restored, you MUST adapt the calculation of zOfMaxyf. 281 //static const G4double blund = 1; 282 G4double z, yf; 283 G4double Mt2 = Px*Px + Py*Py + pHadron->GetMass2(); 284 G4double zOfMaxyf=alund*Mt2/(alund*Mt2+1.); 285 G4double maxYf=(1.-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf); 286 do 287 { 288 z = zmin + G4UniformRand()*(zmax-zmin); 289 // yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z); 290 yf = (1-z)/z * std::exp(-alund*Mt2/z); 291 } while (G4UniformRand()*maxYf>yf); 292 return z; 273 293 } // End of GetLundLightConeZ 274 294 … … 320 340 } // End of GetQGSMLightConeZ 321 341 322 // Diffractively excite the string 342 // Diffractively excite the string (QL=true - QGS Light Cone, =false - Lund Light Cone) 323 343 G4QHadronVector* G4QString::FragmentString(G4bool QL) 324 344 { 325 345 // Can no longer modify Parameters for Fragmentation. 326 // PastInitPhase=true; // Now static 327 328 // check if string has enough mass to fragment... 329 G4QHadronVector* LeftVector=LightFragmentationTest(); 330 if(LeftVector) return LeftVector; 331 332 LeftVector = new G4QHadronVector; 346 #ifdef edebug 347 G4LorentzVector string4M=Get4Momentum(); // Just for Energy-Momentum ConservCheck 348 #endif 349 #ifdef debug 350 G4cout<<"G4QString::FragmentString:-->Called,QL="<<QL<<", M="<<Get4Momentum().m()<<", L=" 351 <<GetLeftParton()->Get4Momentum()<<",R="<<GetRightParton()->Get4Momentum()<<G4endl; 352 #endif 353 // check if string has enough mass to fragment. If not, convert to one or two hadrons 354 G4QHadronVector* LeftVector = LightFragmentationTest(); 355 if(LeftVector) 356 { 357 #ifdef edebug 358 G4LorentzVector sL=string4M; 359 for(unsigned L = 0; L < LeftVector->size(); L++) 360 { 361 G4QHadron* LH = (*LeftVector)[L]; 362 G4LorentzVector L4M=LH->Get4Momentum(); 363 sL-=L4M; 364 G4cout<<"-EMC-G4QStr::FragStr:L#"<<L<<",PDG="<<LH->GetPDGCode()<<",4M="<<L4M<<G4endl; 365 } 366 G4cout<<"-EMC-G4QString::FragmentString:---LightFragmentation---> Res4M="<<sL<<G4endl; 367 #endif 368 return LeftVector; //@@ Just decay in 2 or 1 (?) hadron, if below theCut 369 } 370 #ifdef debug 371 G4cout<<"G4QString::FragmentString:OUTPUT is not yet defined, define Left/Right"<<G4endl; 372 #endif 373 LeftVector = new G4QHadronVector; // Valgrind complain to LeftVector 333 374 G4QHadronVector* RightVector = new G4QHadronVector; 334 335 // this should work but it's only a semi deep copy. 336 // %GF G4ExcitedString theStringInCMS(theString); 337 G4QString* theStringInCMS=CPExcited(); // must be deleted 338 G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms(); 375 // Remember 4-momenta of the string ends (@@ only for the two-parton string, no gluons) 376 G4LorentzVector left4M=GetLeftParton()->Get4Momentum(); // For recovery when failed 377 G4LorentzVector right4M=GetRightParton()->Get4Momentum(); 378 #ifdef debug 379 G4cout<<"G4QString::FragmString: ***Remember*** L4M="<<left4M<<", R4M="<<right4M<<G4endl; 380 #endif 381 G4int leftPDG=GetLeftParton()->GetPDGCode(); 382 G4int rightPDG=GetRightParton()->GetPDGCode(); 383 // Transform string to CMS 384 G4LorentzVector momentum=Get4Momentum(); 385 G4LorentzRotation toCms(-(momentum.boostVector())); 386 momentum= toCms * thePartons[0]->Get4Momentum(); 387 toCms.rotateZ(-1*momentum.phi()); 388 toCms.rotateY(-1*momentum.theta()); 389 for(unsigned index=0; index<thePartons.size(); index++) 390 { 391 momentum = toCms * thePartons[index]->Get4Momentum(); // @@ reuse of the momentum 392 thePartons[index]->Set4Momentum(momentum); 393 } 394 // Copy the string for independent attempts 395 G4QParton* LeftParton = new G4QParton(GetLeftParton()); 396 G4QParton* RightParton= new G4QParton(GetRightParton()); 397 G4QString* theStringInCMS = new G4QString(LeftParton,RightParton,GetDirection()); 398 #ifdef debug 399 G4cout<<"G4QString::FragmentString: Copy with nP="<<theStringInCMS->thePartons.size() 400 <<", beg="<<(*(theStringInCMS->thePartons.begin()))->GetPDGCode() 401 <<", end="<<(*(theStringInCMS->thePartons.end()-1))->GetPDGCode()<<G4endl; 402 #endif 339 403 G4bool success=false; 340 404 G4bool inner_sucess=true; 341 405 G4int attempt=0; 342 while (!success && attempt++<StringLoopInterrupt) //@@ It's Loop with break 343 { 344 G4QString* currentString = new G4QString(*theStringInCMS); 406 G4int StringLoopInterrupt=27; // String fragmentation LOOP limit 407 #ifdef debug 408 G4cout<<"G4QString::FragmentString: BeforeWhileLOOP, max = "<<StringLoopInterrupt 409 <<", nP="<<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 410 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 411 #endif 412 #ifdef edebug 413 G4LorentzVector cmS4M=theStringInCMS->Get4Momentum(); 414 G4cout<<"-EMC-G4QString::FragmString: c4M="<<cmS4M<<",Max="<<StringLoopInterrupt<<G4endl; 415 #endif 416 while (!success && attempt++ < StringLoopInterrupt) // Try fragment String till success 417 { 418 // Recover the CMS String 419 G4QParton* LeftParton = new G4QParton(theStringInCMS->GetLeftParton()); 420 G4QParton* RightParton= new G4QParton(theStringInCMS->GetRightParton()); 421 ExciteString(LeftParton, RightParton, theStringInCMS->GetDirection()); 422 #ifdef edebug 423 G4LorentzVector cm4M=cmS4M; // Copy the full momentum for the reduction and check 424 G4cout<<"-EMC-.G4QString::FragmentString: CHEK "<<cm4M<<" ?= "<<Get4Momentum()<<G4endl; 425 #endif 426 #ifdef debug 427 G4cout<<"G4QString::FragmentString:===>LOOP, attempt = "<<attempt<<", nP=" 428 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 429 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 430 #endif 431 // Now clean up all hadrons in the Left and Right vectors for the new attempt 345 432 if(LeftVector->size()) 346 433 { … … 348 435 LeftVector->clear(); 349 436 } 437 //delete LeftVector; // @@ Valgrind ? 350 438 if(RightVector->size()) 351 439 { … … 353 441 RightVector->clear(); 354 442 } 355 inner_sucess=true; // set false on failure.. 356 while (!StopFragmentation()) 357 { // Split current string into hadron + new string 358 G4QString* newString=0; // used as output from SplitUp... 359 G4QHadron* Hadron=Splitup(QL); 360 if(Hadron && IsFragmentable()) 443 //delete RightVector; // @@ Valgrind ? 444 inner_sucess=true; // set false on failure 445 while (!StopFragmentation()) // LOOP with break 446 { // Split current string into hadron + new string state 447 #ifdef debug 448 G4cout<<"G4QString::FragmentString:-->Begin LOOP/LOOP, decaying="<<decaying<<G4endl; 449 #endif 450 G4QHadron* Hadron=Splitup(QL); // MAIN: where the hadron is split from the string 451 #ifdef edebug 452 cm4M-=Hadron->Get4Momentum(); 453 G4cout<<"-EMC-G4QString::FragmentString:LOOP/LOOP,d4M="<<cm4M-Get4Momentum()<<G4endl; 454 #endif 455 G4bool canBeFrag=IsFragmentable(); 456 #ifdef debug 457 G4cout<<"G4QString::FragmentString: LOOP/LOOP, canBeFrag="<<canBeFrag<<", decay=" 458 <<decaying<<", H="<<Hadron<<", newStringMass="<<Get4Momentum().m()<<G4endl; 459 #endif 460 if(Hadron && canBeFrag) 361 461 { 362 if(currentString->GetDecayDirection()>0) LeftVector->push_back(Hadron); 462 #ifdef debug 463 G4cout<<">>G4QString::FragmentString: LOOP/LOOP-NO FRAGM-, dec="<<decaying<<G4endl; 464 #endif 465 if(GetDecayDirection()>0) LeftVector->push_back(Hadron); 363 466 else RightVector->push_back(Hadron); 364 delete currentString;365 currentString=newString;366 467 } 367 468 else 368 469 { 470 // @@ Try to convert to the resonance and decay, abandon if M<mGS+mPI0 369 471 // abandon ... start from the beginning 370 if (newString) delete newString; 371 if (Hadron) delete Hadron; 472 #ifdef debug 473 G4cout<<"G4QString::FragmentString: LOOP/LOOP, Start from scratch"<<G4endl; 474 #endif 475 if (Hadron) delete Hadron; 372 476 inner_sucess=false; 373 477 break; 374 478 } 479 #ifdef debug 480 G4cout<<"G4QString::FragmentString: LOOP/LOOP End, nP=" 481 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 482 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 483 #endif 375 484 } 376 // Split current string into 2 final Hadrons 377 if( inner_sucess && SplitLast(currentString, LeftVector, RightVector) ) success=true; 378 delete currentString; 379 } 485 #ifdef edebug 486 G4LorentzVector fLR=cmS4M-Get4Momentum(); 487 for(unsigned L = 0; L < LeftVector->size(); L++) 488 { 489 G4QHadron* LH = (*LeftVector)[L]; 490 G4LorentzVector L4M=LH->Get4Momentum(); 491 fLR-=L4M; 492 G4cout<<"-EMC-G4QStr::FrStr:L#"<<L<<",PDG="<<LH->GetPDGCode()<<",4M="<<L4M<<G4endl; 493 } 494 for(unsigned R = 0; R < RightVector->size(); R++) 495 { 496 G4QHadron* RH = (*RightVector)[R]; 497 G4LorentzVector R4M=RH->Get4Momentum(); 498 fLR-=R4M; 499 G4cout<<"-EMC-G4QStr::FrStr:R#"<<R<<",PDG="<<RH->GetPDGCode()<<",4M="<<R4M<<G4endl; 500 } 501 G4cout<<"-EMC-G4QString::FragmentString:L/R_BeforLast->r4M/M2="<<fLR<<fLR.m2()<<G4endl; 502 #endif 503 // Split current string into 2 final Hadrons 504 #ifdef debug 505 G4cout<<"G4QString::FragmentString: inner_success = "<<inner_sucess<<G4endl; 506 #endif 507 if(inner_sucess) 508 { 509 success=true; // Default prototype 510 //... perform last cluster decay 511 G4LorentzVector tot4M = Get4Momentum(); 512 G4double totM = tot4M.m(); 513 #ifdef debug 514 G4cout<<"G4QString::FragmString: string4M="<<tot4M<<totM<<G4endl; 515 #endif 516 G4QHadron* LeftHadron; 517 G4QHadron* RightHadron; 518 G4QParton* RQuark = 0; 519 SetLeftPartonStable(); // to query quark contents 520 if(DecayIsQuark() && StableIsQuark()) // There're quarks on clusterEnds 521 { 522 #ifdef debug 523 G4cout<<"G4QString::FragmentString: LOOP Quark Algorithm"<<G4endl; 524 #endif 525 LeftHadron= QuarkSplitup(GetLeftParton(), RQuark); 526 } 527 else 528 { 529 #ifdef debug 530 G4cout<<"G4QString::FragmentString: LOOP Di-Quark Algorithm"<<G4endl; 531 #endif 532 //... there is a Diquark on cluster ends 533 G4int IsParticle; 534 if(StableIsQuark()) IsParticle=(GetLeftParton()->GetPDGCode()>0)?-1:1; 535 else IsParticle=(GetLeftParton()->GetPDGCode()>0)?1:-1; 536 G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks 537 RQuark = QuarkPair.GetParton2(); 538 G4QParton* LQuark = QuarkPair.GetParton1(); 539 LeftHadron = CreateHadron(LQuark, GetLeftParton()); // Create Left Hadron 540 delete LQuark; // Delete the temporaryParton 541 } 542 RightHadron = CreateHadron(GetRightParton(), RQuark); // Create Right Hadron 543 delete RQuark; // Delete the temporaryParton 544 //... repeat procedure, if mass of cluster is too low to produce hadrons 545 G4double LhM=LeftHadron->GetMass(); 546 G4double RhM=RightHadron->GetMass(); 547 #ifdef debug 548 G4cout<<"G4QStr::FrSt:L="<<LeftHadron->GetPDGCode()<<",R="<<RightHadron->GetPDGCode() 549 <<",ML="<<LhM<<",MR="<<RhM<<",SumM="<<LhM+RhM<<",tM="<<totM<<G4endl; 550 #endif 551 if(totM < LhM + RhM) success=false; 552 //... compute hadron momenta and energies 553 if(success) 554 { 555 G4ThreeVector Pos=GetPosition(); 556 G4LorentzVector Lh4M(0.,0.,0.,LhM); 557 G4LorentzVector Rh4M(0.,0.,0.,RhM); 558 if(G4QHadron(tot4M).DecayIn2(Lh4M,Rh4M)) 559 { 560 LeftVector->push_back(new G4QHadron(LeftHadron, 0, Pos, Lh4M)); 561 delete LeftHadron; 562 RightVector->push_back(new G4QHadron(RightHadron, 0, Pos, Rh4M)); 563 delete RightHadron; 564 } 565 #ifdef debug 566 G4cout<<">>>G4QStr::FragString:HFilled (L) PDG="<<LeftHadron->GetPDGCode()<<", 4M=" 567 <<Lh4M<<", (R) PDG="<<RightHadron->GetPDGCode()<<", 4M="<<Rh4M<<G4endl; 568 #endif 569 #ifdef edebug 570 G4cout<<"-EMC-G4QString::FragmentString: Residual4M="<<tot4M-Lh4M-Rh4M<<G4endl; 571 #endif 572 } 573 else 574 { 575 if(LeftHadron) delete LeftHadron; 576 if(RightHadron) delete RightHadron; 577 } 578 } // End of inner success 579 } // End of while 380 580 delete theStringInCMS; 581 #ifdef debug 582 G4cout<<"G4QString::FragmentString: LOOP/LOOP, success="<<success<<G4endl; 583 #endif 381 584 if (!success) 382 585 { … … 392 595 LeftVector->clear(); 393 596 } 394 return LeftVector; 395 } 597 delete LeftVector; 598 #ifdef debug 599 G4cout<<"G4QString::FragmString:StringNotFragm,L4M="<<left4M<<",R4M="<<right4M<<G4endl; 600 #endif 601 // Recover the Left/Right partons 4-moms of the String in ZLS 602 GetLeftParton()->SetPDGCode(leftPDG); 603 GetRightParton()->SetPDGCode(rightPDG); 604 GetLeftParton()->Set4Momentum(left4M); 605 GetRightParton()->Set4Momentum(right4M); 606 return 0; // The string can not be fragmented 607 } 608 // @@@@@ Print collected Left and Right Hadrons (decay resonances!) 609 #ifdef edebug 610 G4LorentzVector sLR=cmS4M; 611 for(unsigned L = 0; L < LeftVector->size(); L++) 612 { 613 G4QHadron* LH = (*LeftVector)[L]; 614 G4LorentzVector L4M=LH->Get4Momentum(); 615 sLR-=L4M; 616 G4cout<<"-EMC-G4QStr::FragmStri:L#"<<L<<",PDG="<<LH->GetPDGCode()<<",4M="<<L4M<<G4endl; 617 } 618 for(unsigned R = 0; R < RightVector->size(); R++) 619 { 620 G4QHadron* RH = (*RightVector)[R]; 621 G4LorentzVector R4M=RH->Get4Momentum(); 622 sLR-=R4M; 623 G4cout<<"-EMC-G4QStr::FragmStri:R#"<<R<<",PDG="<<RH->GetPDGCode()<<",4M="<<R4M<<G4endl; 624 } 625 G4cout<<"-EMC-G4QString::FragmentString:---L/R_BeforeMerge---> Res4M="<<sLR<<G4endl; 626 #endif 396 627 // Join Left and Right Vectors into LeftVector in correct order. 397 628 while(!RightVector->empty()) … … 401 632 } 402 633 delete RightVector; 403 CalculateHadronTimePosition(Get4Momentum().mag(), LeftVector); 634 // @@ A trick, the real bug should be found !! 635 G4QHadronVector::iterator ilv; // @@ 636 for(ilv = LeftVector->begin(); ilv < LeftVector->end(); ilv++) // @@ 637 { 638 G4ThreeVector CV=(*ilv)->Get4Momentum().vect(); // @@ 639 if(CV.x()==0. && CV.y()==0. && CV.z()==0.) LeftVector->erase(ilv); // @@ 640 } 641 // Calculate time and position of hadrons with @@ very rough formation time 642 G4double StringMass=Get4Momentum().mag(); 643 static const G4double dkappa = 2.0 * GeV/fermi; // @@ 2*kappa kappa=1 GeV/fermi (?) 644 for(unsigned c1 = 0; c1 < LeftVector->size(); c1++) 645 { 646 G4double SumPz = 0; 647 G4double SumE = 0; 648 for(unsigned c2 = 0; c2 < c1; c2++) 649 { 650 G4LorentzVector hc2M=(*LeftVector)[c2]->Get4Momentum(); 651 SumPz += hc2M.pz(); 652 SumE += hc2M.e(); 653 } 654 G4QHadron* hc1=(*LeftVector)[c1]; 655 G4LorentzVector hc1M=hc1->Get4Momentum(); 656 G4double HadronE = hc1M.e(); 657 G4double HadronPz= hc1M.pz(); 658 hc1->SetFormationTime((StringMass-SumPz-SumPz+HadronE-HadronPz)/dkappa); 659 hc1->SetPosition(G4ThreeVector(0,0,(StringMass-SumE-SumE-HadronE+HadronPz)/dkappa)); 660 } 404 661 G4LorentzRotation toObserverFrame(toCms.inverse()); 662 #ifdef debug 663 G4cout<<"G4QString::FragmentString: beforeLoop LVsize = "<<LeftVector->size()<<G4endl; 664 #endif 405 665 for(unsigned C1 = 0; C1 < LeftVector->size(); C1++) 406 666 { … … 414 674 Hadron->SetPosition(GetPosition()+Momentum.vect()); 415 675 } 416 return LeftVector; 417 } // End of FragmentLundString 418 419 // Creates a string, using only the end-partons of the string 420 G4QString* G4QString::CPExcited() 421 { 422 G4QParton* LeftParton = new G4QParton(GetLeftParton()); 423 G4QParton* RightParton= new G4QParton(GetRightParton()); 424 return new G4QString(LeftParton,RightParton,GetDirection()); 425 } // End of CPExcited 426 427 // Simple decay of the string 676 #ifdef edebug 677 G4LorentzVector sLA=string4M; 678 for(unsigned L = 0; L < LeftVector->size(); L++) 679 { 680 G4QHadron* LH = (*LeftVector)[L]; 681 G4LorentzVector L4M=LH->Get4Momentum(); 682 sLA-=L4M; 683 G4cout<<"-EMC-G4QStr::FragmStri:L#"<<L<<",PDG="<<LH->GetPDGCode()<<",4M="<<L4M<<G4endl; 684 } 685 G4cout<<"-EMC-G4QString::FragmentString:---LSAfterMerge&Conv---> Res4M="<<sLA<<G4endl; 686 #endif 687 #ifdef debug 688 G4cout<<"G4QString::FragmentString: *** Done *** "<<G4endl; 689 #endif 690 return LeftVector; // Should be deleted by user (@@ Valgrind complain ?) 691 } // End of FragmentString 692 693 // Simple decay of the string if the excitation mass is too small for HE fragmentation 694 // !! If the mass is below the single hadron threshold, make warning (improve) and convert 695 // the string to the single S-hadron breaking energy conservation (temporary) and improve, 696 // taking the threshold into account on the level of the String creation (merge strings) !! 428 697 G4QHadronVector* G4QString::LightFragmentationTest() 429 698 { 430 699 // Check string decay threshold 431 432 G4QHadronVector* result=0; // return 0 when string exceeds the mass cut 700 G4LorentzVector tot4M=Get4Momentum(); 701 #ifdef debug 702 G4cout<<"G4QString::LightFragmentationTest: ***Called***, string4M="<<tot4M<<G4endl; 703 #endif 704 G4QHadronVector* result=0; // return 0 when string exceeds the mass cut or below mh1+mh2 433 705 434 G4QHadronPair hadrons((G4QHadron*)0, (G4QHadron*)0); // pair of hadrons 435 if(sqr(FragmentationMass(0,&hadrons)+MassCut)<Mass2()) return 0; //Par MassCut 436 437 result = new G4QHadronVector; 438 439 if(hadrons.second==0) // Second hadron exists 440 { 441 // Substitute string by a light hadron, Note that Energy is not conserved here! @@ 442 G4ThreeVector Mom3 = Get4Momentum().vect(); 443 G4LorentzVector Mom(Mom3, std::sqrt(Mom3.mag2() + hadrons.first->GetMass2()) ); 444 result->push_back(new G4QHadron(hadrons.first, 0, GetPosition(), Mom)); 445 } 446 else 447 { 448 //... string was qq--qqbar type: Build two stable hadrons, 449 G4LorentzVector Mom1, Mom2; 450 Sample4Momentum(&Mom1, hadrons.first->GetMass(), &Mom2, hadrons.second->GetMass(), 451 Get4Momentum().mag()); 452 result->push_back(new G4QHadron(hadrons.first, 0, GetPosition(), Mom1)); 453 result->push_back(new G4QHadron(hadrons.second,0, GetPosition(), Mom2)); 454 G4ThreeVector Velocity = Get4Momentum().boostVector(); 455 G4int L=result->size(); if(L) for(G4int i=0; i<L; i++) (*result)[i]->Boost(Velocity); 456 } 706 G4QHadronPair hadrons((G4QHadron*)0, (G4QHadron*)0); // pair of hadrons for output of FrM 707 G4double fragMass = FragmentationMass(0,&hadrons); // Minimum mass to decay the string 708 #ifdef debug 709 G4cout<<"G4QString::LightFragTest: before check nP="<<thePartons.size()<<", MS2=" 710 <<Mass2()<<", MCut="<<MassCut<<", beg="<<(*thePartons.begin())->GetPDGCode() 711 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<", fM="<<fragMass<<G4endl; 712 #endif 713 if(Mass2() > sqr(fragMass+MassCut))// Big enough to fragment in a lader (avoid the decay) 714 { 715 if(hadrons.first) delete hadrons.first; 716 if(hadrons.second) delete hadrons.second; 717 #ifdef debug 718 G4cout<<"G4QString::LightFragTest:NO,M2="<<Mass2()<<">"<<sqr(fragMass+MassCut)<<G4endl; 719 #endif 720 return result; // =0. Depends on the parameter of the Mass Cut 721 } 722 G4double totM= tot4M.m(); 723 G4QHadron* h1=hadrons.first; 724 G4QHadron* h2=hadrons.second; 725 if(h1 && h2) 726 { 727 G4double h1M = h1->GetMass(); 728 G4double h2M = h2->GetMass(); 729 #ifdef debug 730 G4cout<<"G4QString::LightFragTest:tM="<<totM<<","<<h1M<<"+"<<h2M<<"+"<<h1M+h2M<<G4endl; 731 #endif 732 if(h1M + h2M <= totM) // The string can decay in these two hadrons 733 { 734 // Create two stable hadrons 735 G4LorentzVector h4M1(0.,0.,0.,h1M); 736 G4LorentzVector h4M2(0.,0.,0.,h2M); 737 if(G4QHadron(tot4M).DecayIn2(h4M1,h4M2)) 738 { 739 result = new G4QHadronVector; 740 result->push_back(new G4QHadron(hadrons.first, 0, GetPosition(), h4M1)); 741 result->push_back(new G4QHadron(hadrons.second,0, GetPosition(), h4M2)); 742 } 743 #ifdef edebug 744 G4int L=result->size(); if(L) for(G4int i=0; i<L; i++) 745 { 746 tot4M-=(*result)[i]->Get4Momentum(); 747 G4cout<<"-EMC-G4QString::LightFragTest: i="<<i<<", residual4M="<<tot4M<<G4endl; 748 } 749 #endif 750 } 751 #ifdef debug 752 else G4cout<<"-Warning-G4QString::LightFragTest: TooBigHadronMasses to decay"<<G4endl; 753 #endif 754 } 755 #ifdef debug 756 else G4cout<<"-Warning-G4QString::LightFragTest: No Hadrons have been proposed"<<G4endl; 757 #endif 758 delete hadrons.first; 759 delete hadrons.second; 457 760 return result; 458 761 } // End of LightFragmentationTest 459 762 460 763 // Calculate Fragmentation Mass (if pdefs # 0, returns two hadrons) 461 G4double G4QString::FragmentationMass(G4QHcreate build, G4QHadronPair* pdefs) 462 { 463 G4double mass; 764 G4double G4QString::FragmentationMass(G4int HighSpin, G4QHadronPair* pdefs) 765 { 766 G4double mass=0.; 767 #ifdef debug 768 G4cout<<"G4QString::FragmMass: ***Called***, s4M="<<Get4Momentum()<<G4endl; 769 #endif 464 770 // Example how to use an interface to different member functions 465 if(build==0) build=&G4QHadronBuilder::BuildLowSpin; // @@ Build S Hadrons? 466 G4QHadron* Hadron1 = 0; // @@ Not initialized 771 G4QHadron* Hadron1 = 0; 467 772 G4QHadron* Hadron2 = 0; 468 if(!FourQuarkString() ) 469 { 470 // spin 0 meson or spin 1/2 barion will be built 471 Hadron1 = (hadronizer->*build)(GetLeftParton(), GetRightParton()); 472 mass = Hadron1->GetMass(); 773 #ifdef debug 774 G4cout<<"G4QString::FragmentationMass: Create spin-0 or spin-1/2 hadron: nP=" 775 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 776 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 777 #endif 778 G4int iflc = (G4UniformRand() < 0.5) ? 1 : 2; // Create additional Q-antiQ pair @@ No S 779 G4int LPDG= GetLeftParton()->GetPDGCode(); 780 G4int LT = GetLeftParton()->GetType(); 781 if ( (LPDG > 0 && LT == 1) || (LPDG < 0 && LT == 2) ) iflc = -iflc; // anti-quark 782 G4QParton* piflc = new G4QParton( iflc); 783 G4QParton* miflc = new G4QParton(-iflc); 784 if(HighSpin) 785 { 786 Hadron1 = CreateHighSpinHadron(GetLeftParton(),piflc); 787 Hadron2 = CreateHighSpinHadron(GetRightParton(),miflc); 788 #ifdef debug 789 G4cout<<"G4QString::FragmentationMass: High, PDG1="<<Hadron1->GetPDGCode() 790 <<", PDG2="<<Hadron2->GetPDGCode()<<G4endl; 791 #endif 473 792 } 474 793 else 475 794 { 476 // string is qq--qqbar: Build two stable hadrons, with extra uubar or ddbar quark pair 477 G4int iflc = (G4UniformRand() < 0.5)? 1 : 2; 478 if (GetLeftParton()->GetPDGCode() < 0) iflc = -iflc; 479 //... theSpin = 4; spin 3/2 baryons will be built 480 Hadron1 = (hadronizer->*build)(GetLeftParton(),CreateParton(iflc)); 481 Hadron2 = (hadronizer->*build)(GetRightParton(),CreateParton(-iflc)); 482 mass = Hadron1->GetMass() + Hadron2->GetMass(); 483 } 484 if(pdefs) // need to return hadrons as well.... 485 { 486 pdefs->first = Hadron1; 487 pdefs->second = Hadron2; 488 } 795 Hadron1 = CreateLowSpinHadron(GetLeftParton(),piflc); 796 Hadron2 = CreateLowSpinHadron(GetRightParton(),miflc); 797 #ifdef debug 798 G4cout<<"G4QString::FragmentationMass: Low, PDG1="<<Hadron1->GetPDGCode() 799 <<", PDG2="<<Hadron2->GetPDGCode()<<G4endl; 800 #endif 801 } 802 mass = Hadron1->GetMass() + Hadron2->GetMass(); 803 if(pdefs) // need to return hadrons as well as the mass estimate 804 { 805 pdefs->first = Hadron1; // To be deleted by the calling program if not zero 806 pdefs->second = Hadron2; // To be deleted by the calling program if not zero 807 } 808 else // Forget about the hadrons 809 { 810 if(Hadron1) delete Hadron1; 811 if(Hadron2) delete Hadron2; 812 } 813 delete piflc; 814 delete miflc; 815 #ifdef debug 816 G4cout<<"G4QString::FragmentationMass: ***Done*** mass="<<mass<<G4endl; 817 #endif 489 818 return mass; 490 819 } // End of FragmentationMass 491 820 492 // Checks that the string is qq-(qq)bar string493 G4bool G4QString::FourQuarkString() const494 {495 return GetLeftParton()->GetParticleSubType() == "di_quark"496 && GetRightParton()->GetParticleSubType()== "di_quark";497 } // End of FourQuarkString498 499 void G4QString::CalculateHadronTimePosition(G4double StringMass, G4QHadronVector* Hadrons)500 {501 // `yo-yo` formation time502 static const G4double kappa = 1.0 * GeV/fermi;503 static const G4double dkappa = kappa+kappa;504 for(unsigned c1 = 0; c1 < Hadrons->size(); c1++)505 {506 G4double SumPz = 0;507 G4double SumE = 0;508 for(unsigned c2 = 0; c2 < c1; c2++)509 {510 G4LorentzVector hc2M=(*Hadrons)[c2]->Get4Momentum();511 SumPz += hc2M.pz();512 SumE += hc2M.e();513 }514 G4QHadron* hc1=(*Hadrons)[c1];515 G4LorentzVector hc1M=hc1->Get4Momentum();516 G4double HadronE = hc1M.e();517 G4double HadronPz= hc1M.pz();518 hc1->SetFormationTime((StringMass-SumPz-SumPz+HadronE-HadronPz)/dkappa);519 hc1->SetPosition(G4ThreeVector(0,0,(StringMass-SumE-SumE-HadronE+HadronPz)/dkappa));520 }521 } // End of CalculateHadronTimePosition522 523 821 void G4QString::SetLeftPartonStable() 524 822 { 525 526 527 823 theStableParton=GetLeftParton(); 824 theDecayParton=GetRightParton(); 825 decaying=Right; 528 826 } 529 827 530 828 void G4QString::SetRightPartonStable() 531 829 { 532 533 534 830 theStableParton=GetRightParton(); 831 theDecayParton=GetLeftParton(); 832 decaying=Left; 535 833 } 536 834 … … 547 845 } 548 846 549 G4ThreeVector G4QString::StablePt()550 {551 if (decaying == Left ) return Ptright;552 else if (decaying == Right ) return Ptleft;553 else554 {555 G4cerr<<"***G4QString::StablePt: wrong DecayDirection="<<decaying<<G4endl;556 G4Exception("G4QString::StablePt:","72",FatalException,"WrongDecayDirection");557 }558 return G4ThreeVector();559 }847 //G4ThreeVector G4QString::StablePt() 848 //{ 849 // if (decaying == Left ) return Ptright; 850 // else if (decaying == Right ) return Ptleft; 851 // else 852 // { 853 // G4cerr<<"***G4QString::StablePt: wrong DecayDirection="<<decaying<<G4endl; 854 // G4Exception("G4QString::StablePt:","72",FatalException,"WrongDecayDirection"); 855 // } 856 // return G4ThreeVector(); 857 //} 560 858 561 859 G4ThreeVector G4QString::DecayPt() … … 571 869 } 572 870 573 G4double G4QString::LightConeDecay()574 {575 if (decaying == Left ) return Pplus;576 else if (decaying == Right ) return Pminus;577 else578 {579 G4cerr<<"***G4QString::LightConeDecay: wrong DecayDirection="<<decaying<<G4endl;580 G4Exception("G4QString::LightConeDecay:","72",FatalException,"WrongDecayDirection");581 }582 return 0;583 }584 585 G4LorentzVector G4QString::GetFragmentation4Mom() const586 {587 G4LorentzVector momentum(Ptleft+Ptright,0.5*(Pplus+Pminus));588 momentum.setPz(0.5*(Pplus-Pminus));589 return momentum;590 }591 592 871 // Random choice of string end to use it for creating the hadron (decay) 593 872 G4QHadron* G4QString::Splitup(G4bool QL) 594 873 { 595 SideOfDecay = (G4UniformRand() < 0.5)? 1: -1; 874 SideOfDecay = (G4UniformRand() < 0.5) ? 1: -1; 875 #ifdef debug 876 G4cout<<"G4QString::Splitup:**Called**,s="<<SideOfDecay<<",s4M="<<Get4Momentum()<<G4endl; 877 #endif 596 878 if(SideOfDecay<0) SetLeftPartonStable(); // Decay Right parton 597 879 else SetRightPartonStable(); // Decay Left parton 598 880 G4QParton* newStringEnd; 599 881 G4QHadron* Hadron; 600 if(DecayIsQuark()) Hadron=QuarkSplitup(GetDecayParton(), newStringEnd); // MF1 601 else Hadron= DiQuarkSplitup(GetDecayParton(), newStringEnd); // MF2 602 // create new String from old, ie. keep Left and Right order, but replace decay 603 G4LorentzVector* HadronMomentum=SplitEandP(Hadron, QL); // MF3 604 if(HadronMomentum) 882 if(DecayIsQuark()) Hadron= QuarkSplitup(theDecayParton, newStringEnd); // Split Quark 883 else Hadron= DiQuarkSplitup(theDecayParton, newStringEnd); // Split DiQuark 884 #ifdef debug 885 G4cout<<"G4QString::Splitup: newStringEndPDG="<<newStringEnd->GetPDGCode()<<", nP=" 886 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 887 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 888 #endif 889 // create new String from the old one: keep Left and Right order, but replace decay 890 G4LorentzVector* HadronMomentum=SplitEandP(Hadron, QL);//The decayed parton isn't changed 891 #ifdef debug 892 G4cout<<"G4QString::Splitup: HM="<<HadronMomentum<<", nP=" 893 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 894 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 895 #endif 896 if(HadronMomentum) // The decay succeeded, now the new 4-mon can be set to NewStringEnd 605 897 { 606 G4ThreeVector Pos(0.,0.,0.); 898 #ifdef pdebug 899 G4cout<<">>>>>G4QString::Splitup: HFilled 4M="<<*HadronMomentum<<",PDG=" 900 <<Hadron->GetPDGCode()<<",s4M-h4M="<<Get4Momentum()-*HadronMomentum<<G4endl; 901 #endif 902 newStringEnd->Set4Momentum(theDecayParton->Get4Momentum()-*HadronMomentum); 607 903 Hadron->Set4Momentum(*HadronMomentum); 608 UpdateString(newStringEnd, HadronMomentum); 904 Hadron->SetPosition(GetPosition()); 905 if(decaying == Left) 906 { 907 G4QParton* theFirst = thePartons[0]; // Substitute for the First Parton 908 delete theFirst; // The OldParton instance is deleted 909 thePartons[0] = newStringEnd; // Delete equivalent for newStringEnd 910 #ifdef debug 911 G4cout<<"G4QString::Splitup: theFirstPDG="<<theFirst->GetPDGCode()<<G4endl; 912 #endif 913 Ptleft -= HadronMomentum->vect(); 914 Ptleft.setZ(0.); // @@ (Z is anyway ignored) M.K. (?) 915 } 916 else if (decaying == Right) 917 { 918 G4QParton* theLast = thePartons[thePartons.size()-1]; // Substitute for theLastParton 919 delete theLast; // The OldParton instance is deleted 920 thePartons[thePartons.size()-1] = newStringEnd; // Delete equivalent for newStringEnd 921 #ifdef debug 922 G4cout<<"G4QString::Splitup: theLastPDG="<<theLast->GetPDGCode()<<", nP=" 923 <<thePartons.size()<<", beg="<<thePartons[0]->GetPDGCode()<<",end=" 924 <<thePartons[thePartons.size()-1]->GetPDGCode()<<",P="<<theLast 925 <<"="<<thePartons[thePartons.size()-1]<<G4endl; 926 #endif 927 Ptright -= HadronMomentum->vect(); 928 Ptright.setZ(0.); // @@ (Z is anyway ignored) M.K. (?) 929 } 930 else 931 { 932 G4cerr<<"***G4QString::Splitup: wrong oldDecay="<<decaying<<G4endl; 933 G4Exception("G4QString::Splitup","72",FatalException,"WrongDecayDirection"); 934 } 935 Pplus -= HadronMomentum->e() + HadronMomentum->pz();// Reduce Pplus ofTheString (Left) 936 Pminus -= HadronMomentum->e() - HadronMomentum->pz();// Reduce Pminus ofTheString(Rite) 937 #ifdef debug 938 G4cout<<"G4QString::Splitup: P+="<<Pplus<<",P-="<<Pminus<<", nP=" 939 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 940 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 941 G4cout<<">...>G4QString::Splitup: NewString4M="<<Get4Momentum()<<G4endl; 942 #endif 609 943 delete HadronMomentum; 610 944 } 945 #ifdef debug 946 G4cout<<"G4QString::Splitup: ***Done*** H4M="<<Hadron->Get4Momentum()<<", nP=" 947 <<thePartons.size()<<", beg="<<(*thePartons.begin())->GetPDGCode() 948 <<",end="<<(*(thePartons.end()-1))->GetPDGCode()<<G4endl; 949 #endif 611 950 return Hadron; 612 951 } // End of Splitup 613 952 614 void G4QString::UpdateString(G4QParton* decay, const G4LorentzVector* mom)615 {616 decaying=None;617 if(decaying == Left)618 {619 G4QParton* theFirst = thePartons[0];620 delete theFirst;621 theFirst = decay;622 Ptleft -= mom->vect();623 Ptleft.setZ(0.);624 }625 else if (decaying == Right)626 {627 G4QParton* theLast = thePartons[thePartons.size()-1];628 delete theLast;629 theLast = decay;630 Ptright -= mom->vect();631 Ptright.setZ(0.);632 }633 else634 {635 G4cerr<<"***G4QString::UpdateString: wrong oldDecay="<<decaying<<G4endl;636 G4Exception("G4QString::UpdateString","72",FatalException,"WrongDecayDirection");637 }638 Pplus -= mom->e() + mom->pz();639 Pminus -= mom->e() - mom->pz();640 } // End of UpdateString641 642 953 // QL=true for QGSM and QL=false for Lund fragmentation 643 954 G4LorentzVector* G4QString::SplitEandP(G4QHadron* pHadron, G4bool QL) 644 955 { 645 956 G4double HadronMass = pHadron->GetMass(); 957 #ifdef debug 958 G4cout<<"G4QString::SplitEandP: ***Called*** HMass="<<HadronMass<<G4endl; 959 #endif 646 960 // calculate and assign hadron transverse momentum component HadronPx andHadronPy 647 G4ThreeVector HadronPt = SampleQuarkPt() + DecayPt(); 961 G4ThreeVector HadronPt = SampleQuarkPt() + DecayPt(); // @@ SampleQuarkPt & DecayPt once 648 962 HadronPt.setZ(0.); 649 963 //... sample z to define hadron longitudinal momentum and energy 650 964 //... but first check the available phase space 651 G4double DecayQuarkMass2 = sqr(GetDecayParton()->GetMass()); // Mass of quark? M.K.652 965 G4double HadronMass2T = HadronMass*HadronMass + HadronPt.mag2(); 653 if ( DecayQuarkMass2 +HadronMass2T >= SmoothParam*Mass2() ) return 0; // restart!966 if (HadronMass2T >= SmoothParam*Mass2() ) return 0; // restart! 654 967 //... then compute allowed z region z_min <= z <= z_max 655 968 G4double zMin = HadronMass2T/Mass2(); 656 G4double zMax = 1. - DecayQuarkMass2/Mass2(); 969 G4double zMax = 1.; 970 #ifdef debug 971 G4cout<<"G4QString::SplitEandP: zMin="<<zMin<<", zMax"<<zMax<<G4endl; 972 #endif 657 973 if (zMin >= zMax) return 0; // have to start all over! 658 974 G4double z=0; 659 if(QL) z = GetQGSMLightConeZ(zMin, zMax, GetDecayParton()->GetPDGCode(), pHadron,975 if(QL) z = GetQGSMLightConeZ(zMin, zMax, theDecayParton->GetPDGCode(), pHadron, 660 976 HadronPt.x(), HadronPt.y()); 661 else z = GetLundLightConeZ(zMin, zMax, GetDecayParton()->GetPDGCode(), pHadron,977 else z = GetLundLightConeZ(zMin, zMax, theDecayParton->GetPDGCode(), pHadron, 662 978 HadronPt.x(), HadronPt.y()); 663 979 //... now compute hadron longitudinal momentum and energy 664 980 // longitudinal hadron momentum component HadronPz 665 G4double zl= z*LightConeDecay(); 981 G4double zl= z; 982 if (decaying == Left ) zl*=Pplus; 983 else if (decaying == Right ) zl*=Pminus; 984 else // @@ Is that possible? 985 { 986 G4cerr<<"***G4QString::SplitEandP: wrong DecayDirection="<<decaying<<G4endl; 987 G4Exception("G4QString::SplitEandP:","72",FatalException,"WrongDecayDirection"); 988 } 666 989 G4double HadronE = (zl + HadronMass2T/zl)/2; 667 990 HadronPt.setZ( GetDecayDirection() * (zl - HadronE) ); 668 991 G4LorentzVector* a4Momentum= new G4LorentzVector(HadronPt,HadronE); 669 670 992 return a4Momentum; 671 993 } … … 678 1000 } 679 1001 680 void G4QString::Sample4Momentum(G4LorentzVector* Mom, G4double Mass, 681 G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass) 682 { 683 G4double m2 = Mass*Mass; 684 G4double am2= AntiMass*AntiMass; 685 G4double dub=InitialMass*InitialMass - m2 - am2; 686 G4double r_val = dub - 4*m2*am2; 687 G4double Pabs = (r_val > 0.) ? std::sqrt(r_val)/(InitialMass*InitialMass) : 0; 688 //... sample unit vector 689 G4double r = G4UniformRand(); // @@ G4RandomDirection() 690 G4double pz = 1. - r - r; // cos(theta) 691 G4double st = std::sqrt(1. - pz * pz) * Pabs; 692 G4double phi= twopi*G4UniformRand(); 693 G4double px = st*std::cos(phi); 694 G4double py = st*std::sin(phi); 695 pz *= Pabs; 696 G4double p2=Pabs*Pabs; 697 Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz); 698 Mom->setE(std::sqrt(p2 + Mass*Mass)); 699 AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz); 700 AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass)); 701 } // End of Sample4Momentum 702 703 G4bool G4QString::SplitLast(G4QString* string, G4QHadronVector* LeftVector, 704 G4QHadronVector* RightVector) 705 { 706 //... perform last cluster decay 707 G4ThreeVector ClusterVel =string->Get4Momentum().boostVector(); 708 G4double ResidualMass =string->Mass(); 709 G4double ClusterMassCut = ClusterMass; 710 G4int cClusterInterrupt = 0; 711 G4QHadron* LeftHadron; 712 G4QHadron* RightHadron; 713 do 714 { 715 if(cClusterInterrupt++ >= ClusterLoopInterrupt) return false; 716 G4QParton* quark = 0; 717 string->SetLeftPartonStable(); // to query quark contents.. 718 if(string->DecayIsQuark() && string->StableIsQuark()) // There're quarks on clusterEnds 719 LeftHadron= QuarkSplitup(string->GetLeftParton(), quark); 720 else 721 { 722 //... there is a Diquark on cluster ends 723 G4int IsParticle; 724 if(string->StableIsQuark())IsParticle=(string->GetLeftParton()->GetPDGCode()>0)?-1:1; 725 else IsParticle=(string->GetLeftParton()->GetPDGCode()>0)?1:-1; 726 G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted 727 quark = QuarkPair.GetParton2(); 728 LeftHadron=hadronizer->Build(QuarkPair.GetParton1(), string->GetLeftParton()); 729 } 730 RightHadron = hadronizer->Build(string->GetRightParton(), quark); 731 //... repeat procedure, if mass of cluster is too low to produce hadrons 732 //... ClusterMassCut = 0.15*GeV model parameter 733 if ( quark->GetParticleSubType()== "quark" ) ClusterMassCut = 0.; 734 else ClusterMassCut = ClusterMass; 735 } while(ResidualMass <= LeftHadron->GetMass() + RightHadron->GetMass() + ClusterMassCut); 736 //... compute hadron momenta and energies 737 G4LorentzVector LeftMom, RightMom; 738 G4ThreeVector Pos; 739 Sample4Momentum(&LeftMom,LeftHadron->GetMass(),&RightMom,RightHadron->GetMass(), 740 ResidualMass); 741 LeftMom.boost(ClusterVel); 742 RightMom.boost(ClusterVel); 743 LeftVector->push_back(new G4QHadron(LeftHadron, 0, Pos, LeftMom)); 744 RightVector->push_back(new G4QHadron(RightHadron, 0, Pos, RightMom)); 745 746 return true; 747 } // End of SplitLast 748 749 G4QHadron* G4QString::QuarkSplitup(G4QParton* decay, G4QParton *&created) 1002 G4QHadron* G4QString::QuarkSplitup(G4QParton* decay, G4QParton* &created)// VGComplTo decay 750 1003 { 751 1004 G4int IsParticle=(decay->GetPDGCode()>0) ? -1 : +1; // a quark needs antiquark or diquark 752 1005 G4QPartonPair QuarkPair = CreatePartonPair(IsParticle); 753 created = QuarkPair.GetParton2(); 754 return hadronizer->Build(QuarkPair.GetParton1(), decay); 1006 created = QuarkPair.GetParton2(); // New Parton after splitting 1007 #ifdef debug 1008 G4cout<<"G4QString::QuarkSplitup: ***Called*** crP="<<created->GetPDGCode()<<G4endl; 1009 #endif 1010 G4QParton* P1=QuarkPair.GetParton1(); 1011 G4QHadron* result=CreateHadron(P1, decay); // New Hadron after splitting 1012 delete P1; // Clean up the temporary parton 1013 return result; 755 1014 } // End of QuarkSplitup 756 1015 … … 770 1029 decayQuarkEncoding = Swap; 771 1030 } 772 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1; 773 // if we have a quark, we need antiquark) 1031 G4int IsParticle=(decayQuarkEncoding>0) ? -1 : +1;// Diquark is equivalent to antiquark 774 1032 G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted 775 //... Build new Diquark 776 G4int QuarkEncoding=QuarkPair.GetParton2()->GetPDGCode(); 1033 G4QParton* P2=QuarkPair.GetParton2(); 1034 G4int QuarkEncoding=P2->GetPDGCode(); 1035 delete P2; 777 1036 G4int i10 = std::max(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding)); 778 1037 G4int i20 = std::min(std::abs(QuarkEncoding), std::abs(stableQuarkEncoding)); 779 G4int spin = (i10 != i20 && G4UniformRand() <= 0.5) ? 1 : 3;1038 G4int spin = (i10 != i20 && G4UniformRand() <= 0.5) ? 1 : 3; 780 1039 G4int NewDecayEncoding = -1*IsParticle*(i10 * 1000 + i20 * 100 + spin); 781 created = CreateParton(NewDecayEncoding); 782 G4QParton* decayQuark=CreateParton(decayQuarkEncoding); 783 return hadronizer->Build(QuarkPair.GetParton1(), decayQuark); 1040 created = new G4QParton(NewDecayEncoding); 1041 #ifdef debug 1042 G4cout<<"G4QString::DiQuarkSplitup: inside, crP="<<created->GetPDGCode()<<G4endl; 1043 #endif 1044 G4QParton* decayQuark= new G4QParton(decayQuarkEncoding); 1045 G4QParton* P1=QuarkPair.GetParton1(); 1046 G4QHadron* newH=CreateHadron(P1, decayQuark); 1047 delete P1; 1048 delete decayQuark; 1049 return newH; 784 1050 } 785 1051 else … … 787 1053 //... Diquark does not break 788 1054 G4int IsParticle=(decay->GetPDGCode()>0) ? +1 : -1; 789 // if we have a diquark, we need quark)790 1055 G4QPartonPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted 791 1056 created = QuarkPair.GetParton2(); 792 return hadronizer->Build(QuarkPair.GetParton1(), decay); 1057 #ifdef debug 1058 G4cout<<"G4QString::DiQuarkSplitup: diQ not break, crP="<<created->GetPDGCode()<<G4endl; 1059 #endif 1060 G4QParton* P1=QuarkPair.GetParton1(); 1061 G4QHadron* newH=CreateHadron(P1, decay); 1062 delete P1; 1063 return newH; 793 1064 } 794 1065 } // End of DiQuarkSplitup … … 796 1067 G4QPartonPair G4QString::CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks) 797 1068 { 1069 #ifdef debug 1070 G4cout<<"G4QString::CreatePartonPair: ***Called***, P="<<NeedParticle<<", ALLOWdQ=" 1071 <<AllowDiquarks<<G4endl; 1072 #endif 798 1073 // NeedParticle = {+1 for Particle, -1 for AntiParticle} 799 1074 if(AllowDiquarks && G4UniformRand() < DiquarkSuppress) … … 802 1077 G4int q1 = SampleQuarkFlavor(); 803 1078 G4int q2 = SampleQuarkFlavor(); 804 G4int spin = (q1 != q2 && G4UniformRand() <= 0.5) ? 1 : 3;1079 G4int spin = (q1 != q2 && G4UniformRand() <= 0.5) ? 1 : 3; // @@ 0.5 M.K.? 805 1080 // Convention: quark with higher PDG number is first 806 1081 G4int PDGcode = (std::max(q1,q2) * 1000 + std::min(q1,q2) * 100 + spin) * NeedParticle; 807 return G4QPartonPair(CreateParton(-PDGcode),CreateParton(PDGcode)); 1082 #ifdef debug 1083 G4cout<<"G4QString::CreatePartonPair: Created dQ-AdQ, PDG="<<PDGcode<<G4endl; 1084 #endif 1085 return G4QPartonPair(new G4QParton(-PDGcode), new G4QParton(PDGcode)); 808 1086 } 809 1087 else 810 1088 { 811 // Create a Quark - AntiQuark pair, first in pair IsParticle1089 // Create a Quark - AntiQuark pair, first in pair is a Particle 812 1090 G4int PDGcode=SampleQuarkFlavor()*NeedParticle; 813 return G4QPartonPair(CreateParton(PDGcode),CreateParton(-PDGcode)); 1091 #ifdef debug 1092 G4cout<<"G4QString::CreatePartonPair: Created Q-aQ, PDG="<<PDGcode<<G4endl; 1093 #endif 1094 return G4QPartonPair(new G4QParton(PDGcode), new G4QParton(-PDGcode)); 814 1095 } 815 1096 } // End of CreatePartonPair 1097 1098 // Creation of the Meson out of two partons (q, anti-q) 1099 G4QHadron* G4QString::CreateMeson(G4QParton* black, G4QParton* white, Spin theSpin) 1100 { 1101 static G4double scalarMesonMixings[6]={0.5, 0.25, 0.5, 0.25, 1.0, 0.5}; 1102 static G4double vectorMesonMixings[6]={0.5, 0.0, 0.5, 0.0, 1.0, 1.0}; 1103 G4int id1= black->GetPDGCode(); 1104 G4int id2= white->GetPDGCode(); 1105 #ifdef debug 1106 G4cout<<"G4QString::CreateMeson: bT="<<black->GetType()<<"("<<id1<<"), wT=" 1107 <<white->GetType()<<"("<<id2<<")"<<G4endl; 1108 #endif 1109 if (std::abs(id1) < std::abs(id2)) // exchange black and white 1110 { 1111 G4int xchg = id1; 1112 id1 = id2; 1113 id2 = xchg; 1114 } 1115 if(std::abs(id1)>3) 1116 { 1117 G4cerr<<"***G4QString::CreateMeson: q1="<<id1<<", q2="<<id2 1118 <<" while CHIPS is only SU(3)"<<G4endl; 1119 G4Exception("G4QString::CreateMeson:","72",FatalException,"HeavyQuarkFound"); 1120 } 1121 G4int PDGEncoding=0; 1122 if(!(id1+id2)) // annihilation case (neutral) 1123 { 1124 G4double rmix = G4UniformRand(); 1125 G4int imix = 2*std::abs(id1) - 1; 1126 if(theSpin == SpinZero) 1127 PDGEncoding = 110*(1 + G4int(rmix + scalarMesonMixings[imix - 1]) 1128 + G4int(rmix + scalarMesonMixings[imix] ) ) + theSpin; 1129 else 1130 PDGEncoding = 110*(1 + G4int(rmix + vectorMesonMixings[imix - 1]) 1131 + G4int(rmix + vectorMesonMixings[imix] ) ) + theSpin; 1132 } 1133 else 1134 { 1135 PDGEncoding = 100 * std::abs(id1) + 10 * std::abs(id2) + theSpin; 1136 G4bool IsUp = (std::abs(id1)&1) == 0; // quark 1 is up type quark (u or c?) 1137 G4bool IsAnti = id1 < 0; // quark 1 is an antiquark? 1138 if( (IsUp && IsAnti) || (!IsUp && !IsAnti) ) PDGEncoding = - PDGEncoding; 1139 // Correction for the true neutral mesons 1140 if( PDGEncoding == -111 || PDGEncoding == -113 || PDGEncoding == -223 || 1141 PDGEncoding == -221 || PDGEncoding == -331 || PDGEncoding == -333 ) 1142 PDGEncoding = - PDGEncoding; 1143 } 1144 G4QHadron* Meson= new G4QHadron(PDGEncoding); 1145 #ifdef debug 1146 G4cout<<"G4QString::CreateBaryon: Meson is created with PDG="<<PDGEncoding<<G4endl; 1147 #endif 1148 //delete black; // It is better to delete here and consider 1149 //delete white; // the hadron creation as a delete equivalent 1150 return Meson; 1151 } 1152 1153 // Creation of the Baryon out of two partons (q, di-q), (anti-q, anti-di-q) 1154 G4QHadron* G4QString::CreateBaryon(G4QParton* black, G4QParton* white, Spin theSpin) 1155 { 1156 G4int id1= black->GetPDGCode(); 1157 G4int id2= white->GetPDGCode(); 1158 #ifdef debug 1159 G4cout<<"G4QString::CreateBaryon: bT="<<black->GetType()<<"("<<id1<<"), wT=" 1160 <<white->GetType()<<"("<<id2<<")"<<G4endl; 1161 #endif 1162 if(std::abs(id1) < std::abs(id2)) 1163 { 1164 G4int xchg = id1; 1165 id1 = id2; 1166 id2 = xchg; 1167 } 1168 if(std::abs(id1)<1000 || std::abs(id2)> 3) 1169 { 1170 G4cerr<<"***G4QString::CreateBaryon: q1="<<id1<<", q2="<<id2 1171 <<" can't create a Baryon"<<G4endl; 1172 G4Exception("G4QString::CreateBaryon:","72",FatalException,"WrongQdQSequence"); 1173 } 1174 G4int ifl1= std::abs(id1)/1000; 1175 G4int ifl2 = (std::abs(id1) - ifl1 * 1000)/100; 1176 G4int diquarkSpin = std::abs(id1)%10; 1177 G4int ifl3 = id2; 1178 if (id1 < 0) {ifl1 = - ifl1; ifl2 = - ifl2;} 1179 //... Construct baryon, distinguish Lambda and Sigma baryons. 1180 G4int kfla = std::abs(ifl1); 1181 G4int kflb = std::abs(ifl2); 1182 G4int kflc = std::abs(ifl3); 1183 G4int kfld = std::max(kfla,kflb); 1184 kfld = std::max(kfld,kflc); 1185 G4int kflf = std::min(kfla,kflb); 1186 kflf = std::min(kflf,kflc); 1187 G4int kfle = kfla + kflb + kflc - kfld - kflf; 1188 //... baryon with content uuu or ddd or sss has always spin = 3/2 1189 if(kfla==kflb && kflb==kflc) theSpin=SpinThreeHalf; 1190 1191 G4int kfll = 0; 1192 if(theSpin == SpinHalf && kfld > kfle && kfle > kflf) 1193 { 1194 // Spin J=1/2 and all three quarks different 1195 // Two states exist: (uds -> lambda or sigma0) 1196 // - lambda: s(ud)0 s : 3122; ie. reverse the two lighter quarks 1197 // - sigma0: s(ud)1 s : 3212 1198 if(diquarkSpin == 1 ) 1199 { 1200 if ( kfla == kfld) kfll = 1; // heaviest quark in diquark 1201 else kfll = G4int(0.25 + G4UniformRand()); 1202 } 1203 if(diquarkSpin==3 && kfla!=kfld) kfll = G4int(0.75+G4UniformRand()); 1204 } 1205 G4int PDGEncoding=0; 1206 if (kfll == 1) PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin; 1207 else PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin; 1208 if (id1 < 0) PDGEncoding = -PDGEncoding; 1209 G4QHadron* Baryon= new G4QHadron(PDGEncoding); 1210 #ifdef debug 1211 G4cout<<"G4QString::CreateBaryon: Baryon is created with PDG="<<PDGEncoding<<G4endl; 1212 #endif 1213 //delete black; // It is better to delete here and consider 1214 //delete white; // the hadron creation as a delete equivalent 1215 return Baryon; 1216 } // End of CreateBaryon 1217 1218 G4QHadron* G4QString::CreateHadron(G4QParton* black, G4QParton* white) 1219 { 1220 //static G4double mesonLowSpin = 0.25; // probability to create scalar meson (2s+1) 1221 //static G4double baryonLowSpin= 1./3.; // probability to create 1/2 baryon (2s+1) 1222 static G4double mesonLowSpin = 0.5; // probability to create scalar meson (spFlip) 1223 static G4double baryonLowSpin= 0.5; // probability to create 1/2 baryon (spinFlip) 1224 G4int bT=black->GetType(); 1225 G4int wT=white->GetType(); 1226 #ifdef debug 1227 G4cout<<"G4QString::CreateHadron: bT="<<bT<<"("<<black->GetPDGCode()<<"), wT="<<wT<<"(" 1228 <<white->GetPDGCode()<<")"<<G4endl; 1229 #endif 1230 if(bT==2 || wT==2) 1231 { 1232 // Baryon consists of quark and at least one di-quark 1233 Spin spin = (G4UniformRand() < baryonLowSpin) ? SpinHalf : SpinThreeHalf; 1234 #ifdef debug 1235 G4cout<<"G4QString::CreateHadron: ----> Baryon is under creation"<<G4endl; 1236 #endif 1237 return CreateBaryon(black, white, spin); 1238 } 1239 else 1240 { 1241 // Meson consists of quark and abnti-quark 1242 Spin spin = (G4UniformRand() < mesonLowSpin) ? SpinZero : SpinOne; 1243 #ifdef debug 1244 G4cout<<"G4QString::CreateHadron: ----> Meson is under creation"<<G4endl; 1245 #endif 1246 return CreateMeson(black, white, spin); 1247 } 1248 } // End of Create Hadron 1249 1250 // Creation of only High Spin (2,3/2) hadrons 1251 G4QHadron* G4QString::CreateLowSpinHadron(G4QParton* black, G4QParton* white) 1252 { 1253 G4int bT=black->GetType(); 1254 G4int wT=white->GetType(); 1255 #ifdef debug 1256 G4cout<<"G4QString::CreateLowSpinHadron: ***Called***, bT="<<bT<<"("<<black->GetPDGCode() 1257 <<"), wT="<<wT<<"("<<white->GetPDGCode()<<")"<<G4endl; 1258 #endif 1259 if(bT == 1 && wT == 1) 1260 { 1261 #ifdef debug 1262 G4cout<<"G4QString::CreateLowSpinHadron: ----> Meson is under creation"<<G4endl; 1263 #endif 1264 return CreateMeson(black, white, SpinZero); 1265 } 1266 else // returns a SpinThreeHalf Baryon if all quarks are the same 1267 { 1268 #ifdef debug 1269 G4cout<<"G4QString::CreateLowSpinHadron: ----> Baryon is under creation"<<G4endl; 1270 #endif 1271 return CreateBaryon(black, white, SpinHalf); 1272 } 1273 } // End of CreateLowSpinHadron 1274 1275 // Creation of only High Spin (2,3/2) hadrons 1276 G4QHadron* G4QString::CreateHighSpinHadron(G4QParton* black, G4QParton* white) 1277 { 1278 G4int bT=black->GetType(); 1279 G4int wT=white->GetType(); 1280 #ifdef debug 1281 G4cout<<"G4QString::CreateHighSpinHadron:***Called***, bT="<<bT<<"("<<black->GetPDGCode() 1282 <<"), wT="<<wT<<"("<<white->GetPDGCode()<<")"<<G4endl; 1283 #endif 1284 if(bT == 1 && wT == 1) 1285 { 1286 #ifdef debug 1287 G4cout<<"G4QString::CreateHighSpinHadron: ----> Meson is created"<<G4endl; 1288 #endif 1289 return CreateMeson(black,white, SpinOne); 1290 } 1291 else 1292 { 1293 #ifdef debug 1294 G4cout<<"G4QString::CreateHighSpinHadron: ----> Baryon is created"<<G4endl; 1295 #endif 1296 return CreateBaryon(black,white,SpinThreeHalf); 1297 } 1298 } // End of CreateHighSpinHadron -
trunk/source/processes/hadronic/models/chiral_inv_phase_space/body/src/G4Quasmon.cc
r1055 r1196 28 28 // 29 29 // 30 // $Id: G4Quasmon.cc,v 1.11 1 2009/05/27 08:53:15mkossov Exp $31 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $30 // $Id: G4Quasmon.cc,v 1.119 2009/11/16 18:15:01 mkossov Exp $ 31 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 32 32 // 33 33 // ---------------- G4Quasmon ---------------- … … 294 294 #ifdef debug 295 295 G4cout<<"G4Quasmon::HadrQ:*=>>>START QUASMON HADRONIZATION<<<=*, aP="<<addPhoton<<",Env=" 296 <<qEnv<<qEnv.GetProbability()<< G4endl;296 <<qEnv<<qEnv.GetProbability()<<", #ofQuasms="<<nQuasms<<G4endl; 297 297 #endif 298 298 G4bool first=false; … … 3689 3689 G4LorentzVector t = qH->Get4Momentum(); // 4-Mom of Chipolino 3690 3690 #ifdef psdebug 3691 if(thePDG==113 &&fabs(t.m()-770.)<.001)3691 if(thePDG==113 && fabs(t.m()-770.)<.001) 3692 3692 { 3693 3693 G4cerr<<"G4Q::FillHadronVector: PDG="<<thePDG<<",M="<<t.m()<<G4endl; … … 4628 4628 <<",pN="<<barot-charge<<", cPDG="<<cPDG<<G4endl; 4629 4629 #endif 4630 if(possib &&charge<=envZ&&barot-charge<=envN)4630 if(possib && charge<=envZ && barot-charge<=envN) 4631 4631 { 4632 G4QContent rQQC = valQ+ioQC; // Quark Content of Residual Quasmon4632 //G4QContent rQQC = valQ+ioQC; // Quark Content of Residual Quasmon 4633 4633 ///////////G4int rQU=rQQC.GetU()-rQQC.GetAU(); 4634 4634 ///////////G4int rQD=rQQC.GetD()-rQQC.GetAD(); … … 4721 4721 <<kCut<<",E="<<E<<">"<<nDelta<<",p="<<parPDG<<G4endl; 4722 4722 #endif 4723 if(resPDG &&minM>0.) // Kinematical analysis of hadronization4723 if(resPDG && minM>0.) // Kinematical analysis of hadronization 4724 4724 { 4725 4725 #ifdef pdebug … … 5094 5094 // noc - a#of o-quarks in the Parent Cluster 5095 5095 // pUD - suppression for NuclearClusters fare from Z=N Mirror 5096 G4QContent rQQC = valQ+ioQC;// Quark Content of Residual Quasmon 5097 G4int BarRQC=rQQC.GetBaryonNumber(); // Res Quasmon BaryonNumber 5098 G4int StrRQC=rQQC.GetStrangeness(); // Res Quasmon Strangeness 5099 if(BarRQC==2 && !StrRQC) // --> DiBaryon Correction 5100 { 5101 G4int ChgRQC=rQQC.GetCharge(); // Res Quasmon Charge 5102 if(ChgRQC==1) probab/=2; // Only one S 5103 else probab*=2; // One S + three P 5104 } 5096 5105 #ifdef pdebug 5097 5106 if(pPrint)G4cout<<"G4Q::CHP:prob="<<probab<<",qF="<<qFact<<",iq=" … … 5122 5131 #endif 5123 5132 pc++; 5124 } 5125 } 5133 } // >>>> End of the Minimum mass cut 5134 } // >>>> End of the isotope focusing 5126 5135 #ifdef sdebug 5127 5136 else G4cout<<"***G4Q::CHP:dI="<<dI<<",cC="<<cC<<G4endl; 5128 5137 #endif 5129 } 5138 } // >>>> End of tje final state possibility 5130 5139 } // >>>> End of if of QuarkExchangePossibility 5131 5140 } // +++> End of if of existinr residual Q Code … … 5183 5192 } 5184 5193 curQ -= candQC; // This is a quark content of residual quasmon 5185 resPDG = curQ.GetSPDGCode(); // PDG for the lowest residual hadronic state5194 resPDG = curQ.GetSPDGCode(); // PDG of theLowest residualQuas hadronicState 5186 5195 G4QContent resTQC = curQ+envQC; // Total nuclear Residual Quark Content 5187 5196 G4double resTM=G4QPDGCode(resTQC.GetSPDGCode()).GetMass(); 5188 5197 #ifdef pdebug 5189 G4bool priCon =aPDG<10000&&aPDG%10<3;5198 G4bool priCon = aPDG < 10000 && aPDG%10 < 3; 5190 5199 if(priCon) G4cout<<"G4Q::CHP:***>>cPDG="<<cPDG<<",cQC="<<candQC<<",comb="<<comb 5191 5200 <<",curQC="<<curQ<<",mQ="<<mQ<<",ab="<<absb<<G4endl; … … 5203 5212 if (comb && resPDG && totMass > frM-CB+resTM && 5204 5213 ((resPDG > 80000000 && resPDG != 90000000) || resPDG<10000) ) 5205 {5214 { 5206 5215 #ifdef pdebug 5207 5216 if(priCon) G4cout<<"G4Q::CHP:ind="<<index<<",qQC="<<valQ<<mQ<<",cPDG="<<cPDG … … 5279 5288 #endif 5280 5289 5281 if(qBar>1&&baryn>0) //---> High baryon number ("nuclear") case5282 {5283 G4QContent rtQC=curQ+envQC;// Total Residual Quark Content @@ ??5284 G4QNucleus rtN(rtQC);// Create pseudo-nucleus for residual5285 //////G4double rtM =rtN.GetMZNS();// MinMass of total residual Nucleus5286 /////////G4double bnRQ=rtM-envM;// Bound mass of residual Quasmon5287 }5288 else //---> Low baryon number case (tuned on p-ap)5289 {5290 //if(qBar > 1 && baryn > 0) //---> HighBaryonNumber ("nuclear") case 5291 //{ 5292 // //G4QContent rtQC=curQ+envQC; // Total Residual Quark Content @@ ?? 5293 // //G4QNucleus rtN(rtQC); // Create pseudo-nucleus for residual 5294 // /////G4double rtM =rtN.GetMZNS();// MinMass of total residual Nucleus 5295 // /////////G4double bnRQ=rtM-envM; // Bound mass of residual Quasmon 5296 //} 5297 //else //---> LowBaryonNumber case (tuned on p-ap) 5298 //{ 5290 5299 if(cPDG==110||cPDG==220||cPDG==330) probability*=comb; // f0 has spin 0 5291 5300 else probability*=comb*(abs(cPDG)%10); // Spin of resonance 5292 } 5301 G4int BarRQC=curQ.GetBaryonNumber(); // Res Quasmon BaryonNumber 5302 G4int StrRQC=curQ.GetStrangeness(); // Res Quasmon Strangeness 5303 if(BarRQC==2 && !StrRQC) // --> DiBaryon Correction 5304 { 5305 G4int ChgRQC=curQ.GetCharge(); // Res Quasmon Charge 5306 if(ChgRQC==1) probability/=2; // Only one S 5307 else probability*=2; // One S + three P 5308 } 5309 //} 5293 5310 } 5294 5311 } … … 5317 5334 <<"+rTM="<<resTM<<"-CB="<<CB<< G4endl; 5318 5335 #endif 5319 } 5336 } // ---> End of the possibility IF 5320 5337 //if(cPDG==111) secondProbab = 1.; 5321 } // ---> End of Hadronic Case of fragmentation5338 } // ---> End of Hadronic Case of fragmentation 5322 5339 else probability=0.; 5323 5340 #ifdef pdebug … … 5630 5647 { 5631 5648 G4cerr<<"---Warning---G4Q::DecayQHadr:n="<<nPart<<",ch#"<<i<<",PDG="<<thePDG<<G4endl; 5632 return false; 5649 theFragments->push_back(qH); // Fill as it is (del.equiv.) 5650 return theFragments; 5633 5651 } 5634 5652 #ifdef pdebug … … 5689 5707 delete fHadr; // Delete "new fHadr" 5690 5708 delete sHadr; // Delete "new sHadr" 5709 #ifdef pdebug 5691 5710 G4cerr<<"---Warning---G4Q::DecayQHadron:in2,PDGC="<<thePDG<<", ch#"<<i<<": 4M=" 5692 5711 <<qH->Get4Momentum()<<"("<<qH->GetMass()<<")->"<<f4Mom<<"+"<<s4Mom<<G4endl; 5693 5712 //throw G4QException("***Exception***G4Q::DecayQHadron: Failed to decay in 2"); 5713 #endif 5694 5714 theFragments->push_back(qH); // Fill as it is (del.equiv.) 5695 5715 return theFragments; … … 5810 5830 else // Randomize masses of all three Hadrons 5811 5831 { 5812 G4QParticle* sPart=theWorld->GetQParticle(cV[1]); //Pt for theSecondHadr5813 G4double smim = sPart->MinMassOfFragm(); // MinMassLim for theSecondHadron5832 G4QParticle* sPart=theWorld->GetQParticle(cV[1]); // Pt for theSecondHadr 5833 G4double smim = sPart->MinMassOfFragm(); // MinMassLim for SecondHadron 5814 5834 G4QParticle* tPart=theWorld->GetQParticle(cV[2]); // Pt for the Third Hadron 5815 G4double tmim = tPart->MinMassOfFragm(); 5816 G4double fdm = m - smim - tmim; 5835 G4double tmim = tPart->MinMassOfFragm(); // MinMassLimit for theThirdHd 5836 G4double fdm = m - smim - tmim; // MaxMassLimit for theFirstHd 5817 5837 G4QParticle* fPart=theWorld->GetQParticle(cV[0]); // Pt for the First Hadron 5818 fHadr = new G4QHadron(fPart,fdm); 5838 fHadr = new G4QHadron(fPart,fdm); // the First Hadron is created 5819 5839 if(fPDG<0) fHadr->MakeAntiHadron(); 5820 m-=fHadr->GetMass(); 5821 G4double sdm = m - tmim; 5822 sHadr = new G4QHadron(sPart,sdm); 5840 m-=fHadr->GetMass(); // Reduce the residual MaxMass 5841 G4double sdm = m - tmim; // MaxMassLimit for theSecondH 5842 sHadr = new G4QHadron(sPart,sdm); // theSecondHadron is created 5823 5843 if(sPDG<0) sHadr->MakeAntiHadron(); 5824 G4double tdm = m - sHadr->GetMass(); 5825 tHadr = new G4QHadron(tPart,tdm); 5844 G4double tdm = m - sHadr->GetMass(); // MaxMassLimit for theThird H 5845 tHadr = new G4QHadron(tPart,tdm); // the Third Hadron is created 5826 5846 if(tPDG<0) tHadr->MakeAntiHadron(); 5827 5847 } … … 5846 5866 G4cerr<<"---Warning---G4Q::DecayQHadron:in3,PDGC="<<thePDG<<", ch#"<<i<<G4endl; 5847 5867 theFragments->push_back(qH); // Fill as it is (delete equivalent) 5848 return false;5868 return theFragments; 5849 5869 } 5850 5870 else … … 6006 6026 return theFragments; 6007 6027 } // End of "Fragment" 6028 6029 // Boost Quasmon 4-momentum, using Boost Lorentz vector 6030 void G4Quasmon::Boost(const G4LorentzVector& boost4M) 6031 { 6032 // see CERNLIB short writeup U101 for the algorithm 6033 G4double bm=boost4M.mag(); 6034 G4double factor = (q4Mom.vect()*boost4M.vect()/(boost4M.e()+bm) - q4Mom.e())/bm; 6035 q4Mom.setE(q4Mom.dot(boost4M)/bm); 6036 q4Mom.setVect(factor*boost4M.vect() + q4Mom.vect()); 6037 } // End of Boost
Note: See TracChangeset
for help on using the changeset viewer.