1568{
1569 MsgStream log(
msgSvc(), name());
1570 log << MSG::INFO <<" In findD0Decay " << endmsg ;
1571 vector<double> d0_info(9);
1572 for(int i=0; i< 9; i++) d0_info[i]=0;
1573 double decay_mode = 20;
1574 double r2D0 = -1;
1575 double deltaD0 = -1;
1576 double RD0 = 1;
1577 double FCP = 1;
1578
1580 for(
int i=0; i< 26; i++)
num[i]=0;
1581
1582 int kPiPlus = 0;
1583 int kPiMinus = 1;
1584 int kPi0 = 2;
1585 int kEta = 3;
1586 int kEtaPrime = 4;
1587 int kNeutralScalar = 5;
1588 int kUFVPlus = 6;
1589 int kUFVMinus = 7;
1590 int kRho0 = 8;
1591 int kOmega = 9;
1592 int kPhi = 10;
1593 int kKPlus = 11;
1594 int kKMinus = 12;
1595 int kK0S = 13;
1596 int kK0L = 14;
1597 int kFVPlus = 15;
1598 int kFVMinus = 16;
1599 int kKStar0 = 17;
1600 int kKStar0Bar = 18;
1601 int kK10 = 19;
1602 int kK10Bar = 20;
1603 int kLeptonPlus = 21;
1604 int kLeptonMinus = 22;
1605 int kNeutrino = 23;
1606 int kGamma = 24;
1607 int kUnknown = 25;
1608
1609
1610
1612 int d0_pdg = charm == 1 ? kD0ID : kD0BarID;
1613
1614 HepLorentzVector piPlus, piMinus, k0;
1615 vector<HepLorentzVector> piPlus_4pi, piMinus_4pi, pi0_p4;
1616 vector<HepLorentzVector> kPlus_kkpipi, kMinus_kkpipi;
1617 piPlus_4pi.clear();piMinus_4pi.clear(), pi0_p4.clear();
1618 kPlus_kkpipi.clear();kMinus_kkpipi.clear();
1619
1620
1621 for( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++)
1622 {
1623 int pdg_code = (*it)->particleProperty();
1624 if ((*it)->primaryParticle()) continue;
1626 int mother_pdg = 0;
1627
1628
1630
1631
1632 if (pdg_code == kKStar0ID || pdg_code == kKStar0BarID || pdg_code == kK0ID || pdg_code == kK0BarID || pdg_code == kKDPStar0ID || pdg_code == kKDPStar0BarID
1633 || pdg_code == kK10ID || pdg_code == kK10BarID
1634 || pdg_code == kK0Star0ID || pdg_code == kK0Star0BarID || pdg_code == kK0StarPlusID || pdg_code == kK0BarID ) continue;
1635
1636 if (mother_pdg == kK0ID || mother_pdg == kK0BarID) {
1639
1640 if (mother_pdg == kKStar0ID || mother_pdg == kKStar0BarID) {
1641
1642
1643 if (pdg_code == kPiPlusID || pdg_code == kPiMinusID) continue;
1644 if (mother_pdg == kKStar0ID && pdg_code == kKPlusID) pdg_code = kKStar0ID;
1645 if (mother_pdg == kKStar0BarID && pdg_code == kKMinusID) pdg_code = kKStar0BarID;
1648 }
1649
1650 if ( mother_pdg == kK0Star0ID || mother_pdg == kK0Star0BarID ) {
1653 }
1654
1655 if (mother_pdg == kK10ID || mother_pdg == kK10BarID) {
1658 }
1659
1660
1661 int nFSR(0);
1662 if (mother_pdg == d0_pdg)
1663 {
1664
1665
1666 if (pdg_code == kPiPlusID || pdg_code == kA0PlusID )
num[0]++;
1667 else if (pdg_code == kPiMinusID || pdg_code == kA0MinusID )
num[1]++;
1668 else if (pdg_code == kPi0ID )
num[2]++;
1669 else if (pdg_code == kEtaID )
num[3]++;
1670 else if (pdg_code == kEtaPrimeID )
num[4]++;
1671 else if (pdg_code == kF0ID || pdg_code == kA00ID
1672 || pdg_code == kFPrime0ID|| pdg_code == kF0m1500ID
1673 || pdg_code == kF2ID || pdg_code == kF0m1710ID || pdg_code == kF0600ID )
num[5]++;
1674 else if (pdg_code == kRhoPlusID || pdg_code == kRho2SPlusID
1675 || pdg_code == kA1PlusID )
num[6]++;
1676 else if (pdg_code == kRhoMinusID || pdg_code == kRho2SMinusID
1677 || pdg_code == kA1MinusID)
num[7]++;
1678 else if (pdg_code == kRho0ID || pdg_code == kRho2S0ID)
num[8]++;
1679 else if (pdg_code == kOmegaID )
num[9]++;
1680 else if (pdg_code == kPhiID )
num[10]++;
1681 else if (pdg_code == kKPlusID )
num[11]++;
1682 else if (pdg_code == kKMinusID )
num[12]++;
1683 else if (pdg_code == kK0SID )
num[13]++;
1684 else if (pdg_code == kK0LID )
num[14]++;
1685 else if (pdg_code == kKStarPlusID || pdg_code == kK1PlusID
1686 || pdg_code == kK2StarPlusID || pdg_code == kK1PrimePlusID
1687 || pdg_code == kK0StarPlusID)
num[15]++;
1688 else if (pdg_code == kKStarMinusID || pdg_code == kK1MinusID
1689 || pdg_code == kK2StarMinusID || pdg_code == kK1PrimeMinusID
1690 || pdg_code == kK0StarMinusID )
num[16]++;
1691 else if (pdg_code == kKStar0ID )
num[17]++;
1692 else if (pdg_code == kKStar0BarID )
num[18]++;
1693 else if (pdg_code == kK10ID || pdg_code == kK1Prime0ID)
num[19]++;
1694 else if (pdg_code == kK10BarID || pdg_code == kK1Prime0BarID)
num[20]++;
1695 else if (pdg_code == kEPlusID || pdg_code == kMuPlusID )
num[21]++;
1696 else if (pdg_code == kEMinusID || pdg_code == kMuMinusID )
num[22]++;
1697 else if (pdg_code == kNuEID || pdg_code == kNuEBarID
1698 || pdg_code == kNuMuID || pdg_code == kNuMuBarID )
num[23]++;
1699 else if (pdg_code == kGammaID )
num[24]++;
1700 else if (pdg_code == kGammaFSRID ) continue;
1701 else {
1703 cout <<"Unknown particle: "<< pdg_code << endl;
1704 }
1705
1706
1707
1708
1709
1710
1711
1712
1713 if (pdg_code == kPiPlusID) piPlus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1714 if (pdg_code == kPiMinusID) piMinus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1715 if (pdg_code == kK0SID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1716 if (pdg_code == kK0LID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1717 HepLorentzVector daughterP4;
1718 if(piPlus_4pi.size()>2||piMinus_4pi.size()>2)continue;
1719 if(kPlus_kkpipi.size()>1||kMinus_kkpipi.size()>1)continue;
1720
1721 if (pdg_code == kPiPlusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpion);piPlus_4pi.push_back(daughterP4);}
1722 if (pdg_code == kPiMinusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpion);piMinus_4pi.push_back(daughterP4);}
1723 if (pdg_code == kKPlusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmkaon);kPlus_kkpipi.push_back(daughterP4);}
1724 if (pdg_code == kKMinusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmkaon);kMinus_kkpipi.push_back(daughterP4);}
1725 if (pdg_code == kPi0ID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpi0);pi0_p4.push_back(daughterP4);}
1726 }
1727 }
1728
1729
1730 int nDaughters = 0 ;
1731 for( int i = 0 ; i < 26 ; i++ )
1732 {
1733 nDaughters +=
num[ i ] ;
1734 }
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746 int nUFP0 =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] ;
1747 int nUFV0 =
num[ kRho0 ] +
num[ kPhi ] +
num[ kOmega ] +
num[ kGamma ] ;
1748 int nFV0 =
num[ kKStar0 ] +
num[ kK10 ] ;
1749 int nFV0Bar =
num[ kKStar0Bar ] +
num[ kK10Bar ] ;
1750 int nStrange =
num[ kKMinus ] +
num[ kFVMinus ] + nFV0Bar ;
1751 int nAntiStrange =
num[ kKPlus ] +
num[ kFVPlus ] + nFV0 ;
1752 int nCPPlusEig =
num[ kNeutralScalar ] +
num[ kRho0 ] +
num[ kOmega ] +
num[ kPhi ] +
num[ kK0S ] +
num[ kGamma ] ;
1753 int nCPMinusEig =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] +
num[ kK0L ] ;
1754 int nCPEig = nCPPlusEig + nCPMinusEig ;
1755 int nChargedPiK =
num[ kPiPlus ] +
num[ kPiMinus ] +
num[ kKPlus ] +
num[ kKMinus ] ;
1756 int nK0 =
num[ kK0S ] +
num[ kK0L ] ;
1757
1758
1759
1760 double mnm_gen = 0. ;
1761 double mpn_gen = 0. ;
1762 double mpm_gen = 0. ;
1763 bool isKsPiPi =
false ;
1764 bool isKsKK =
false ;
1765 bool isKsPiPiPi0 =
false ;
1766
1767
1768
1769
1770 if( nK0 == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] && nDaughters == 3 )
1771 {
1772 decay_mode = kDalitz ;
1773
1774
1775
1776
1777
1778
1779 if(
num[ kK0S ] == 1) isKsPiPi =
true ;
1780 }
1781 if(
num[ kPiPlus ] == 2&&
num[ kPiMinus ]==2 && nDaughters == 4 )
1782 {
1783 decay_mode = k2Pip2Pim;
1784 }
1785 if(
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kPi0 ]==2 && nDaughters == 4 )
1786 {
1787 decay_mode = kPipPim2Pi0;
1788 }
1789 if( nK0 == 1 &&
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kPi0 ]==1 && nDaughters == 4 )
1790 {
1791 decay_mode = kK0PiPiPi0;
1792 if(
num[ kK0S ] == 1) isKsPiPiPi0 =
true ;
1793 }
1794 if(
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kKPlus ] == 1&&
num[ kKMinus ]==1 && nDaughters == 4 )
1795 {
1796 decay_mode = kKKPiPi;
1797 }
1798 if(
num[ kKPlus ] == 1&&
num[ kKMinus ]==1 && nK0 == 1 && nDaughters == 3 )
1799 {
1800 decay_mode = kK0KK;
1801 if(
num[ kK0S ] == 1) isKsKK =
true;
1802 }
1803
1804 int nDaughters_RhoPlus(0); int nDaughterPiPlus_RhoPlus(0); int nDaughterPi0_RhoPlus(0);
1805 int nDaughters_RhoMinus(0);int nDaughterPiMinus_RhoMinus(0);int nDaughterPi0_RhoMinus(0);
1806 int nDaughters_Rho0(0); int nDaughterPiPlus_Rho0(0); int nDaughterPiMinus_Rho0(0);
1807 int nDaughters_F0600(0); int nDaughterPiPlus_F0600(0); int nDaughterPiMinus_F0600(0);
1808 int nDaughters_F0(0); int nDaughterPiPlus_F0(0); int nDaughterPiMinus_F0(0);
1809 int nDaughters_FPrime0(0); int nDaughterPiPlus_FPrime0(0); int nDaughterPiMinus_FPrime0(0);
1810 int nDaughters_F01500(0); int nDaughterPiPlus_F01500(0); int nDaughterPiMinus_F01500(0);
1811 int nDaughters_F01710(0); int nDaughterPiPlus_F01710(0); int nDaughterPiMinus_F01710(0);
1812 int nDaughters_F2(0); int nDaughterPiPlus_F2(0); int nDaughterPiMinus_F2(0);
1813 int nDaughters_Omega(0); int nDaughterPiPlus_Omega(0); int nDaughterPiMinus_Omega(0);
1814
1815 for( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++)
1816 {
1817 int pdg_code = (*it)->particleProperty();
1818 if ((*it)->primaryParticle()) continue;
1820 int mother_pdg = 0;
1821
1822
1824 if( mother_pdg == kRhoPlusID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_RhoPlus++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_RhoPlus++;
if( pdg_code == kPi0ID) nDaughterPi0_RhoPlus++;}}
1825 if( mother_pdg == kRhoMinusID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_RhoMinus++;
if( pdg_code == kPiMinusID)nDaughterPiMinus_RhoMinus++;
if( pdg_code == kPi0ID) nDaughterPi0_RhoMinus++;}}
1826 if( mother_pdg == kRho0ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_Rho0++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_Rho0++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_Rho0++;}}
1827 if( mother_pdg == kF0600ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_F0600++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_F0600++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_F0600++;}}
1828 if( mother_pdg == kF0ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_F0++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_F0++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_F0++;}}
1829 if( mother_pdg == kFPrime0ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_FPrime0++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_FPrime0++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_FPrime0++;}}
1830 if( mother_pdg == kF0m1500ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_F01500++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_F01500++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_F01500++;}}
1831 if( mother_pdg == kF0m1710ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_F01710++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_F01710++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_F01710++;}}
1832 if( mother_pdg == kF2ID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_F2++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_F2++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_F2++;}}
1833 if( mother_pdg == kOmegaID ) {
Event::McParticle it3 = it2.
mother();
if(it3.
particleProperty()==d0_pdg&&pdg_code!=-22) { nDaughters_Omega++;
if( pdg_code == kPiPlusID) nDaughterPiPlus_Omega++;
if( pdg_code == kPiMinusID) nDaughterPiMinus_Omega++;}}
1834 }
1835
1836
1837
1838 if( decay_mode == kDalitz )
1839 {
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1855 vector<double> k0l;vector<double> pip;vector<double> pim;
1856 k0l.clear();pip.clear();pim.clear();
1857 k0l.push_back(k0[0]);k0l.push_back(k0[1]);k0l.push_back(k0[2]);k0l.push_back(k0[3]);
1858 pip.push_back(piPlus[0]);pip.push_back(piPlus[1]);pip.push_back(piPlus[2]);pip.push_back(piPlus[3]);
1859 pim.push_back(piMinus[0]);pim.push_back(piMinus[1]);pim.push_back(piMinus[2]);pim.push_back(piMinus[3]);
1860
1861 if(isKsPiPi){
1862
1864 D0 = tKSpipi.
Amp_PFT(k0l,pip,pim);
1865
1866 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;
1867 cpk0l.clear();pip.clear();pim.clear();
1868 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
1869 cppim.push_back(-piPlus[0]);cppim.push_back(-piPlus[1]);cppim.push_back(-piPlus[2]);cppim.push_back(piPlus[3]);
1870 cppip.push_back(-piMinus[0]);cppip.push_back(-piMinus[1]);cppip.push_back(-piMinus[2]);cppip.push_back(piMinus[3]);
1871 D0bar = tKSpipi.
Amp_PFT(cpk0l, cppip, cppim);
1872 }else{
1873
1875 D0 = tKLpipi.
Amp_PFT(k0l,pip,pim);
1876 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;
1877 cpk0l.clear();pip.clear();pim.clear();
1878 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
1879 cppim.push_back(-piPlus[0]);cppim.push_back(-piPlus[1]);cppim.push_back(-piPlus[2]);cppim.push_back(piPlus[3]);
1880 cppip.push_back(-piMinus[0]);cppip.push_back(-piMinus[1]);cppip.push_back(-piMinus[2]);cppip.push_back(piMinus[3]);
1881 D0bar = tKLpipi.
Amp_PFT(cpk0l, cppip, cppim);
1882 }
1883
1884 if( charm == 1){
1885
1886 r2D0 = std::norm(D0bar)/std::norm(D0);
1887 double temp = std::arg(D0)-std::arg(D0bar);
1888 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
1889 while (temp < -TMath::Pi())
1890 {
1891 temp += 2.0 * TMath::Pi();
1892 }
1893 while (temp > TMath::Pi())
1894 {
1895 temp -= 2.0 * TMath::Pi();
1896 }
1897 deltaD0 = temp;
1898 deltaD0 = isKsPiPi ? deltaD0 : (deltaD0+
PI);
1899
1900 double cosd =
cos(deltaD0);
1901 double sind =
sin(deltaD0);
1902 if( mpn_gen - mnm_gen > 0. )
1903 {
1907 }
1908 }
1909 else {
1910 r2D0 = std::norm(D0)/std::norm(D0bar);
1911 double temp = std::arg(D0bar)-std::arg(D0);
1912 while (temp < -TMath::Pi())
1913 {
1914 temp += 2.0 * TMath::Pi();
1915 }
1916 while (temp > TMath::Pi())
1917 {
1918 temp -= 2.0 * TMath::Pi();
1919 }
1920 deltaD0 = temp;
1921 deltaD0 = isKsPiPi ? deltaD0 : (deltaD0+
PI);
1922
1923 double cosd =
cos( deltaD0 ) ;
1924 double sind =
sin( deltaD0 ) ;
1925 if( mpn_gen - mnm_gen < 0. )
1926 {
1930 }
1931 }
1932 }else if( decay_mode == k2Pip2Pim ){
1933
1935
1936 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
1937 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
1938 HepLorentzVector pip2_4pi = (piPlus_4pi.at(1));
1939 HepLorentzVector pim2_4pi = (piMinus_4pi.at(1));
1940 pip1_4pi.boost(-0.011, 0, 0);
1941 pip2_4pi.boost(-0.011, 0, 0);
1942 pim1_4pi.boost(-0.011, 0, 0);
1943 pim2_4pi.boost(-0.011, 0, 0);
1944 std::complex<double> D0, D0bar;
1945
1946
1947
1948
1949 std::vector<double> pip1; pip1.clear(); pip1.push_back(pip1_4pi[0]);pip1.push_back(pip1_4pi[1]);pip1.push_back(pip1_4pi[2]);pip1.push_back(pip1_4pi[3]);
1950 std::vector<double> pim1; pim1.clear(); pim1.push_back(pim1_4pi[0]);pim1.push_back(pim1_4pi[1]);pim1.push_back(pim1_4pi[2]);pim1.push_back(pim1_4pi[3]);
1951 std::vector<double> pip2; pip2.clear(); pip2.push_back(pip2_4pi[0]);pip2.push_back(pip2_4pi[1]);pip2.push_back(pip2_4pi[2]);pip2.push_back(pip2_4pi[3]);
1952 std::vector<double> pim2; pim2.clear(); pim2.push_back(pim2_4pi[0]);pim2.push_back(pim2_4pi[1]);pim2.push_back(pim2_4pi[2]);pim2.push_back(pim2_4pi[3]);
1953
1955 D0 = t2pip2pim.
Amp(pip1,pim1,pip2,pim2);
1956
1957
1958
1959
1960 std::vector<double> cppip1; cppip1.clear(); cppip1.push_back(-pim1_4pi[0]);cppip1.push_back(-pim1_4pi[1]);cppip1.push_back(-pim1_4pi[2]);cppip1.push_back(pim1_4pi[3]);
1961 std::vector<double> cppim1; cppim1.clear(); cppim1.push_back(-pip1_4pi[0]);cppim1.push_back(-pip1_4pi[1]);cppim1.push_back(-pip1_4pi[2]);cppim1.push_back(pip1_4pi[3]);
1962 std::vector<double> cppip2; cppip2.clear(); cppip2.push_back(-pim2_4pi[0]);cppip2.push_back(-pim2_4pi[1]);cppip2.push_back(-pim2_4pi[2]);cppip2.push_back(pim2_4pi[3]);
1963 std::vector<double> cppim2; cppim2.clear(); cppim2.push_back(-pip2_4pi[0]);cppim2.push_back(-pip2_4pi[1]);cppim2.push_back(-pip2_4pi[2]);cppim2.push_back(pip2_4pi[3]);
1964
1965 D0bar = t2pip2pim.
Amp(cppip1, cppim1, cppip2, cppim2);
1966
1967 if( charm == 1){
1968
1969 r2D0 = std::norm(D0bar)/std::norm(D0);
1970 double temp = std::arg(D0)-std::arg(D0bar);
1971 while (temp < -TMath::Pi())
1972 {
1973 temp += 2.0 * TMath::Pi();
1974 }
1975 while (temp > TMath::Pi())
1976 {
1977 temp -= 2.0 * TMath::Pi();
1978 }
1979 deltaD0 = temp;
1980
1981 double cosd =
cos(deltaD0);
1982 double sind =
sin(deltaD0);
1983
1984
1988
1989 }
1990 else {
1991 r2D0 = std::norm(D0)/std::norm(D0bar);
1992 double temp = std::arg(D0bar)-std::arg(D0);
1993 while (temp < -TMath::Pi())
1994 {
1995 temp += 2.0 * TMath::Pi();
1996 }
1997 while (temp > TMath::Pi())
1998 {
1999 temp -= 2.0 * TMath::Pi();
2000 }
2001 deltaD0 = temp;
2002
2003 double cosd =
cos( deltaD0 ) ;
2004 double sind =
sin( deltaD0 ) ;
2005
2006
2010
2011 }
2012 }else if( decay_mode == kPipPim2Pi0 ){
2013
2015
2016
2017 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
2018 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
2019 HepLorentzVector pi01_p4 = (pi0_p4.at(0));
2020 HepLorentzVector pi02_p4 = (pi0_p4.at(1));
2021 pip1_4pi.boost(-0.011, 0, 0);
2022 pim1_4pi.boost(-0.011, 0, 0);
2023 pi01_p4.boost(-0.011, 0, 0);
2024 pi02_p4.boost(-0.011, 0, 0);
2025 std::complex<double> D0, D0bar;
2026
2027
2028
2029
2030 std::vector<double> pip1; pip1.clear(); pip1.push_back(pip1_4pi[0]);pip1.push_back(pip1_4pi[1]);pip1.push_back(pip1_4pi[2]);pip1.push_back(pip1_4pi[3]);
2031 std::vector<double> pim1; pim1.clear(); pim1.push_back(pim1_4pi[0]);pim1.push_back(pim1_4pi[1]);pim1.push_back(pim1_4pi[2]);pim1.push_back(pim1_4pi[3]);
2032 std::vector<double> pi01; pi01.clear(); pi01.push_back(pi01_p4[0]);pi01.push_back(pi01_p4[1]);pi01.push_back(pi01_p4[2]);pi01.push_back(pi01_p4[3]);
2033 std::vector<double> pi02; pi02.clear(); pi02.push_back(pi02_p4[0]);pi02.push_back(pi02_p4[1]);pi02.push_back(pi02_p4[2]);pi02.push_back(pi02_p4[3]);
2034
2036 D0 = tpippim2pi0.
Amp(pip1,pim1,pi01,pi02);
2037
2038
2039
2040
2041 std::vector<double> cppip1; cppip1.clear(); cppip1.push_back(-pim1_4pi[0]);cppip1.push_back(-pim1_4pi[1]);cppip1.push_back(-pim1_4pi[2]);cppip1.push_back(pim1_4pi[3]);
2042 std::vector<double> cppim1; cppim1.clear(); cppim1.push_back(-pip1_4pi[0]);cppim1.push_back(-pip1_4pi[1]);cppim1.push_back(-pip1_4pi[2]);cppim1.push_back(pip1_4pi[3]);
2043 std::vector<double> cppi01; cppi01.clear(); cppi01.push_back(-pi01_p4[0]);cppi01.push_back(-pi01_p4[1]);cppi01.push_back(-pi01_p4[2]);cppi01.push_back(pi01_p4[3]);
2044 std::vector<double> cppi02; cppi02.clear(); cppi02.push_back(-pi02_p4[0]);cppi02.push_back(-pi02_p4[1]);cppi02.push_back(-pi02_p4[2]);cppi02.push_back(pi02_p4[3]);
2045
2046 D0bar = tpippim2pi0.
Amp(cppip1, cppim1, cppi01, cppi02);
2047
2048 if( charm == 1){
2049
2050 r2D0 = std::norm(D0bar)/std::norm(D0);
2051 double temp = std::arg(D0)-std::arg(D0bar);
2052 while (temp < -TMath::Pi())
2053 {
2054 temp += 2.0 * TMath::Pi();
2055 }
2056 while (temp > TMath::Pi())
2057 {
2058 temp -= 2.0 * TMath::Pi();
2059 }
2060 deltaD0 = temp;
2061
2062 double cosd =
cos(deltaD0);
2063 double sind =
sin(deltaD0);
2064
2065
2069
2070 }
2071 else {
2072 r2D0 = std::norm(D0)/std::norm(D0bar);
2073 double temp = std::arg(D0bar)-std::arg(D0);
2074 while (temp < -TMath::Pi())
2075 {
2076 temp += 2.0 * TMath::Pi();
2077 }
2078 while (temp > TMath::Pi())
2079 {
2080 temp -= 2.0 * TMath::Pi();
2081 }
2082 deltaD0 = temp;
2083
2084 double cosd =
cos( deltaD0 ) ;
2085 double sind =
sin( deltaD0 ) ;
2086
2090 }
2091 }else if( decay_mode == kK0PiPiPi0 )
2092 {
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106 HepLorentzVector pip_kspipipi0 = (piPlus_4pi.at(0));
2107 HepLorentzVector pim_kspipipi0 = (piMinus_4pi.at(0));
2108 HepLorentzVector k0_kspipipi0 = k0;
2109 HepLorentzVector pi0_kspipipi0 = (pi0_p4.at(0));
2110 pip_kspipipi0.boost(-0.011, 0, 0);
2111 pim_kspipipi0.boost(-0.011, 0, 0);
2112 k0_kspipipi0.boost(-0.011, 0, 0);
2113 pi0_kspipipi0.boost(-0.011, 0, 0);
2114
2116 vector<double> k0l;vector<double> pip;vector<double> pim; vector<double> pi0;
2117 k0l.clear();pip.clear();pim.clear();pi0.clear();
2118 k0l.push_back(k0_kspipipi0[0]);k0l.push_back(k0_kspipipi0[1]);k0l.push_back(k0_kspipipi0[2]);k0l.push_back(k0_kspipipi0[3]);
2119 pip.push_back(pip_kspipipi0[0]);pip.push_back(pip_kspipipi0[1]);pip.push_back(pip_kspipipi0[2]);pip.push_back(pip_kspipipi0[3]);
2120 pim.push_back(pim_kspipipi0[0]);pim.push_back(pim_kspipipi0[1]);pim.push_back(pim_kspipipi0[2]);pim.push_back(pim_kspipipi0[3]);
2121 pi0.push_back(pi0_kspipipi0[0]);pi0.push_back(pi0_kspipipi0[1]);pi0.push_back(pi0_kspipipi0[2]);pi0.push_back(pi0_kspipipi0[3]);
2122
2123 if(isKsPiPiPi0){
2125 D0 = tKSpipipi0.
Amp(k0l,pip,pim,pi0);
2126
2127 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;vector<double> cppi0;
2128 cpk0l.clear();cppip.clear();cppim.clear();cppi0.clear();
2129 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2130 cppim.push_back(-pip[0]);cppim.push_back(-pip[1]);cppim.push_back(-pip[2]);cppim.push_back(pip[3]);
2131 cppip.push_back(-pim[0]);cppip.push_back(-pim[1]);cppip.push_back(-pim[2]);cppip.push_back(pim[3]);
2132 cppi0.push_back(-pi0[0]);cppi0.push_back(-pi0[1]);cppi0.push_back(-pi0[2]);cppi0.push_back(pi0[3]);
2133 D0bar = tKSpipipi0.
Amp(cpk0l, cppip, cppim, cppi0);
2134 }else{
2136 D0 = tKSpipipi0.
Amp(k0l,pip,pim,pi0);
2137
2138 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;vector<double> cppi0;
2139 cpk0l.clear();cppip.clear();cppim.clear();cppi0.clear();
2140 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2141 cppim.push_back(-pip[0]);cppim.push_back(-pip[1]);cppim.push_back(-pip[2]);cppim.push_back(pip[3]);
2142 cppip.push_back(-pim[0]);cppip.push_back(-pim[1]);cppip.push_back(-pim[2]);cppip.push_back(pim[3]);
2143 cppi0.push_back(-pi0[0]);cppi0.push_back(-pi0[1]);cppi0.push_back(-pi0[2]);cppi0.push_back(pi0[3]);
2144 D0bar = tKSpipipi0.
Amp(cpk0l, cppip, cppim, cppi0);
2145
2146
2147
2148
2149
2150
2151
2152
2153 }
2154
2155 if( charm == 1){
2156
2157 r2D0 = std::norm(D0bar)/std::norm(D0);
2158 double temp = std::arg(D0)-std::arg(D0bar);
2159 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
2160 while (temp < -TMath::Pi())
2161 {
2162 temp += 2.0 * TMath::Pi();
2163 }
2164 while (temp > TMath::Pi())
2165 {
2166 temp -= 2.0 * TMath::Pi();
2167 }
2168 deltaD0 = temp;
2169 deltaD0 = isKsPiPiPi0 ? (deltaD0+
PI) : (deltaD0);
2170
2171 double cosd =
cos(deltaD0);
2172 double sind =
sin(deltaD0);
2173 if( mpn_gen - mnm_gen > 0. )
2174 {
2178 }
2179 }
2180 else {
2181 r2D0 = std::norm(D0)/std::norm(D0bar);
2182 double temp = std::arg(D0bar)-std::arg(D0);
2183 while (temp < -TMath::Pi())
2184 {
2185 temp += 2.0 * TMath::Pi();
2186 }
2187 while (temp > TMath::Pi())
2188 {
2189 temp -= 2.0 * TMath::Pi();
2190 }
2191 deltaD0 = temp;
2192 deltaD0 = isKsPiPiPi0 ? (deltaD0+
PI) : (deltaD0);
2193
2194 double cosd =
cos( deltaD0 ) ;
2195 double sind =
sin( deltaD0 ) ;
2196 if( mpn_gen - mnm_gen < 0. )
2197 {
2201 }
2202 }
2203 }else if( decay_mode == kKKPiPi ){
2204
2206
2208 vector<double> kp; vector<double> km; vector<double> pip;vector<double> pim;
2209 double pdau[16];
2210 pip.clear();pim.clear();
2211 kp.clear();km.clear();
2212
2213 HepLorentzVector pip_kkpipi = (piPlus_4pi.at(0));
2214 HepLorentzVector pim_kkpipi = (piMinus_4pi.at(0));
2215 HepLorentzVector kp_kkpipi = (kPlus_kkpipi.at(0));
2216 HepLorentzVector km_kkpipi = (kMinus_kkpipi.at(0));
2217
2218 pip.push_back(pip_kkpipi[0]);pip.push_back(pip_kkpipi[1]);pip.push_back(pip_kkpipi[2]);pip.push_back(pip_kkpipi[3]);
2219 pim.push_back(pim_kkpipi[0]);pim.push_back(pim_kkpipi[1]);pim.push_back(pim_kkpipi[2]);pim.push_back(pim_kkpipi[3]);
2220 kp.push_back(kp_kkpipi[0]);kp.push_back(kp_kkpipi[1]);kp.push_back(kp_kkpipi[2]);kp.push_back(kp_kkpipi[3]);
2221 km.push_back(km_kkpipi[0]);km.push_back(km_kkpipi[1]);km.push_back(km_kkpipi[2]);km.push_back(km_kkpipi[3]);
2222
2223 pdau[0]=kp_kkpipi[0]; pdau[1]=kp_kkpipi[1]; pdau[2]=kp_kkpipi[2]; pdau[3]=kp_kkpipi[3];
2224 pdau[4]=km_kkpipi[0]; pdau[5]=km_kkpipi[1]; pdau[6]=km_kkpipi[2]; pdau[7]=km_kkpipi[3];
2225 pdau[8]=pip_kkpipi[0];pdau[9]=pip_kkpipi[1];pdau[10]=pip_kkpipi[2];pdau[11]=pip_kkpipi[3];
2226 pdau[12]=pim_kkpipi[0];pdau[13]=pim_kkpipi[1];pdau[14]=pim_kkpipi[2];pdau[15]=pim_kkpipi[3];
2227
2229 D0 = tKKpipi.
AMP(pdau,1);
2230
2231 pdau[0]=-km_kkpipi[0]; pdau[1]=-km_kkpipi[1]; pdau[2]=-km_kkpipi[2]; pdau[3]=km_kkpipi[3];
2232 pdau[4]=-kp_kkpipi[0]; pdau[5]=-kp_kkpipi[1]; pdau[6]=-kp_kkpipi[2]; pdau[7]=kp_kkpipi[3];
2233 pdau[8]=-pim_kkpipi[0]; pdau[9]=-pim_kkpipi[1]; pdau[10]=-pim_kkpipi[2];pdau[11]=pim_kkpipi[3];
2234 pdau[12]=-pip_kkpipi[0];pdau[13]=-pip_kkpipi[1];pdau[14]=-pip_kkpipi[2];pdau[15]=pip_kkpipi[3];
2235 D0bar = tKKpipi.
AMP(pdau,1);
2236
2237 if( charm == 1){
2238
2239 r2D0 = std::norm(D0bar)/std::norm(D0);
2240 double temp = std::arg(D0)-std::arg(D0bar);
2241 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
2242 while (temp < -TMath::Pi())
2243 {
2244 temp += 2.0 * TMath::Pi();
2245 }
2246 while (temp > TMath::Pi())
2247 {
2248 temp -= 2.0 * TMath::Pi();
2249 }
2250 deltaD0 = temp;
2251 }
2252 else {
2253 r2D0 = std::norm(D0)/std::norm(D0bar);
2254 double temp = std::arg(D0bar)-std::arg(D0);
2255 while (temp < -TMath::Pi())
2256 {
2257 temp += 2.0 * TMath::Pi();
2258 }
2259 while (temp > TMath::Pi())
2260 {
2261 temp -= 2.0 * TMath::Pi();
2262 }
2263 deltaD0 = temp;
2264 }
2265
2266 }else if( decay_mode == kK0KK ){
2268
2269 HepLorentzVector kPlus = (kPlus_kkpipi.at(0));
2270 HepLorentzVector kMinus = (kMinus_kkpipi.at(0));
2272 vector<double> k0l;vector<double> kp;vector<double> km;
2273 k0l.clear();kp.clear();km.clear();
2274 k0l.push_back(k0[0]);k0l.push_back(k0[1]);k0l.push_back(k0[2]);k0l.push_back(k0[3]);
2275 kp.push_back(kPlus[0]);kp.push_back(kPlus[1]);kp.push_back(kPlus[2]);kp.push_back(kPlus[3]);
2276 km.push_back(kMinus[0]);km.push_back(kMinus[1]);km.push_back(kMinus[2]);km.push_back(kMinus[3]);
2277
2278 if(isKsKK){
2279
2280
2282 D0 = tKSLKK.
Amp(k0l,kp,km,310,0);
2283
2284 vector<double> cpk0l;vector<double> cpkp;vector<double> cpkm;
2285 cpk0l.clear();kp.clear();km.clear();
2286 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2287 cpkm.push_back(-kPlus[0]);cpkm.push_back(-kPlus[1]);cpkm.push_back(-kPlus[2]);cpkm.push_back(kPlus[3]);
2288 cpkp.push_back(-kMinus[0]);cpkp.push_back(-kMinus[1]);cpkp.push_back(-kMinus[2]);cpkp.push_back(kMinus[3]);
2289
2290 D0bar = tKSLKK.
Amp(cpk0l, cpkp, cpkm,310,0);
2291 }else{
2292
2293
2295 D0 = tKSLKK.
Amp(k0l,kp,km,130,1);
2296 vector<double> cpk0l;vector<double> cpkp;vector<double> cpkm;
2297 cpk0l.clear();kp.clear();km.clear();
2298 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2299 cpkm.push_back(-kPlus[0]);cpkm.push_back(-kPlus[1]);cpkm.push_back(-kPlus[2]);cpkm.push_back(kPlus[3]);
2300 cpkp.push_back(-kMinus[0]);cpkp.push_back(-kMinus[1]);cpkp.push_back(-kMinus[2]);cpkp.push_back(kMinus[3]);
2301
2302 D0bar = tKSLKK.
Amp(cpk0l, cpkp, cpkm,130,1);
2303 }
2304
2305 if( charm == 1){
2306
2307 r2D0 = std::norm(D0bar)/std::norm(D0);
2308 double temp = std::arg(D0)-std::arg(D0bar);
2309 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
2310 while (temp < -TMath::Pi())
2311 {
2312 temp += 2.0 * TMath::Pi();
2313 }
2314 while (temp > TMath::Pi())
2315 {
2316 temp -= 2.0 * TMath::Pi();
2317 }
2318 deltaD0 = temp;
2319 deltaD0 = isKsKK ? deltaD0 : (deltaD0+
PI);
2320
2321 }
2322 else {
2323 r2D0 = std::norm(D0)/std::norm(D0bar);
2324 double temp = std::arg(D0bar)-std::arg(D0);
2325 while (temp < -TMath::Pi())
2326 {
2327 temp += 2.0 * TMath::Pi();
2328 }
2329 while (temp > TMath::Pi())
2330 {
2331 temp -= 2.0 * TMath::Pi();
2332 }
2333 deltaD0 = temp;
2334 deltaD0 = isKsKK ? deltaD0 : (deltaD0+
PI);
2335
2336 }
2337
2338 }
2339 else if(
num[ kLeptonPlus ] == 1 )
2340 {
2341 decay_mode = kSLPlus ;
2343
2344 r2D0 = 0. ;
2345 deltaD0 = 0. ;
2346 }
2347 else if(
num[ kLeptonMinus ] == 1 )
2348 {
2349 decay_mode = kSLMinus ;
2351
2352 r2D0 = 0. ;
2353 deltaD0 = 0. ;
2354 }
2355
2356 else if( nDaughters == 3 &&
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1
2357 ){
2358
2359 if(m_debug)cout<<"PiPiPi0 mode"<<endl;
2360 decay_mode = kPipPimPi0 ;
2362
2363 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
2364 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
2365 HepLorentzVector pi01_p4 = (pi0_p4.at(0));
2366 pip1_4pi.boost(-0.011, 0, 0);
2367 pim1_4pi.boost(-0.011, 0, 0);
2368 pi01_p4.boost(-0.011, 0, 0);
2369 std::complex<double> D0, D0bar;
2370
2371
2372
2373
2374 std::vector<double> pip1; pip1.clear(); pip1.push_back(pip1_4pi[0]);pip1.push_back(pip1_4pi[1]);pip1.push_back(pip1_4pi[2]);pip1.push_back(pip1_4pi[3]);
2375 std::vector<double> pim1; pim1.clear(); pim1.push_back(pim1_4pi[0]);pim1.push_back(pim1_4pi[1]);pim1.push_back(pim1_4pi[2]);pim1.push_back(pim1_4pi[3]);
2376 std::vector<double> pi01; pi01.clear(); pi01.push_back(pi01_p4[0]);pi01.push_back(pi01_p4[1]);pi01.push_back(pi01_p4[2]);pi01.push_back(pi01_p4[3]);
2377
2379 D0 = tpipipi0.
Amp(pip1,pim1,pi01);
2380
2381
2382
2383
2384 std::vector<double> cppip1; cppip1.clear(); cppip1.push_back(-pim1_4pi[0]);cppip1.push_back(-pim1_4pi[1]);cppip1.push_back(-pim1_4pi[2]);cppip1.push_back(pim1_4pi[3]);
2385 std::vector<double> cppim1; cppim1.clear(); cppim1.push_back(-pip1_4pi[0]);cppim1.push_back(-pip1_4pi[1]);cppim1.push_back(-pip1_4pi[2]);cppim1.push_back(pip1_4pi[3]);
2386 std::vector<double> cppi01; cppi01.clear(); cppi01.push_back(-pi01_p4[0]);cppi01.push_back(-pi01_p4[1]);cppi01.push_back(-pi01_p4[2]);cppi01.push_back(pi01_p4[3]);
2387
2388 D0bar = (-1.0)*tpipipi0.
Amp(cppip1, cppim1, cppi01);
2389
2390 if( charm == 1){
2391
2392 r2D0 = std::norm(D0bar)/std::norm(D0);
2393 double temp = std::arg(D0)-std::arg(D0bar);
2394 while (temp < -TMath::Pi())
2395 {
2396 temp += 2.0 * TMath::Pi();
2397 }
2398 while (temp > TMath::Pi())
2399 {
2400 temp -= 2.0 * TMath::Pi();
2401 }
2402 deltaD0 = temp;
2403
2404 double cosd =
cos(deltaD0);
2405 double sind =
sin(deltaD0);
2406 }
2407 else {
2408 r2D0 = std::norm(D0)/std::norm(D0bar);
2409 double temp = std::arg(D0bar)-std::arg(D0);
2410 while (temp < -TMath::Pi())
2411 {
2412 temp += 2.0 * TMath::Pi();
2413 }
2414 while (temp > TMath::Pi())
2415 {
2416 temp -= 2.0 * TMath::Pi();
2417 }
2418 deltaD0 = temp;
2419
2420 double cosd =
cos( deltaD0 ) ;
2421 double sind =
sin( deltaD0 ) ;
2422
2423 }
2424 if(m_debug)cout<<"deltaD0="<<deltaD0<<endl;
2425 if(m_debug)cout<<"r2D0="<<r2D0<<endl;
2426
2427 }
2428
2429 else if(
2430 ( nDaughters == 2 &&
2431 ( (
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 ) ||
2432 nUFP0 == 2 ||
2433 num[ kNeutralScalar ] == 2 ||
2434 ( nUFP0 == 1 && nUFV0 == 1 ) ||
2435 (
num[ kKPlus ] == 1 &&
num[ kKMinus ] == 1 ) ||
2438 (
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
2439 (
num[ kK0S ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
2440 (
num[ kK0L ] == 1 && nUFV0 == 1 ) ||
2441 (
num[ kUFVPlus ] ==1 &&
num [ kPiMinus ] == 1 ) ||
2442 (
num[ kUFVMinus ] ==1 &&
num [ kPiPlus ] == 1 ) ) ) ||
2443 ( nDaughters == 3 &&
2444 ( ( nCPPlusEig == 1 &&
num[ kPi0 ] == 2 ) ||
2445 (
num[ kK0S ] == 3 ) || (
num[ kK0S ] == 1 &&
num[ kK0L ] == 2 ) ||
2446 (
num[ kK0S ] == 1 &&
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
2447 (
num[ kK0S ] == 1 && nUFP0 == 2 )
2448 ) ) ||
2449 ( nDaughters == 4 &&
2450 (
num[ kK0L ] == 1 && nUFP0 == 3 )||
2451 ( (
num[ kK0S ] == 2 ||
num[ kK0L ] == 2 ) && nUFP0 == 2 ) )
2452 )
2453 {
2454 decay_mode = kCPPlus ;
2456
2457 r2D0 = 1. ;
2458 deltaD0 = 0.;
2459 }
2460
2461 else if(
2462 ( nDaughters == 2 &&
2463 ( (
num[ kK0S ] == 1 && nUFP0 == 1 ) ||
2464 (
num[ kK0L ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
2465 (
num[ kK0S ] == 1 && nUFV0 == 1 ) ||
2466 (
num[ kNeutralScalar ] == 1 && nUFV0 == 1 ) ||
2467 ( nUFP0 == 1 &&
num[ kNeutralScalar ] == 1 ) ) ) ||
2468 ( nDaughters == 3 &&
2469 ( ( nCPMinusEig == 3 &&
num[ kPi0 ] == 2 ) ||
2470 (
num[ kPi0 ] == 3 ) ||
2471 (
num[ kK0L ] == 3 ) || (
num[ kK0S ] == 2 &&
num[ kK0L ] == 1 ) ||
2472 ( (
num[ kK0S ] == 2 ||
num[ kK0L ] == 2 ) && nUFP0 == 1 ) ||
2473 (
num[ kK0L ] == 1 && nUFP0 == 2 ) ) ) ||
2474 ( nDaughters == 4 &&
2475 (
num[ kK0S ] == 1 &&
num[ kPi0 ] == 3 )|| ( (
num[ kK0S ] == 1 &&
num[ kK0L ] == 1 ) && nUFP0 == 2 ) )
2476 )
2477 {
2478 decay_mode = kCPMinus ;
2480
2481 r2D0 = 1. ;
2483 }
2484 else if( nStrange == nAntiStrange + 1 )
2485 {
2486 if(m_debug)cout<< nDaughters <<endl;
2487 if(m_debug)cout<<
num[ kKMinus ]<<endl;
2488 if(m_debug)cout<<
num[ kPiMinus ]<<endl;
2489 if(m_debug)cout<<
num[ kPiPlus ]<<endl;
2490 if( charm == 1 )
2491 {
2492 if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 2 &&
num[ kPiMinus ] == 1 ) && nDaughters == 4 ){
2493 if(m_debug)cout<< "True K-3Pi "<<endl;
2494 decay_mode = kFlavoredCF_3 ;
2496
2498 vector<double> kp; vector<double> pi1; vector<double>
pi2;vector<double> pi3;
2499 double pdau[16];
2500 pi1.clear();
pi2.clear();pi3.clear();
2501 kp.clear();
2502
2503 HepLorentzVector kp_kpipipi = (kMinus_kkpipi.at(0));
2504 HepLorentzVector pi1_kpipipi = (piPlus_4pi.at(0));
2505 HepLorentzVector pi2_kpipipi = (piPlus_4pi.at(1));
2506 HepLorentzVector pi3_kpipipi = (piMinus_4pi.at(0));
2507
2508 kp.push_back( kp_kpipipi[0]); kp.push_back(kp_kpipipi[1]); kp.push_back(kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2509 pi1.push_back(pi1_kpipipi[0]);pi1.push_back(pi1_kpipipi[1]);pi1.push_back(pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2510 pi2.push_back(pi2_kpipipi[0]);
pi2.push_back(pi2_kpipipi[1]);
pi2.push_back(pi2_kpipipi[2]);
pi2.push_back(pi2_kpipipi[3]);
2511 pi3.push_back(pi3_kpipipi[0]);pi3.push_back(pi3_kpipipi[1]);pi3.push_back(pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2512
2513 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2514 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2515 pdau[8]=
pi2[0]; pdau[9]=
pi2[1]; pdau[10]=
pi2[2];pdau[11]=
pi2[3];
2516 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2517
2519 D0 = tKpipipi.
AMP(pdau,1);
2520
2522 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2523 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2524 deltaD0 = ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2525 r2D0 = std::norm(D0bar)/std::norm(D0);
2526
2527 }
else if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2528 decay_mode = kFlavoredCF_1 ;
2530 r2D0 = pow(m_rCF_1,2) ;
2532 RD0 = m_RCF_1;
2533 }else{
2534
2535 if(m_debug)cout<< "True K-Pi "<<endl;
2536 decay_mode = kFlavoredCF_0 ;
2538 r2D0 = pow(m_rCF_0,2) ;
2540 RD0 = m_RCF_0;
2541 }
2542 }
2543 else
2544 {
2545 if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 2 &&
num[ kPiMinus ] == 1 ) && nDaughters == 4 ){
2546 decay_mode = kFlavoredCF_3 ;
2548
2550 vector<double> kp; vector<double> pi1; vector<double>
pi2;vector<double> pi3;
2551 double pdau[16];
2552 pi1.clear();
pi2.clear();pi3.clear();
2553 kp.clear();
2554
2555 HepLorentzVector kp_kpipipi = (kMinus_kkpipi.at(0));
2556 HepLorentzVector pi1_kpipipi = (piPlus_4pi.at(0));
2557 HepLorentzVector pi2_kpipipi = (piPlus_4pi.at(1));
2558 HepLorentzVector pi3_kpipipi = (piMinus_4pi.at(0));
2559
2560 kp.push_back( kp_kpipipi[0]); kp.push_back(kp_kpipipi[1]); kp.push_back(kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2561 pi1.push_back(pi1_kpipipi[0]);pi1.push_back(pi1_kpipipi[1]);pi1.push_back(pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2562 pi2.push_back(pi2_kpipipi[0]);
pi2.push_back(pi2_kpipipi[1]);
pi2.push_back(pi2_kpipipi[2]);
pi2.push_back(pi2_kpipipi[3]);
2563 pi3.push_back(pi3_kpipipi[0]);pi3.push_back(pi3_kpipipi[1]);pi3.push_back(pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2564
2565 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2566 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2567 pdau[8]=
pi2[0]; pdau[9]=
pi2[1]; pdau[10]=
pi2[2];pdau[11]=
pi2[3];
2568 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2569
2571 D0 = tKpipipi.
AMP(pdau,1);
2572
2574 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2575 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2576 deltaD0 = - ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2577 r2D0 = std::norm(D0)/std::norm(D0bar);
2578
2579 }
else if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2580 decay_mode = kFlavoredCF_1 ;
2582 r2D0 = 1. / pow( m_rCF_1,2 ) ;
2584 RD0 = m_RCF_1;
2585 }else{
2586
2587 decay_mode = kFlavoredCF_0 ;
2589 r2D0 = 1. / pow( m_rCF_0,2 ) ;
2591 RD0 = m_RCF_0;
2592 }
2593 }
2594 }
2595 else if( nAntiStrange == nStrange + 1 )
2596 {
2597 if( charm == -1 )
2598 {
2599 if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 2 &&
num[ kPiPlus ] == 1 ) && nDaughters == 4 ){
2600 decay_mode = kFlavoredCFBar_3 ;
2602
2604 vector<double> kp; vector<double> pi1; vector<double>
pi2;vector<double> pi3;
2605 double pdau[16];
2606 pi1.clear();
pi2.clear();pi3.clear();
2607 kp.clear();
2608
2609 HepLorentzVector kp_kpipipi = (kPlus_kkpipi.at(0));
2610 HepLorentzVector pi1_kpipipi = (piMinus_4pi.at(0));
2611 HepLorentzVector pi2_kpipipi = (piMinus_4pi.at(1));
2612 HepLorentzVector pi3_kpipipi = (piPlus_4pi.at(0));
2613
2614 kp.push_back( -kp_kpipipi[0]); kp.push_back(-kp_kpipipi[1]); kp.push_back(-kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2615 pi1.push_back(-pi1_kpipipi[0]);pi1.push_back(-pi1_kpipipi[1]);pi1.push_back(-pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2616 pi2.push_back(-pi2_kpipipi[0]);
pi2.push_back(-pi2_kpipipi[1]);
pi2.push_back(-pi2_kpipipi[2]);
pi2.push_back(pi2_kpipipi[3]);
2617 pi3.push_back(-pi3_kpipipi[0]);pi3.push_back(-pi3_kpipipi[1]);pi3.push_back(-pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2618
2619 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2620 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2621 pdau[8]=
pi2[0]; pdau[9]=
pi2[1]; pdau[10]=
pi2[2];pdau[11]=
pi2[3];
2622 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2623
2625 D0 = tKpipipi.
AMP(pdau,1);
2626
2628 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2629 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2630 deltaD0 = ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2631 r2D0 = std::norm(D0bar)/std::norm(D0);
2632
2633
2634 }
else if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2635 decay_mode = kFlavoredCFBar_1 ;
2637 r2D0 = pow(m_rCF_1,2) ;
2639 RD0 = m_RCF_1;
2640 }else{
2641
2642 decay_mode = kFlavoredCFBar_0 ;
2644 r2D0 = pow(m_rCF_0,2) ;
2646 RD0 = m_RCF_0;
2647 }
2648 }
2649 else
2650 {
2651 if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 2 &&
num[ kPiPlus ] == 1 ) && nDaughters == 4 ){
2652 decay_mode = kFlavoredCFBar_3 ;
2654
2656 vector<double> kp; vector<double> pi1; vector<double>
pi2;vector<double> pi3;
2657 double pdau[16];
2658 pi1.clear();
pi2.clear();pi3.clear();
2659 kp.clear();
2660
2661 HepLorentzVector kp_kpipipi = (kPlus_kkpipi.at(0));
2662 HepLorentzVector pi1_kpipipi = (piMinus_4pi.at(0));
2663 HepLorentzVector pi2_kpipipi = (piMinus_4pi.at(1));
2664 HepLorentzVector pi3_kpipipi = (piPlus_4pi.at(0));
2665
2666 kp.push_back( -kp_kpipipi[0]); kp.push_back(-kp_kpipipi[1]); kp.push_back(-kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2667 pi1.push_back(-pi1_kpipipi[0]);pi1.push_back(-pi1_kpipipi[1]);pi1.push_back(-pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2668 pi2.push_back(-pi2_kpipipi[0]);
pi2.push_back(-pi2_kpipipi[1]);
pi2.push_back(-pi2_kpipipi[2]);
pi2.push_back(pi2_kpipipi[3]);
2669 pi3.push_back(-pi3_kpipipi[0]);pi3.push_back(-pi3_kpipipi[1]);pi3.push_back(-pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2670
2671 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2672 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2673 pdau[8]=
pi2[0]; pdau[9]=
pi2[1]; pdau[10]=
pi2[2];pdau[11]=
pi2[3];
2674 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2675
2677 D0 = tKpipipi.
AMP(pdau,1);
2678
2680 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2681 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2682 deltaD0 = - ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2683 r2D0 = std::norm(D0)/std::norm(D0bar);
2684
2685 }
else if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2686 decay_mode = kFlavoredCFBar_1 ;
2688 r2D0 = 1. / pow( m_rCF_1,2 ) ;
2690 RD0 = m_RCF_1;
2691 }else{
2692
2693 decay_mode = kFlavoredCFBar_0 ;
2695 r2D0 = 1. / pow( m_rCF_0,2 ) ;
2697 RD0 = m_RCF_0;
2698 }
2699 }
2700 }
2701 else if( nStrange == nAntiStrange )
2702 {
2703 if( (
num[ kKPlus ] > 0 &&
2704 (
num[ kKPlus ] ==
num[ kFVMinus ] ||
2705 num[ kKPlus ] == nFV0Bar ) ) ||
2706 ( nK0 > 0 &&
2707 nFV0 != nFV0Bar &&
2708 nK0 == nFV0Bar ) ||
2709 (
num[ kPiPlus ] > 0 &&
2710 num[ kPiPlus ] ==
num[ kUFVMinus ] ) )
2711 {
2712 decay_mode = kFlavoredCS ;
2714
2715 if( charm == 1 )
2716 {
2717 r2D0 = pow( m_rCS, 2 ) ;
2719 }
2720 else
2721 {
2722 r2D0 = 1. / pow( m_rCS, 2 ) ;
2724 }
2725 }
2726 else if( (
num[ kKMinus ] > 0 && (
num[ kKMinus ] ==
num[ kFVPlus ] ||
num[ kKMinus ] == nFV0 ) ) ||
2727 ( nK0 > 0 && nFV0 != nFV0Bar && nK0 == nFV0 ) ||
2728 (
num[ kPiMinus ] > 0 &&
num[ kPiMinus ] ==
num[ kUFVPlus ] ) )
2729 {
2730 decay_mode = kFlavoredCSBar ;
2732
2733 if( charm == -1 )
2734 {
2735 r2D0 = pow( m_rCS, 2 ) ;
2737 }
2738 else
2739 {
2740 r2D0 = 1. / pow( m_rCS, 2 ) ;
2742 }
2743 }
2744
2745
2746
2747
2748 else if( ( nDaughters >= 3 &&
num[ kPiPlus ] ==
num[ kPiMinus ] &&
2749 num[ kKPlus ] ==
num[ kKMinus ] && nChargedPiK + nCPEig == nDaughters ) ||
2750 nUFV0 == nDaughters ||
2751 (
num[ kKStar0 ] > 0 &&
num[ kKStar0 ] ==
num[ kKStar0Bar ] ) ||
2752 (
num[ kK10 ] > 0 &&
num[ kK10 ] ==
num[ kK10Bar ] ) ||
2753 (
num[ kUFVPlus ] == 1 &&
num[ kUFVMinus ] == 1 )
2754
2755 )
2756 {
2757 log << MSG::DEBUG <<" [ Self-conjugate mixed-CP ]" << endmsg ;
2758
2759 if( RandFlat::shoot() > 0.5 )
2760 {
2761 if( RandFlat::shoot() > 0.5 )
2762 {
2763 decay_mode = kCPPlus ;
2765
2766 r2D0 = 1. ;
2768 }
2769 else
2770 {
2771 decay_mode = kCPMinus ;
2773
2774 r2D0 = 1. ;
2775 deltaD0 = 0. ;
2776 }
2777 }
2778 else
2779 {
2780
2781 if( nK0 % 2 )
2782 {
2783
2785
2786 if( charm == -1 )
2787 {
2788 cutoff = 1. - cutoff ;
2789 }
2790
2791 log << MSG::DEBUG <<" [ cutoff = " << cutoff << " ]" << endmsg ;
2792
2793 decay_mode = ( RandFlat::shoot() > cutoff ) ? kFlavoredCF_0 : kFlavoredCFBar_0 ;
2794
2795 if( ( decay_mode == kFlavoredCF_0 && charm == 1 ) ||
2796 ( decay_mode == kFlavoredCFBar_0 && charm == -1 ) )
2797 {
2799
2800 r2D0 = sqrt( m_rCF_0 ) ;
2802 }
2803 else
2804 {
2806
2807 r2D0 = 1. / sqrt( m_rCF_0 ) ;
2809 }
2810 }
2811 else
2812 {
2813
2815
2816 if( charm == -1 )
2817 {
2818 cutoff = 1. - cutoff ;
2819 }
2820
2821 log << MSG::DEBUG <<" [ cutoff = " << cutoff << " ]" << endmsg ;
2822
2823 decay_mode = ( RandFlat::shoot() > cutoff ) ?
2824 kFlavoredCS : kFlavoredCSBar ;
2826
2827 if( ( decay_mode == kFlavoredCS && charm == 1 ) ||
2828 ( decay_mode == kFlavoredCSBar && charm == -1 ) )
2829 {
2830 r2D0 = sqrt( m_rCS ) ;
2832 }
2833 else
2834 {
2835 r2D0 = 1. / sqrt( m_rCS ) ;
2837 }
2838 }
2839 }
2840 }
2841 }
2842
2843 if (
num[kUnknown] >= 1)
2844 {
2845 cout << "decay mode " << decay_mode << endl ;
2846 cout << "D #" << charm << endl ;
2847 cout <<
"pi+: " <<
num[ kPiPlus ] << endl ;
2848 cout <<
"pi-: " <<
num[ kPiMinus ] << endl ;
2849 cout <<
"pi0: " <<
num[ kPi0 ] << endl ;
2850 cout <<
"eta: " <<
num[ kEta ] << endl ;
2851 cout <<
"eta': " <<
num[ kEtaPrime ] << endl ;
2852 cout <<
"f0/a0: " <<
num[ kNeutralScalar ] << endl ;
2853 cout <<
"UFV+: " <<
num[ kUFVPlus ] << endl ;
2854 cout <<
"UFV-: " <<
num[ kUFVMinus ] << endl ;
2855 cout <<
"rho0: " <<
num[ kRho0 ] << endl ;
2856 cout <<
"omega: " <<
num[ kOmega ] << endl ;
2857 cout <<
"phi: " <<
num[ kPhi ] << endl ;
2858 cout <<
"K+: " <<
num[ kKPlus ] << endl ;
2859 cout <<
"K-: " <<
num[ kKMinus ] << endl ;
2860 cout <<
"K0S: " <<
num[ kK0S ] << endl ;
2861 cout <<
"K0L: " <<
num[ kK0L ] << endl ;
2862 cout <<
"FV+: " <<
num[ kFVPlus ] << endl ;
2863 cout <<
"FV-: " <<
num[ kFVMinus ] << endl ;
2864 cout <<
"K*0: " <<
num[ kKStar0 ] << endl ;
2865 cout <<
"K*0b: " <<
num[ kKStar0Bar ] << endl ;
2866 cout <<
"K10: " <<
num[ kK10 ] << endl ;
2867 cout <<
"K10b: " <<
num[ kK10Bar ] << endl ;
2868 cout <<
"l+: " <<
num[ kLeptonPlus ] << endl ;
2869 cout <<
"l-: " <<
num[ kLeptonMinus ] << endl ;
2870 cout <<
"nu: " <<
num[ kNeutrino ] << endl ;
2871 cout <<
"gamma: " <<
num[ kGamma ] << endl ;
2872 cout <<
"Unknown: " <<
num[ 25 ] << endl ;
2873 }
2874
2875
2876 d0_info[0]=decay_mode;
2877 d0_info[1]=r2D0;
2878 d0_info[2]=deltaD0;
2879 d0_info[3]=RD0;
2880 d0_info[4]=FCP;
2881 d0_info[5]=mnm_gen;
2882 d0_info[6]=mpn_gen;
2883 d0_info[7]= double (isKsPiPi);
2884 d0_info[8]=mpm_gen;
2885 return d0_info;
2886}
character *LEPTONflag integer iresonances real pi2
EvtComplex exp(const EvtComplex &c)
double m_PipPim2Pi0Numer2
double m_PipPim2Pi0Numer1
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations xmb DOUBLE PRECISION xcb DOUBLE PRECISION xmpi0
complex< double > Amp(vector< double > Pip1, vector< double > Pim1, vector< double > Pip2, vector< double > Pim2)
complex< double > AMP(double const *x0, const int &x1)
complex< double > Amp_PFT(vector< double > k0l, vector< double > pip, vector< double > pim)
void init(int Daug0Id, int Uspin)
complex< double > Amp(vector< double > k0l, vector< double > kp, vector< double > km, int Daug0Id, int Uspin)
complex< double > Amp_PFT(vector< double > k0l, vector< double > pip, vector< double > pim)
complex< double > Amp(vector< double > ks0, vector< double > pip, vector< double > pim, vector< double > pi0)
std::complex< double > AMP(const double *x0, const int &x1)
complex< double > AMP(double const *x0, const int &x1)
complex< double > Amp(vector< double > Pip, vector< double > Pim, vector< double > Pi0)
complex< double > Amp(vector< double > Pip, vector< double > Pim, vector< double > Pi01, vector< double > Pi02)