1538{
1540
1541 const G4double aHugeValue = 1.0e+10;
1542
1543 #ifdef debugQGSParticipants
1546 #endif
1547
1549
1552
1553 G4double VqM_pr(0.), VaqM_pr(0.), VqM_tr(350.), VqqM_tr(700);
1555
1556 #ifdef debugQGSParticipants
1558 <<
"Target nucleon momenta at start"<<
G4endl;
1560 #endif
1561
1562 std::vector<G4VSplitableHadron*>::iterator i;
1563
1565 {
1566 Psum += (*i)->Get4Momentum();
1567 #ifdef debugQGSParticipants
1568 G4cout<<
"Nusleus nucleon # and its 4Mom. "<<NuclNo<<
" "<<(*i)->Get4Momentum()<<
G4endl;
1569 NuclNo++;
1570 #endif
1571 }
1572
1574
1576
1580 Projectile4Momentum.transform( toCms );
1581
1582
1583 #ifdef debugQGSParticipants
1585 G4cout<<
"Projectile 4 Mom "<<Projectile4Momentum<<
G4endl;
1586 NuclNo=0;
1587 #endif
1588
1591 {
1593 (*i)->Set4Momentum( tmp );
1594 #ifdef debugQGSParticipants
1595 G4cout<<
"Target nucleon # and 4Mom "<<
" "<<NuclNo<<
" "<<(*i)->Get4Momentum()<<
G4endl;
1596 NuclNo++;
1597 #endif
1598 Target4Momentum += tmp;
1599 }
1600
1603
1604 #ifdef debugQGSParticipants
1606 G4cout<<
"Target nucleons mom: px, py, z_1, m_i"<<
G4endl;
1607 NuclNo=0;
1608 #endif
1609
1610
1611 G4double PminusTarget = Target4Momentum.minus();
1612
1614 {
1616
1617
1618
1619
1620
1621
1622
1623
1626 if ( Mass2 < 0.0 ) {
1629 <<
"Â 4-momentum " << Psum <<
G4endl;
1630 ed <<
"LorentzVector tmp " << tmp <<
" with Mass2 " << Mass2 <<
G4endl;
1631 G4Exception(
"G4QGSParticipants::DeterminePartonMomenta(): 4-momentum with negative mass!",
1633 } else {
1634 Mass = std::sqrt( Mass2 );
1635 }
1636
1638 (*i)->Set4Momentum(tmp);
1639 #ifdef debugQGSParticipants
1640 G4cout<<
"Target nucleons # and mom: "<<NuclNo<<
" "<<(*i)->Get4Momentum()<<
G4endl;
1641 NuclNo++;
1642 #endif
1643 }
1644
1645
1646
1651
1653 G4double ProjSumMt(0.), ProjSumMt2perX(0.);
1654 G4double TargSumMt(0.), TargSumMt2perX(0.);
1655
1656
1658
1666
1668
1670 const G4int maxNumberOfAttempts = 1000;
1671 do
1672 {
1673 attempt++; if( attempt == 100*(attempt/100) ) {SigPt/=2.;}
1674
1675 ProjSumMt=0.; ProjSumMt2perX=0.;
1676 TargSumMt=0.; TargSumMt2perX=0.;
1677
1678 Success = true;
1680 #ifdef debugQGSParticipants
1681 G4cout<<
"attempt ------------------------ "<<attempt<<
G4endl;
1683 #endif
1684
1688 G4int NumberOfUnsampledSeaQuarks = 2*nSeaPair;
1689
1691 for (
G4int aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++)
1692 {
1694 #ifdef debugQGSParticipants
1695 G4cout<<
"Sea quarks: "<<aSeaPair<<
" "<<aParton->GetDefinition()->GetParticleName();
1696 #endif
1697 aPtVector = GaussianPt(SigPt, aHugeValue);
1698 tmp.
setPx(aPtVector.x()); tmp.
setPy(aPtVector.y());
1699 SumPx += aPtVector.x(); SumPy += aPtVector.y();
1700 Mt = std::sqrt(aPtVector.mag2()+
sqr(Qmass));
1701 ProjSumMt += Mt;
1702
1703
1704 tmp.
setPz(
SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta)*(1.0-SumZ));
1706
1707 NumberOfUnsampledSeaQuarks--;
1708 ProjSumMt2perX +=
sqr(Mt)/tmp.
pz();
1710 aParton->Set4Momentum(tmp);
1711
1713 #ifdef debugQGSParticipants
1714 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1716 #endif
1717 aPtVector = GaussianPt(SigPt, aHugeValue);
1718 tmp.
setPx(aPtVector.x()); tmp.
setPy(aPtVector.y());
1719 SumPx += aPtVector.x(); SumPy += aPtVector.y();
1720 Mt = std::sqrt(aPtVector.mag2()+
sqr(Qmass));
1721 ProjSumMt += Mt;
1722
1723
1724 tmp.
setPz(
SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta)*(1.0-SumZ));
1726
1727 NumberOfUnsampledSeaQuarks--;
1728 ProjSumMt2perX +=
sqr(Mt)/tmp.
pz();
1730 aParton->Set4Momentum(tmp);
1731 #ifdef debugQGSParticipants
1733 #endif
1734 }
1735
1736
1738 #ifdef debugQGSParticipants
1739 G4cout<<
"Val quark of Pr"<<
" "<<aParton->GetDefinition()->GetParticleName();
1740 #endif
1741 aPtVector = GaussianPt(SigPt, aHugeValue);
1742 tmp.
setPx(aPtVector.x()); tmp.
setPy(aPtVector.y());
1743 SumPx += aPtVector.x(); SumPy += aPtVector.y();
1744 Mt = std::sqrt(aPtVector.mag2()+
sqr(VqM_pr));
1745 ProjSumMt += Mt;
1746
1747
1748 tmp.
setPz(
SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta)*(1.0-SumZ));
1750
1751 ProjSumMt2perX +=
sqr(Mt)/tmp.
pz();
1753 aParton->Set4Momentum(tmp);
1754
1755
1757 #ifdef debugQGSParticipants
1758 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1760 #endif
1762
1763 Mt = std::sqrt(
sqr(SumPx) +
sqr(SumPy) +
sqr(VaqM_pr) );
1764 ProjSumMt += Mt;
1766
1767 ProjSumMt2perX +=
sqr(Mt)/tmp.
pz();
1769 aParton->Set4Momentum(tmp);
1770 #ifdef debugQGSParticipants
1771 G4cout<<
" "<<tmp<<
" "<<SumZ+(1.-SumZ)<<
" (z-fraction)"<<
G4endl;
1772 NuclNo=0;
1773 #endif
1774
1775
1776
1777
1778
1780 {
1781 nSeaPair = (*i)->GetSoftCollisionCount()-1;
1782 #ifdef debugQGSParticipants
1784 <<
"Target nucleon 4Mom "<<(*i)->Get4Momentum()<<
G4endl;
1785 #endif
1786
1787 SumPx = (*i)->Get4Momentum().px() * (-1.);
1788 SumPy = (*i)->Get4Momentum().py() * (-1.);
1789 SumZ = 0.;
1790
1791 NumberOfUnsampledSeaQuarks = 2*nSeaPair;
1792
1793 Qmass=0;
1794 for (
G4int aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++)
1795 {
1796 aParton = (*i)->GetNextParton();
1797 #ifdef debugQGSParticipants
1798 G4cout<<
"Sea quarks: "<<aSeaPair<<
" "<<aParton->GetDefinition()->GetParticleName();
1799 #endif
1800 aPtVector = GaussianPt(SigPt, aHugeValue);
1801 tmp.
setPx(aPtVector.x()); tmp.
setPy(aPtVector.y());
1802 SumPx += aPtVector.x(); SumPy += aPtVector.y();
1803 Mt=std::sqrt(aPtVector.mag2()+
sqr(Qmass));
1804 TargSumMt += Mt;
1805
1806
1807 tmp.
setPz(
SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta)*(1.0-SumZ));
1809 tmp.
setPz((*i)->Get4Momentum().pz()*tmp.
pz());
1810 NumberOfUnsampledSeaQuarks--;
1811 TargSumMt2perX +=
sqr(Mt)/tmp.
pz();
1813 aParton->Set4Momentum(tmp);
1814
1815 aParton = (*i)->GetNextAntiParton();
1816 #ifdef debugQGSParticipants
1817 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1819 #endif
1820 aPtVector = GaussianPt(SigPt, aHugeValue);
1821 tmp.
setPx(aPtVector.x()); tmp.
setPy(aPtVector.y());
1822 SumPx += aPtVector.x(); SumPy += aPtVector.y();
1823 Mt=std::sqrt(aPtVector.mag2()+
sqr(Qmass));
1824 TargSumMt += Mt;
1825
1826
1827 tmp.
setPz(
SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta)*(1.0-SumZ));
1829 tmp.
setPz((*i)->Get4Momentum().pz()*tmp.
pz());
1830 NumberOfUnsampledSeaQuarks--;
1831 TargSumMt2perX +=
sqr(Mt)/tmp.
pz();
1833 aParton->Set4Momentum(tmp);
1834 #ifdef debugQGSParticipants
1836 #endif
1837 }
1838
1839
1840 aParton = (*i)->GetNextParton();
1841 #ifdef debugQGSParticipants
1842 G4cout<<
"Val quark of Tr"<<
" "<<aParton->GetDefinition()->GetParticleName();
1843 #endif
1844 aPtVector = GaussianPt(SigPt, aHugeValue);
1845 tmp.
setPx(aPtVector.x()); tmp.
setPy(aPtVector.y());
1846 SumPx += aPtVector.x(); SumPy += aPtVector.y();
1847 Mt=std::sqrt(aPtVector.mag2()+
sqr(VqM_tr));
1848 TargSumMt += Mt;
1849
1850
1851 tmp.
setPz(
SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta)*(1.0-SumZ));
1853 tmp.
setPz((*i)->Get4Momentum().pz()*tmp.
pz());
1854 TargSumMt2perX +=
sqr(Mt)/tmp.
pz();
1856 aParton->Set4Momentum(tmp);
1857
1858
1859 aParton = (*i)->GetNextAntiParton();
1860 #ifdef debugQGSParticipants
1861 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1862 G4cout<<
" "<<tmp<<
" "<<SumZ<<
" (total z-sum) "<<
G4endl;
1863 #endif
1865
1866 Mt=std::sqrt(
sqr(SumPx) +
sqr(SumPy) +
sqr(VqqM_tr) );
1867 TargSumMt += Mt;
1868
1869 tmp.
setPz((*i)->Get4Momentum().pz()*(1.0 - SumZ));
1870 TargSumMt2perX +=
sqr(Mt)/tmp.
pz();
1872 aParton->Set4Momentum(tmp);
1873 #ifdef debugQGSParticipants
1874 G4cout<<
" "<<tmp<<
" "<<1.0<<
" "<<(*i)->Get4Momentum().
pz()<<
G4endl;
1875 #endif
1876
1877 }
1878
1879 if( ProjSumMt + TargSumMt > SqrtS ) {
1880 Success = false; continue;}
1881 if( std::sqrt(ProjSumMt2perX) + std::sqrt(TargSumMt2perX) > SqrtS ) {
1882 Success = false; continue;}
1883
1884 } while( (!Success) &&
1885 attempt < maxNumberOfAttempts );
1886
1887 if ( attempt >= maxNumberOfAttempts ) {
1888 return false;
1889 }
1890
1891
1892
1894 - 2.0*
S*ProjSumMt2perX - 2.0*
S*TargSumMt2perX - 2.0*ProjSumMt2perX*TargSumMt2perX;
1895
1896 G4double targetWminus=(
S - ProjSumMt2perX + TargSumMt2perX + std::sqrt( DecayMomentum2 ))/2.0/SqrtS;
1897 G4double projectileWplus = SqrtS - TargSumMt2perX/targetWminus;
1898
1901
1903 #ifdef debugQGSParticipants
1904 G4cout<<
"Backward transformation ===================="<<
G4endl;
1906 #endif
1907
1908 for (
G4int aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++)
1909 {
1911 #ifdef debugQGSParticipants
1912 G4cout<<
"Sea quarks: "<<aSeaPair<<
" "<<aParton->GetDefinition()->GetParticleName();
1913 #endif
1914 Tmp =aParton->Get4Momentum(); z=Tmp.z();
1915
1916 Tmp.setPz(projectileWplus*z/2.0 - Tmp.e()/(2.0*z*projectileWplus));
1917 Tmp.setE( projectileWplus*z/2.0 + Tmp.e()/(2.0*z*projectileWplus));
1918 Tmp.transform( toLab );
1919
1920 aParton->Set4Momentum(Tmp);
1921
1923 #ifdef debugQGSParticipants
1924 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1926 #endif
1927 Tmp =aParton->Get4Momentum(); z=Tmp.z();
1928 Tmp.setPz(projectileWplus*z/2.0 - Tmp.e()/(2.0*z*projectileWplus));
1929 Tmp.setE( projectileWplus*z/2.0 + Tmp.e()/(2.0*z*projectileWplus));
1930 Tmp.transform( toLab );
1931
1932 aParton->Set4Momentum(Tmp);
1933 #ifdef debugQGSParticipants
1935 #endif
1936 }
1937
1938
1940 #ifdef debugQGSParticipants
1941 G4cout<<
"Val quark of Pr"<<
" "<<aParton->GetDefinition()->GetParticleName();
1942 #endif
1943 Tmp =aParton->Get4Momentum(); z=Tmp.z();
1944 Tmp.setPz(projectileWplus*z/2.0 - Tmp.e()/(2.0*z*projectileWplus));
1945 Tmp.setE( projectileWplus*z/2.0 + Tmp.e()/(2.0*z*projectileWplus));
1946 Tmp.transform( toLab );
1947
1948 aParton->Set4Momentum(Tmp);
1949
1950
1952 #ifdef debugQGSParticipants
1953 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1955 #endif
1956 Tmp =aParton->Get4Momentum(); z=Tmp.z();
1957 Tmp.setPz(projectileWplus*z/2.0 - Tmp.e()/(2.0*z*projectileWplus));
1958 Tmp.setE( projectileWplus*z/2.0 + Tmp.e()/(2.0*z*projectileWplus));
1959 Tmp.transform( toLab );
1960
1961 aParton->Set4Momentum(Tmp);
1962
1963 #ifdef debugQGSParticipants
1965 NuclNo=0;
1966 #endif
1967
1968
1969
1970
1972 {
1973 nSeaPair = (*i)->GetSoftCollisionCount()-1;
1974 #ifdef debugQGSParticipants
1975 G4cout<<
"nSeaPair of target and N# "<<nSeaPair<<
" "<<NuclNo<<
G4endl;
1976 NuclNo++;
1977 #endif
1978 for (
G4int aSeaPair = 0; aSeaPair < nSeaPair; aSeaPair++)
1979 {
1980 aParton = (*i)->GetNextParton();
1981 #ifdef debugQGSParticipants
1982 G4cout<<
"Sea quarks: "<<aSeaPair<<
" "<<aParton->GetDefinition()->GetParticleName();
1983 #endif
1984 Tmp =aParton->Get4Momentum(); z=Tmp.z();
1985 Tmp.setPz(-targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
1986 Tmp.setE( targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
1987 Tmp.transform( toLab );
1988
1989 aParton->Set4Momentum(Tmp);
1990
1991 aParton = (*i)->GetNextAntiParton();
1992 #ifdef debugQGSParticipants
1993 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
1995 #endif
1996 Tmp =aParton->Get4Momentum(); z=Tmp.z();
1997 Tmp.setPz(-targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
1998 Tmp.setE( targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
1999 Tmp.transform( toLab );
2000
2001 aParton->Set4Momentum(Tmp);
2002 #ifdef debugQGSParticipants
2004 #endif
2005 }
2006
2007
2008
2009 aParton = (*i)->GetNextParton();
2010 #ifdef debugQGSParticipants
2011 G4cout<<
"Val quark of Tr"<<
" "<<aParton->GetDefinition()->GetParticleName();
2012 #endif
2013 Tmp =aParton->Get4Momentum(); z=Tmp.z();
2014 Tmp.setPz(-targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
2015 Tmp.setE( targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
2016 Tmp.transform( toLab );
2017
2018 aParton->Set4Momentum(Tmp);
2019
2020
2021 aParton = (*i)->GetNextAntiParton();
2022 #ifdef debugQGSParticipants
2023 G4cout<<
" "<<aParton->GetDefinition()->GetParticleName()<<
G4endl;
2025 #endif
2026 Tmp =aParton->Get4Momentum(); z=Tmp.z();
2027 Tmp.setPz(-targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
2028 Tmp.setE( targetWminus*z/2.0 + Tmp.e()/(2.0*z*targetWminus));
2029 Tmp.transform( toLab );
2030
2031 aParton->Set4Momentum(Tmp);
2032 #ifdef debugQGSParticipants
2034 NuclNo++;
2035 #endif
2036 }
2037
2038 return true;
2039}
G4double S(G4double temp)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
Hep3Vector boostVector() const
HepLorentzVector & rotateZ(double)
HepLorentzVector & rotateY(double)
HepLorentzVector & transform(const HepRotation &)
static G4Gamma * GammaDefinition()
static G4KaonMinus * KaonMinusDefinition()
static G4KaonPlus * KaonPlusDefinition()
static G4PionMinus * PionMinusDefinition()
static G4PionPlus * PionPlusDefinition()
static G4PionZero * PionZeroDefinition()
virtual G4Parton * GetNextParton()
virtual G4Parton * GetNextAntiParton()
G4double SampleX(G4double anXmin, G4int nSea, G4int theTotalSea, G4double aBeta)
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
G4int GetSoftCollisionCount()