57 nD(d),nU(u),nS(s_value),nAD(ad),nAU(au),nAS(as)
88 ed <<
"Wrong parton pair: zero parton P1=" << P1 <<
", P2=" << P2 <<
G4endl;
92 G4cout<<
"G4QContent::PairConstr: P1="<<P1<<
", P2="<<P2<<
G4endl;
96 if (P1 > 7) A1= P1/100;
97 else if(P1 <-7) A1=(-P1)/100;
98 else if(P1 < 0) A1= -P1;
118 else if(P11==2) ++nU;
119 else if(P11==3) ++nS;
122 else if(P12==2) ++nU;
123 else if(P12==3) ++nS;
132 else if(A1==2) ++nAU;
133 else if(A1==3) ++nAS;
139 else if(P11==2) ++nAU;
140 else if(P11==3) ++nAS;
143 else if(P12==2) ++nAU;
144 else if(P12==3) ++nAS;
149 G4cout<<
"G4QContent::PCo:1:"<<nD<<
","<<nU<<
","<<nS<<
","<<nAD<<
","<<nAU<<
","<<nAS<<
G4endl;
152 if (P2 > 7) A2= P2/100;
153 else if(P2 <-7) A2=(-P2)/100;
154 else if(P2 < 0) A2= -P2;
174 else if(P21==2) ++nU;
175 else if(P21==3) ++nS;
178 else if(P22==2) ++nU;
179 else if(P22==3) ++nS;
188 else if(A2==2) ++nAU;
189 else if(A2==3) ++nAS;
195 else if(P21==2) ++nAU;
196 else if(P21==3) ++nAS;
199 else if(P22==2) ++nAU;
200 else if(P22==3) ++nAS;
209 ed <<
"Impossible parton pair, P1=" << P1 <<
",P2=" << P2 <<
G4endl;
213 G4cout<<
"G4QContent::PCo:2:"<<nD<<
","<<nU<<
","<<nS<<
","<<nAD<<
","<<nAU<<
","<<nAS<<
G4endl;
255 lhs <<
"{" << rhs.
GetD() <<
"," << rhs.
GetU() <<
"," << rhs.
GetS() <<
","
263 lhs <<
"{" << rhs.
GetD() <<
"," << rhs.
GetU() <<
"," << rhs.
GetS() <<
","
284 if(nU<rU||nAU<rAU||nD<rD||nAD<rAD)
334 G4cout<<
"G4QC::-=:comp: "<<rD<<
","<<rU<<
","<<rS<<
","<<rAD<<
","<<rAU<<
","<<rAS<<
G4endl;
336 if(rS==1 && rAS==1 && (nS<1 || nAS<1))
403 G4int rAQ=rAD+rAU+rAS;
405 G4int nAQ=nAD+nAU+nAS;
455 if(rS==1 && rAS==1 && (nS<1 || nAS<1))
513 return s_value += rhs;
520 return s_value -= rhs;
527 return s_value *= rhs;
534 return s_value *= lhs;
544 G4cout<<
"G4QC::SubtractPi0: U="<<nU<<
", AU="<<nAU<<
", D="<<nD<<
", AD="<<nAD<<
G4endl;
548 if(ab){
if(tot<3*ab+2)
return false;}
549 else if(tot<4)
return false;
557 else if(nD>0 && nAD>0)
570 G4cout<<
"G4QC::SubtractPion: U="<<nU<<
", AU="<<nAU<<
", D="<<nD<<
", AD="<<nAD<<
G4endl;
574 if(ab){
if(tot<3*ab+2)
return false;}
575 else if(tot<4)
return false;
577 if((nU>nAU || (ab && nU>0))&& nAD>0)
583 else if((nAU>nU || (ab && nAU>0)) && nD>0)
596 G4cout<<
"G4QC::SubtractHadron "<<h<<
" is called for QC="<<GetThis()<<
G4endl;
607 G4cout<<
"G4QC::SubtractKaon is called: QC="<<GetThis()<<
G4endl;
609 if(mQ<640.)
return false;
612 if(ab){
if(tot<3*ab+2)
return false;}
613 else if(tot<4)
return false;
615 if((nS>nAS || (ab && nS>0)) && (nAD>0 || nAU>0))
622 else if((nAS>nS || (ab && nAS>0)) && (nD>0 || nU>0))
630 G4cout<<
"G4QCont::SubtractKaon Can't SubtractKaon: QC="<<GetThis()<<
G4endl;
640 else if (nD>0&&nAD>0) Pi=
G4QContent(1,0,0,1,0,0);
641 else if (nD>=nU&&nAU>=nAD) Pi=
G4QContent(1,0,0,0,1,0);
644 if(!b && mQ<545.&&nS>0&&nAS>0)
658 if((tot!=4||q!=2) && (tot!=5||(q!=1&&aq!=1)) && (tot!=6||abs(b)!=2))
661 G4cerr<<
"***G4QCont::SplitChipo: QC="<<GetThis()<<
G4endl;
673 G4cerr<<
"***G4QCont::SplitChipo:MesTot="<<tot<<
",b="<<b<<
",q="<<q<<
",a="<<aq<<
G4endl;
677 else if(b==1&&tot==5)
748 G4cerr<<
"***G4QCont::SplitChipo: Baryonic tot=5,b=1,qCont="<<GetThis()<<
G4endl;
775 G4cerr<<
"***G4QCont::SplitChipo:Dibar (1) tot=6, b=2, qCont="<<GetThis()<<
G4endl;
779 else if(nD>=nU&&nD>=nS)
789 G4cerr<<
"***G4QContent::SplitChipo:Dib(2) tot=6, b=2, qCont="<<GetThis()<<
G4endl;
803 G4cerr<<
"***G4QContent::SplitChipo:Dib(3) tot=6, b=2, qCont="<<GetThis()<<
G4endl;
818 if (nAU>=nAD&&nAU>=nAS)
828 G4cerr<<
"***G4QContent::SplitChipo:ADib(1) tot=6,b=2, qCont="<<GetThis()<<
G4endl;
832 else if(nAD>=nAU&&nAD>=nAS)
842 G4cerr<<
"***G4QContent::SplitChipo:ADib(2) tot=6,b=2, qCont="<<GetThis()<<
G4endl;
856 G4cerr<<
"***G4QContent::SplitChipo:ADib(3) tot=6,b=2, qCont="<<GetThis()<<
G4endl;
865 G4cerr<<
"*G4QContent::SplitChipolino:UnknownHadron with QuarkCont="<<GetThis()<<
G4endl;
878 else if(index<nD+nU)
return G4QContent(0,1,0,0,0,0);
879 else if(index<nD+nU+nS)
return G4QContent(0,0,1,0,0,0);
881 else G4cerr<<
"***G4QC::IndQ:index="<<index<<
" for the QuarkContent="<<GetThis()<<
G4endl;
894 else if(index<nAD+nAU)
return G4QContent(0,0,0,0,1,0);
895 else if(index<nAD+nAU+nAS)
return G4QContent(0,0,0,0,0,1);
897 else G4cerr<<
"***G4QC::IndAQ:index="<<index<<
" for the QuarkContent="<<GetThis()<<
G4endl;
907 G4cout<<
"G4QCont::DecQC: n="<<nQAQ<<
","<<GetThis()<<
G4endl;
911 if (tot==ban*3)
return 0;
913 if (nU>=nAU) nUP=nAU;
917 if (nD>=nAD) nDP=nAD;
921 if (nS>=nAS) nSP=nAS;
927 G4int nRet =nTotP-nQAQ;
932 G4cout<<
"G4QC::DecQC: tot="<<tot<<
", nTP="<<nTotP<<
", res="<<res<<
G4endl;
940 if(res<0) nReal=nTotP+res/2;
949 else if(nRet<0) nReal=nTotP;
951 if (!nReal)
return nRet;
954 G4cout<<
"G4QC::DecQC: demanded "<<nQAQ<<
" pairs, executed "<<nReal<<
" pairs"<<
G4endl;
956 for (
G4int i=0; i<nReal; i++)
962 if (nUP && j<nUP && (nRet>2 || nUP>1 || (nD<2 && nS<2)))
965 G4cout<<
"G4QC::DecQC: decrementing UAU pair UP="<<nUP<<
", QC="<<GetThis()<<
G4endl;
973 else if (nDP && j<nLP && (nRet>2 || nDP>1 || (nU<2 && nS<2)))
976 G4cout<<
"G4QC::DecQC: decrementing DAD pair DP="<<nDP<<
", QC="<<GetThis()<<
G4endl;
984 else if (nSP&& (nRet>2 || nSP>1 || (nU<2 && nD<2)))
987 G4cout<<
"G4QC::DecQC: decrementing SAS pair SP="<<nSP<<
", QC="<<GetThis()<<
G4endl;
997 G4cout<<
"G4QC::DecQC:Decrement UAU pair (final) UP="<<nUP<<
",QC="<<GetThis()<<
G4endl;
1008 G4cout<<
"G4QC::DecQC:Decrement DAD pair (final) DP="<<nDP<<
",QC="<<GetThis()<<
G4endl;
1019 G4cout<<
"G4QC::DecQC: decrementing SAS pair SP="<<nSP<<
", QC="<<GetThis()<<
G4endl;
1026 else G4cout<<
"***G4QC::DecQC:i="<<i<<
",j="<<j<<
",D="<<nDP<<
",U="<<nUP<<
",S="<<nSP
1027 <<
",T="<<nTotP<<
",nRet="<<nRet<<
", QC="<<GetThis()<<
G4endl;
1030 G4cout<<
"G4QC::DecQC: >->-> OUT <-<-< nRet="<<nRet<<
", QC="<<GetThis()<<
G4endl;
1040 for (
int i=0; i<nQAQ; i++)
1044 G4cout<<
"IncQC:out QC="<<GetThis()<<
",j="<<j<<
" for i="<<i<<
G4endl;
1047 if ( !j && (nU<=nD || nU<=nS))
1054 else if (j==1 && (nD<=nU || nD<=nS))
1061 else if (j>1&& (nS<=nU || nS<=nD))
1108 return (b3-3*(rS+dQ))/6;
1119 return (b3-3*(rS-dQ))/6;
1137 return (b3-3*(rS+dQ))/6;
1148 return (b3-3*(rS-dQ))/6;
1161 static const G4int cU = 2;
1162 static const G4int cD =-1;
1163 static const G4int cS =-1;
1164 static const G4int cAU =-2;
1165 static const G4int cAD = 1;
1166 static const G4int cAS = 1;
1176 if(c%3)
G4cerr<<
"***G4QCont:GetCharge:c="<<c<<
"/3 isn't integer, QC="<<GetThis()<<
G4endl;
1185 G4cout<<
"G4QContent::GetBarNum: U="<<nU<<
", D="<<nD<<
", S="<<nS<<
", AU="<<nAU<<
", AD="
1186 <<nAD<<
", AS="<<nAS<<
G4endl;
1188 G4int b=nU+nD+nS-nAU-nAD-nAS;
1195 ed <<
"Wrong Baryon Number: warning " << b <<
"/3 isn't an integer"
1216 if ( nU>nAU && nAU>0)
1226 if ( nD>nAD && nAD>0)
1236 if ( nS>nAS && nAS>0)
1247 if (nAD==nD && nD>0)
1263 G4cout<<
"***G4QC::SPDG:CanD U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1268 if (nAU==nU && nU>0)
1284 G4cout<<
"***G4QC::SPDG:CanU U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1289 if (nAS==nS && nS>0)
1305 G4cout<<
"***G4QC::SPDG:CanS U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1315 G4cout<<
"G4QC::SPDGC:bef. b="<<b<<
",n="<<n<<
",c="<<c<<
",s="<<s_value<<
",Q="<<GetThis()<<
G4endl;
1323 G4int mI=nU-nAU-nD+nAD;
1326 if ( (b > 0 && s_value < -1) || (b < 0 && s_value > 1) )
return 10;
1327 else if (abs(mI) > 2 || mS > 2
1328 || (b > 0 && s_value < 0)
1330 else if(mU>=mS&&mD>=mS&&mU+mD+mS==3*b)
1332 G4int mZ=(mU+mD-mS-mS+3*mI)/6;
1333 p = 90000000+1000*(1000*mS+mZ)+mZ-mI;
1348 if (mU==1 && mD==0) p+=320;
1349 else if (mU==0 && mD==1) p+=310;
1353 G4cout<<
"**G4QC::SPDG:ExoticBSS,U="<<mU<<
",D="<<mD<<
",S="<<mS<<GetThis()<<
G4endl;
1360 if (mU==2 && mD==0) p+=220;
1361 else if (mU==1 && mD==1) p+=120;
1362 else if (mU==0 && mD==2) p+=110;
1366 G4cout<<
"***G4QC::SPDG:ExoticBS,U="<<mU<<
",D="<<mD<<
",S="<<mS<<GetThis()<<
G4endl;
1374 G4cout<<
"***G4QC::GetSPDG:ExoBarS,U="<<mU<<
",D="<<mD<<
",S="<<mS<<GetThis()<<
G4endl;
1382 if (mU==3 && mD==0) p+=222;
1383 else if (mU==2 && mD==1) p+=210;
1384 else if (mU==1 && mD==2) p+=110;
1388 G4cout<<
"***G4QC::SPDG:ExoBaryonU,U="<<mU<<
",D="<<mD<<
",S="<<mS<<GetThis()<<
G4endl;
1393 else if (mD==3) p=1114;
1397 G4cout<<
"**G4QC::SPDG:ExoticBaryonD,U="<<mU<<
",D="<<mD<<
",S="<<mS<<GetThis()<<
G4endl;
1406 G4cout<<
"G4QC::SPDG:mDUS="<<mD<<
","<<mU<<
","<<mS<<
",b,c,s="<<b<<
","<<c<<
","<<s_value<<
G4endl;
1411 G4cout<<
"G4QC::SPDG:n>4 SEx:U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1419 G4cout<<
"**G4QC::SPDG:Stran="<<s_value<<
",QC="<<GetThis()<<
" - Superstrange Meson"<<
G4endl;
1433 else if (mU==1 && mD==0) p+=20;
1434 else if (mU==0 && mD==1) p+=10;
1438 G4cout<<
"*G4QC::SPDG:ExMS U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1447 if (mU==2 && mD==0) p=111;
1448 else if (mU==1 && mD==1) p+=10;
1452 G4cout<<
"*G4QC::SPDG:ExMU U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1457 else if (mD==2) p=111;
1461 G4cout<<
"***G4QC::SPDG:ExMD U="<<mU<<
",D="<<mD<<
",S="<<mS<<
",QC="<<GetThis()<<
G4endl;
1465 if (c<0 || (c==0 && mS>0 && s_value>0)) p=-
p;
1468 G4cout<<
"G4QC::GetSPDG:output SPDGcode="<<p<<
" for the QuarkContent="<<GetThis()<<
G4endl;
1478 G4cout<<
"G4QContent::NOfComb: This="<<GetThis()<<
", selectQC="<<rhs<<
G4endl;
1486 G4int mN=mD+mU+mS-mAD-mAU-mAS;
1488 if (( ((nD < mD || nAD < mAD) && !(mD-mAD)) ||
1489 ((nU < mU || nAU < mAU) && !(mU-mAU)) ||
1490 ((nS < mS || nAS < mAS) && !(mS-mAS)) ) && !mN)
return 1;
1495 if(mD>1||j>1)
for (
int i=1; i<=mD; i++)
1506 if(mU>1||j>1)
for (
int i=1; i<=mU; i++)
1517 if(mS>1||j>1)
for (
int i=1; i<=mS; i++)
1528 if(mAD>1||j>1)
for (
int i=1; i<=mAD; i++)
1539 if(mAU>1||j>1)
for (
int i=1; i<=mAU; i++)
1550 if(mAS>1||j>1)
for (
int i=1; i<=mAS; i++)
1578 return std::make_pair(f,-f);
1592 if (nD)
return std::make_pair(1,f);
1593 else if(nU)
return std::make_pair(2,f);
1594 else return std::make_pair(3,f);
1607 if (AS==2)
return std::make_pair(-3303,f);
1608 else if(AU)
return std::make_pair(-3201,f);
1609 else return std::make_pair(-3101,f);
1613 if (AU==2)
return std::make_pair(-2203,f);
1614 else return std::make_pair(-2101,f);
1616 else return std::make_pair(-1103,f);
1621 if(nAD || nAU || nAS)
1623 if (nAD)
return std::make_pair(f,-1);
1624 else if(nAU)
return std::make_pair(f,-2);
1625 else return std::make_pair(f,-3);
1638 if (AS==2)
return std::make_pair(f,3303);
1639 else if(AU)
return std::make_pair(f,3201);
1640 else return std::make_pair(f,3101);
1643 if (AU==2)
return std::make_pair(f,2203);
1644 else return std::make_pair(f,2101);
1646 else return std::make_pair(f,1103);
1658 G4cout<<
"G4QContent::AddParton: This="<<GetThis()<<
", pPDG="<<pPDG<<
G4endl;
1660 if(!pPDG || pPDG==9 || pPDG==21)
1663 G4cout<<
"-Warning-G4QContent::AddParton: ImpossibleToAdd PartonWithPDG="<<pPDG<<
G4endl;
1667 G4int aPDG = std::abs(pPDG);
1668 if( (aPDG>3 && aPDG<1101) || pPDG>3303)
1671 G4cout<<
"-Warning-G4QContent::AddParton: Impossible Parton with PDG="<<pPDG<<
G4endl;
1676 if( HBN > 1 || HBN <-1)
1679 G4cout<<
"-Warning-G4QContent::AddParton: Impossible Hadron with BaryonN="<<HBN<<
G4endl;
1691 G4int rPDG=aPDG/100;
1695 G4cout<<
"G4QContent::AddParton: DiQuark/AntiDiQuark, P1="<<P1<<
", P2="<<P2<<
G4endl;
1700 G4cout<<
"G4QContent::AddParton: DiQuark, P1="<<P1<<
", P2="<<P2<<
",HBN="<<HBN<<
G4endl;
1704 if(HBN<0 && AS>1) AS-=2;
1705 else if(!HBN && AS==1)
1710 else if(HBN || (!HBN && !AS))
return 0;
1712 else if(P1==3 && P2==2)
1714 if(HBN<0 && AS && AU)
1719 else if(!HBN && (AS || AU))
1732 else if(HBN || (!HBN && !AS && !AU))
return 0;
1734 else if(P1==3 && P2==1)
1736 if(HBN<0 && AS && AD)
1741 else if(!HBN && (AS || AD))
1754 else if(HBN || (!HBN && !AS && !AD))
return 0;
1756 else if(P1==2 && P2==2)
1758 if(HBN<0 && AU>1) AU-=2;
1759 else if(!HBN && AU==1)
1764 else if(HBN || (!HBN && !AU))
return 0;
1766 else if(P1==2 && P2==1)
1768 if(HBN<0 && AD && AU)
1773 else if(!HBN && (AD || AU))
1786 else if(HBN || (!HBN && !AU && !AD))
return 0;
1790 if(HBN<0 && AD>1) AD-=2;
1791 else if(!HBN && AD==1)
1796 else if(HBN || (!HBN && !AD))
return 0;
1799 G4cout<<
"G4QContent::AddParton: DQ, QC="<<QD<<
","<<QU<<
","<<QS<<
","<<AD<<
","<<AU<<
","
1805 else if(AU)
return -2;
1812 if (QS==2)
return 3303;
1813 else if(QU)
return 3201;
1818 if (QU==2)
return 2203;
1827 G4cout<<
"G4QContent::AddParton: AntiDiQuark,P1="<<P1<<
",P2="<<P2<<
",B="<<HBN<<
G4endl;
1831 if(HBN>0 && QS>1) QS-=2;
1832 else if(!HBN && QS==1)
1837 else if(HBN || (!HBN && !QS))
return 0;
1839 else if(P1==3 && P2==2)
1841 if(HBN>0 && QS && QU)
1846 else if(!HBN && (QS || QU))
1859 else if(HBN || (!HBN && !QS && !QU))
return 0;
1861 else if(P1==3 && P2==1)
1863 if(HBN>0 && QS && QD)
1868 else if(!HBN && (QS || QD))
1881 else if(HBN || (!HBN && !QS && !QD))
return 0;
1883 else if(P1==2 && P2==2)
1885 if(HBN>0 && QU>1) QU-=2;
1886 else if(!HBN && QU==1)
1891 else if(HBN || (!HBN && !QU))
return 0;
1893 else if(P1==2 && P2==1)
1895 if(HBN>0 && QU && QD)
1900 else if(!HBN && (QU || QD))
1913 else if(HBN || (!HBN && !QU && !QD))
return 0;
1917 if(HBN>0 && QD>1) QD-=2;
1918 else if(!HBN && QD==1)
1923 else if(HBN || (!HBN && !QD))
return 0;
1926 G4cout<<
"G4QContent::AddParton:ADQ, QC="<<QD<<
","<<QU<<
","<<QS<<
","<<AD<<
","<<AU<<
","
1932 else if(QU)
return 2;
1939 if (AS==2)
return -3303;
1940 else if(AU)
return -3201;
1945 if (AU==2)
return -2203;
1957 G4cout<<
"G4QContent::AddParton: Quark, A="<<AD<<
","<<AU<<
","<<AS<<
",B="<<HBN<<
G4endl;
1961 if(HBN<0 && AD) AD--;
1962 else if(HBN || (!HBN && !AD))
return 0;
1966 if(HBN<0 && AU) AU--;
1967 else if(HBN || (!HBN && !AU))
return 0;
1971 if(HBN<0 && AS) AS--;
1972 else if(HBN || (!HBN && !AS))
return 0;
1975 G4cout<<
"G4QContent::AddParton: Q, QC="<<QD<<
","<<QU<<
","<<QS<<
","<<AD<<
","<<AU<<
","
1981 else if(QU)
return 2;
1988 if (AS==2)
return -3303;
1989 else if(AU)
return -3201;
1994 if (AU==2)
return -2203;
2003 G4cout<<
"G4QContent::AddParton: antiQ, Q="<<QD<<
","<<QU<<
","<<QS<<
",B="<<HBN<<
G4endl;
2007 if(HBN>0 && QD) QD--;
2008 else if(HBN || (!HBN && !QD))
return 0;
2012 if(HBN>0 && QU) QU--;
2013 else if(HBN || (!HBN && !QU))
return 0;
2017 if(HBN>0 && QS) QS--;
2018 else if(HBN || (!HBN && !QS))
return 0;
2021 G4cout<<
"G4QContent::AddParton: AQ, QC="<<QD<<
","<<QU<<
","<<QS<<
","<<AD<<
","<<AU<<
","
2027 else if(AU)
return -2;
2034 if (QS==2)
return 3303;
2035 else if(QU)
return 3201;
2040 if (QU==2)
return 2203;