1508{
1509 MsgStream log(
msgSvc(), name());
1510 log << MSG::INFO <<" In findD0Decay " << endmsg ;
1511 vector<double> d0_info(9);
1512 for(int i=0; i< 8; i++) d0_info[i]=0;
1513 double decay_mode = 18;
1514 double r2D0 = -1;
1515 double deltaD0 = -1;
1516 double RD0 = 1;
1517 double FCP = 1;
1518
1520 for(
int i=0; i< 26; i++)
num[i]=0;
1521
1522 int kPiPlus = 0;
1523 int kPiMinus = 1;
1524 int kPi0 = 2;
1525 int kEta = 3;
1526 int kEtaPrime = 4;
1527 int kNeutralScalar = 5;
1528 int kUFVPlus = 6;
1529 int kUFVMinus = 7;
1530 int kRho0 = 8;
1531 int kOmega = 9;
1532 int kPhi = 10;
1533 int kKPlus = 11;
1534 int kKMinus = 12;
1535 int kK0S = 13;
1536 int kK0L = 14;
1537 int kFVPlus = 15;
1538 int kFVMinus = 16;
1539 int kKStar0 = 17;
1540 int kKStar0Bar = 18;
1541 int kK10 = 19;
1542 int kK10Bar = 20;
1543 int kLeptonPlus = 21;
1544 int kLeptonMinus = 22;
1545 int kNeutrino = 23;
1546 int kGamma = 24;
1547 int kUnknown = 25;
1548
1549
1550
1552 int d0_pdg = charm == 1 ? kD0ID : kD0BarID;
1553
1554 HepLorentzVector piPlus, piMinus, k0;
1555 vector<HepLorentzVector> piPlus_4pi, piMinus_4pi, pi0_p4;
1556 vector<HepLorentzVector> kPlus_kkpipi, kMinus_kkpipi;
1557 piPlus_4pi.clear();piMinus_4pi.clear(), pi0_p4.clear();
1558 kPlus_kkpipi.clear();kMinus_kkpipi.clear();
1559
1560 for( Event::McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++)
1561 {
1562 int pdg_code = (*it)->particleProperty();
1563 if ((*it)->primaryParticle()) continue;
1565 int mother_pdg = 0;
1566
1567
1569
1570
1571 if (pdg_code == kKStar0ID || pdg_code == kKStar0BarID || pdg_code == kK0ID || pdg_code == kK0BarID || pdg_code == kKDPStar0ID || pdg_code == kKDPStar0BarID
1572 || pdg_code == kK10ID || pdg_code == kK10BarID
1573 || pdg_code == kK0Star0ID || pdg_code == kK0Star0BarID || pdg_code == kK0StarPlusID || pdg_code == kK0BarID ) continue;
1574
1575 if (mother_pdg == kK0ID || mother_pdg == kK0BarID) {
1578
1579 if (mother_pdg == kKStar0ID || mother_pdg == kKStar0BarID) {
1580
1581
1582 if (pdg_code == kPiPlusID || pdg_code == kPiMinusID) continue;
1583 if (mother_pdg == kKStar0ID && pdg_code == kKPlusID) pdg_code = kKStar0ID;
1584 if (mother_pdg == kKStar0BarID && pdg_code == kKMinusID) pdg_code = kKStar0BarID;
1587 }
1588
1589 if ( mother_pdg == kK0Star0ID || mother_pdg == kK0Star0BarID ) {
1592 }
1593
1594 if (mother_pdg == kK10ID || mother_pdg == kK10BarID) {
1597 }
1598
1599
1600
1601
1602 if (mother_pdg == d0_pdg)
1603 {
1604 if (pdg_code == kPiPlusID || pdg_code == kA0PlusID )
num[0]++;
1605 else if (pdg_code == kPiMinusID || pdg_code == kA0MinusID )
num[1]++;
1606 else if (pdg_code == kPi0ID )
num[2]++;
1607 else if (pdg_code == kEtaID )
num[3]++;
1608 else if (pdg_code == kEtaPrimeID )
num[4]++;
1609 else if (pdg_code == kF0ID || pdg_code == kA00ID
1610 || pdg_code == kFPrime0ID|| pdg_code == kF0m1500ID
1611 || pdg_code == kF2ID)
num[5]++;
1612 else if (pdg_code == kRhoPlusID || pdg_code == kRho2SPlusID
1613 || pdg_code == kA1PlusID )
num[6]++;
1614 else if (pdg_code == kRhoMinusID || pdg_code == kRho2SMinusID
1615 || pdg_code == kA1MinusID)
num[7]++;
1616 else if (pdg_code == kRho0ID || pdg_code == kRho2S0ID)
num[8]++;
1617 else if (pdg_code == kOmegaID )
num[9]++;
1618 else if (pdg_code == kPhiID )
num[10]++;
1619 else if (pdg_code == kKPlusID )
num[11]++;
1620 else if (pdg_code == kKMinusID )
num[12]++;
1621 else if (pdg_code == kK0SID )
num[13]++;
1622 else if (pdg_code == kK0LID )
num[14]++;
1623 else if (pdg_code == kKStarPlusID || pdg_code == kK1PlusID
1624 || pdg_code == kK2StarPlusID || pdg_code == kK1PrimePlusID
1625 || pdg_code == kK0StarPlusID)
num[15]++;
1626 else if (pdg_code == kKStarMinusID || pdg_code == kK1MinusID
1627 || pdg_code == kK2StarMinusID || pdg_code == kK1PrimeMinusID
1628 || pdg_code == kK0StarMinusID )
num[16]++;
1629 else if (pdg_code == kKStar0ID )
num[17]++;
1630 else if (pdg_code == kKStar0BarID )
num[18]++;
1631 else if (pdg_code == kK10ID || pdg_code == kK1Prime0ID)
num[19]++;
1632 else if (pdg_code == kK10BarID || pdg_code == kK1Prime0BarID)
num[20]++;
1633 else if (pdg_code == kEPlusID || pdg_code == kMuPlusID )
num[21]++;
1634 else if (pdg_code == kEMinusID || pdg_code == kMuMinusID )
num[22]++;
1635 else if (pdg_code == kNuEID || pdg_code == kNuEBarID
1636 || pdg_code == kNuMuID || pdg_code == kNuMuBarID )
num[23]++;
1637 else if (pdg_code == kGammaID )
num[24]++;
1638 else if (pdg_code == kGammaFSRID ) continue;
1639 else {
1641 cout <<"Unknown particle: "<< pdg_code << endl;
1642 }
1643
1644
1645
1646
1647
1648
1649
1650
1651 if (pdg_code == kPiPlusID) piPlus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1652 if (pdg_code == kPiMinusID) piMinus.setVectM((*it)->initialFourMomentum().vect(),
xmpion);
1653 if (pdg_code == kK0SID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1654 if (pdg_code == kK0LID) k0.setVectM((*it)->initialFourMomentum().vect(),
xmk0);
1655 HepLorentzVector daughterP4;
1656 if(piPlus_4pi.size()>2||piMinus_4pi.size()>2)continue;
1657 if(kPlus_kkpipi.size()>1||kMinus_kkpipi.size()>1)continue;
1658
1659 if (pdg_code == kPiPlusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpion);piPlus_4pi.push_back(daughterP4);}
1660 if (pdg_code == kPiMinusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpion);piMinus_4pi.push_back(daughterP4);}
1661 if (pdg_code == kKPlusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmkaon);kPlus_kkpipi.push_back(daughterP4);}
1662 if (pdg_code == kKMinusID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmkaon);kMinus_kkpipi.push_back(daughterP4);}
1663 if (pdg_code == kPi0ID) {daughterP4.setVectM((*it)->initialFourMomentum().vect(),
xmpi0);pi0_p4.push_back(daughterP4);}
1664 }
1665 }
1666
1667
1668 int nDaughters = 0 ;
1669 for( int i = 0 ; i < 26 ; i++ )
1670 {
1671 nDaughters +=
num[ i ] ;
1672 }
1673
1674 int nUFP0 =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] ;
1675 int nUFV0 =
num[ kRho0 ] +
num[ kPhi ] +
num[ kOmega ] +
num[ kGamma ] ;
1676 int nFV0 =
num[ kKStar0 ] +
num[ kK10 ] ;
1677 int nFV0Bar =
num[ kKStar0Bar ] +
num[ kK10Bar ] ;
1678 int nStrange =
num[ kKMinus ] +
num[ kFVMinus ] + nFV0Bar ;
1679 int nAntiStrange =
num[ kKPlus ] +
num[ kFVPlus ] + nFV0 ;
1680 int nCPPlusEig =
num[ kNeutralScalar ] +
num[ kRho0 ] +
num[ kOmega ] +
num[ kPhi ] +
num[ kK0S ] +
num[ kGamma ] ;
1681 int nCPMinusEig =
num[ kPi0 ] +
num[ kEta ] +
num[ kEtaPrime ] +
num[ kK0L ] ;
1682 int nCPEig = nCPPlusEig + nCPMinusEig ;
1683 int nChargedPiK =
num[ kPiPlus ] +
num[ kPiMinus ] +
num[ kKPlus ] +
num[ kKMinus ] ;
1684 int nK0 =
num[ kK0S ] +
num[ kK0L ] ;
1685
1686
1687
1688 double mnm_gen = 0. ;
1689 double mpn_gen = 0. ;
1690 double mpm_gen = 0. ;
1691 bool isKsPiPi =
false ;
1692 bool isKsPiPiPi0 =
false ;
1693
1694
1695
1696
1697 if( nK0 == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] && nDaughters == 3 )
1698 {
1699 decay_mode = kDalitz ;
1700
1701
1702
1703
1704
1705
1706 if(
num[ kK0S ] == 1) isKsPiPi =
true ;
1707 }
1708 if(
num[ kPiPlus ] == 2&&
num[ kPiMinus ]==2 && nDaughters == 4 )
1709 {
1710 decay_mode = k2Pip2Pim;
1711 }
1712 if(
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kPi0 ]==2 && nDaughters == 4 )
1713 {
1714 decay_mode = kPipPim2Pi0;
1715 }
1716 if( nK0 == 1 &&
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kPi0 ]==1 && nDaughters == 4 )
1717 {
1718 decay_mode = kK0PiPiPi0;
1719 if(
num[ kK0S ] == 1) isKsPiPiPi0 =
true ;
1720 }
1721 if(
num[ kPiPlus ] == 1&&
num[ kPiMinus ]==1 &&
num[ kKPlus ] == 1&&
num[ kKMinus ]==1 && nDaughters == 4 )
1722 {
1723 decay_mode = kKKPiPi;
1724 }
1725
1726
1727 if( decay_mode == kDalitz )
1728 {
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1744 vector<double> k0l;vector<double> pip;vector<double> pim;
1745 k0l.clear();pip.clear();pim.clear();
1746 k0l.push_back(k0[0]);k0l.push_back(k0[1]);k0l.push_back(k0[2]);k0l.push_back(k0[3]);
1747 pip.push_back(piPlus[0]);pip.push_back(piPlus[1]);pip.push_back(piPlus[2]);pip.push_back(piPlus[3]);
1748 pim.push_back(piMinus[0]);pim.push_back(piMinus[1]);pim.push_back(piMinus[2]);pim.push_back(piMinus[3]);
1749
1750 if(isKsPiPi){
1752 D0 = tKSpipi.
Amp_PFT(k0l,pip,pim);
1753
1754 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;
1755 cpk0l.clear();pip.clear();pim.clear();
1756 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
1757 cppim.push_back(-piPlus[0]);cppim.push_back(-piPlus[1]);cppim.push_back(-piPlus[2]);cppim.push_back(piPlus[3]);
1758 cppip.push_back(-piMinus[0]);cppip.push_back(-piMinus[1]);cppip.push_back(-piMinus[2]);cppip.push_back(piMinus[3]);
1759 D0bar = tKSpipi.
Amp_PFT(cpk0l, cppip, cppim);
1760 }else{
1762 D0 = tKLpipi.
Amp_PFT(k0l,pip,pim);
1763 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;
1764 cpk0l.clear();pip.clear();pim.clear();
1765 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
1766 cppim.push_back(-piPlus[0]);cppim.push_back(-piPlus[1]);cppim.push_back(-piPlus[2]);cppim.push_back(piPlus[3]);
1767 cppip.push_back(-piMinus[0]);cppip.push_back(-piMinus[1]);cppip.push_back(-piMinus[2]);cppip.push_back(piMinus[3]);
1768 D0bar = tKLpipi.
Amp_PFT(cpk0l, cppip, cppim);
1769 }
1770
1771 if( charm == 1){
1772
1773 r2D0 = std::norm(D0bar)/std::norm(D0);
1774 double temp = std::arg(D0)-std::arg(D0bar);
1775 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
1776 while (temp < -TMath::Pi())
1777 {
1778 temp += 2.0 * TMath::Pi();
1779 }
1780 while (temp > TMath::Pi())
1781 {
1782 temp -= 2.0 * TMath::Pi();
1783 }
1784 deltaD0 = temp;
1785 deltaD0 = isKsPiPi ? deltaD0 : (deltaD0+
PI);
1786
1787 double cosd =
cos(deltaD0);
1788 double sind =
sin(deltaD0);
1789 if( mpn_gen - mnm_gen > 0. )
1790 {
1794 }
1795 }
1796 else {
1797 r2D0 = std::norm(D0)/std::norm(D0bar);
1798 double temp = std::arg(D0bar)-std::arg(D0);
1799 while (temp < -TMath::Pi())
1800 {
1801 temp += 2.0 * TMath::Pi();
1802 }
1803 while (temp > TMath::Pi())
1804 {
1805 temp -= 2.0 * TMath::Pi();
1806 }
1807 deltaD0 = temp;
1808 deltaD0 = isKsPiPi ? deltaD0 : (deltaD0+
PI);
1809
1810 double cosd =
cos( deltaD0 ) ;
1811 double sind =
sin( deltaD0 ) ;
1812 if( mpn_gen - mnm_gen < 0. )
1813 {
1817 }
1818 }
1819 }else if( decay_mode == k2Pip2Pim ){
1820
1822
1823 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
1824 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
1825 HepLorentzVector pip2_4pi = (piPlus_4pi.at(1));
1826 HepLorentzVector pim2_4pi = (piMinus_4pi.at(1));
1827 pip1_4pi.boost(-0.011, 0, 0);
1828 pip2_4pi.boost(-0.011, 0, 0);
1829 pim1_4pi.boost(-0.011, 0, 0);
1830 pim2_4pi.boost(-0.011, 0, 0);
1831 std::complex<double> D0, D0bar;
1832
1833
1834
1835
1836 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]);
1837 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]);
1838 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]);
1839 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]);
1840
1842 D0 = t2pip2pim.
Amp(pip1,pim1,pip2,pim2);
1843
1844
1845
1846
1847 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]);
1848 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]);
1849 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]);
1850 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]);
1851
1852 D0bar = t2pip2pim.
Amp(cppip1, cppim1, cppip2, cppim2);
1853
1854 if( charm == 1){
1855
1856 r2D0 = std::norm(D0bar)/std::norm(D0);
1857 double temp = std::arg(D0)-std::arg(D0bar);
1858 while (temp < -TMath::Pi())
1859 {
1860 temp += 2.0 * TMath::Pi();
1861 }
1862 while (temp > TMath::Pi())
1863 {
1864 temp -= 2.0 * TMath::Pi();
1865 }
1866 deltaD0 = temp;
1867
1868 double cosd =
cos(deltaD0);
1869 double sind =
sin(deltaD0);
1870
1871
1875
1876 }
1877 else {
1878 r2D0 = std::norm(D0)/std::norm(D0bar);
1879 double temp = std::arg(D0bar)-std::arg(D0);
1880 while (temp < -TMath::Pi())
1881 {
1882 temp += 2.0 * TMath::Pi();
1883 }
1884 while (temp > TMath::Pi())
1885 {
1886 temp -= 2.0 * TMath::Pi();
1887 }
1888 deltaD0 = temp;
1889
1890 double cosd =
cos( deltaD0 ) ;
1891 double sind =
sin( deltaD0 ) ;
1892
1893
1897
1898 }
1899 }else if( decay_mode == kPipPim2Pi0 ){
1900
1902
1903
1904 HepLorentzVector pip1_4pi = (piPlus_4pi.at(0));
1905 HepLorentzVector pim1_4pi = (piMinus_4pi.at(0));
1906 HepLorentzVector pi01_p4 = (pi0_p4.at(0));
1907 HepLorentzVector pi02_p4 = (pi0_p4.at(1));
1908 pip1_4pi.boost(-0.011, 0, 0);
1909 pim1_4pi.boost(-0.011, 0, 0);
1910 pi01_p4.boost(-0.011, 0, 0);
1911 pi02_p4.boost(-0.011, 0, 0);
1912 std::complex<double> D0, D0bar;
1913
1914
1915
1916
1917 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]);
1918 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]);
1919 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]);
1920 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]);
1921
1923 D0 = tpippim2pi0.
Amp(pip1,pim1,pi01,pi02);
1924
1925
1926
1927
1928 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]);
1929 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]);
1930 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]);
1931 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]);
1932
1933 D0bar = tpippim2pi0.
Amp(cppip1, cppim1, cppi01, cppi02);
1934
1935 if( charm == 1){
1936
1937 r2D0 = std::norm(D0bar)/std::norm(D0);
1938 double temp = std::arg(D0)-std::arg(D0bar);
1939 while (temp < -TMath::Pi())
1940 {
1941 temp += 2.0 * TMath::Pi();
1942 }
1943 while (temp > TMath::Pi())
1944 {
1945 temp -= 2.0 * TMath::Pi();
1946 }
1947 deltaD0 = temp;
1948
1949 double cosd =
cos(deltaD0);
1950 double sind =
sin(deltaD0);
1951
1952
1956
1957 }
1958 else {
1959 r2D0 = std::norm(D0)/std::norm(D0bar);
1960 double temp = std::arg(D0bar)-std::arg(D0);
1961 while (temp < -TMath::Pi())
1962 {
1963 temp += 2.0 * TMath::Pi();
1964 }
1965 while (temp > TMath::Pi())
1966 {
1967 temp -= 2.0 * TMath::Pi();
1968 }
1969 deltaD0 = temp;
1970
1971 double cosd =
cos( deltaD0 ) ;
1972 double sind =
sin( deltaD0 ) ;
1973
1977 }
1978 }else if( decay_mode == kK0PiPiPi0 )
1979 {
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993 HepLorentzVector pip_kspipipi0 = (piPlus_4pi.at(0));
1994 HepLorentzVector pim_kspipipi0 = (piMinus_4pi.at(0));
1995 HepLorentzVector k0_kspipipi0 = k0;
1996 HepLorentzVector pi0_kspipipi0 = (pi0_p4.at(0));
1997 pip_kspipipi0.boost(-0.011, 0, 0);
1998 pim_kspipipi0.boost(-0.011, 0, 0);
1999 k0_kspipipi0.boost(-0.011, 0, 0);
2000 pi0_kspipipi0.boost(-0.011, 0, 0);
2001
2003 vector<double> k0l;vector<double> pip;vector<double> pim; vector<double> pi0;
2004 k0l.clear();pip.clear();pim.clear();pi0.clear();
2005 k0l.push_back(k0_kspipipi0[0]);k0l.push_back(k0_kspipipi0[1]);k0l.push_back(k0_kspipipi0[2]);k0l.push_back(k0_kspipipi0[3]);
2006 pip.push_back(pip_kspipipi0[0]);pip.push_back(pip_kspipipi0[1]);pip.push_back(pip_kspipipi0[2]);pip.push_back(pip_kspipipi0[3]);
2007 pim.push_back(pim_kspipipi0[0]);pim.push_back(pim_kspipipi0[1]);pim.push_back(pim_kspipipi0[2]);pim.push_back(pim_kspipipi0[3]);
2008 pi0.push_back(pi0_kspipipi0[0]);pi0.push_back(pi0_kspipipi0[1]);pi0.push_back(pi0_kspipipi0[2]);pi0.push_back(pi0_kspipipi0[3]);
2009
2010 if(isKsPiPiPi0){
2012 D0 = tKSpipipi0.
Amp(k0l,pip,pim,pi0);
2013
2014 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;vector<double> cppi0;
2015 cpk0l.clear();cppip.clear();cppim.clear();cppi0.clear();
2016 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2017 cppim.push_back(-pip[0]);cppim.push_back(-pip[1]);cppim.push_back(-pip[2]);cppim.push_back(pip[3]);
2018 cppip.push_back(-pim[0]);cppip.push_back(-pim[1]);cppip.push_back(-pim[2]);cppip.push_back(pim[3]);
2019 cppi0.push_back(-pi0[0]);cppi0.push_back(-pi0[1]);cppi0.push_back(-pi0[2]);cppi0.push_back(pi0[3]);
2020 D0bar = tKSpipipi0.
Amp(cpk0l, cppip, cppim, cppi0);
2021 }else{
2023 D0 = tKSpipipi0.
Amp(k0l,pip,pim,pi0);
2024
2025 vector<double> cpk0l;vector<double> cppip;vector<double> cppim;vector<double> cppi0;
2026 cpk0l.clear();cppip.clear();cppim.clear();cppi0.clear();
2027 cpk0l.push_back(-k0l[0]);cpk0l.push_back(-k0l[1]);cpk0l.push_back(-k0l[2]);cpk0l.push_back(k0l[3]);
2028 cppim.push_back(-pip[0]);cppim.push_back(-pip[1]);cppim.push_back(-pip[2]);cppim.push_back(pip[3]);
2029 cppip.push_back(-pim[0]);cppip.push_back(-pim[1]);cppip.push_back(-pim[2]);cppip.push_back(pim[3]);
2030 cppi0.push_back(-pi0[0]);cppi0.push_back(-pi0[1]);cppi0.push_back(-pi0[2]);cppi0.push_back(pi0[3]);
2031 D0bar = tKSpipipi0.
Amp(cpk0l, cppip, cppim, cppi0);
2032
2033
2034
2035
2036
2037
2038
2039
2040 }
2041
2042 if( charm == 1){
2043
2044 r2D0 = std::norm(D0bar)/std::norm(D0);
2045 double temp = std::arg(D0)-std::arg(D0bar);
2046 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
2047 while (temp < -TMath::Pi())
2048 {
2049 temp += 2.0 * TMath::Pi();
2050 }
2051 while (temp > TMath::Pi())
2052 {
2053 temp -= 2.0 * TMath::Pi();
2054 }
2055 deltaD0 = temp;
2056 deltaD0 = isKsPiPiPi0 ? (deltaD0+
PI) : (deltaD0);
2057
2058 double cosd =
cos(deltaD0);
2059 double sind =
sin(deltaD0);
2060 if( mpn_gen - mnm_gen > 0. )
2061 {
2065 }
2066 }
2067 else {
2068 r2D0 = std::norm(D0)/std::norm(D0bar);
2069 double temp = std::arg(D0bar)-std::arg(D0);
2070 while (temp < -TMath::Pi())
2071 {
2072 temp += 2.0 * TMath::Pi();
2073 }
2074 while (temp > TMath::Pi())
2075 {
2076 temp -= 2.0 * TMath::Pi();
2077 }
2078 deltaD0 = temp;
2079 deltaD0 = isKsPiPiPi0 ? (deltaD0+
PI) : (deltaD0);
2080
2081 double cosd =
cos( deltaD0 ) ;
2082 double sind =
sin( deltaD0 ) ;
2083 if( mpn_gen - mnm_gen < 0. )
2084 {
2088 }
2089 }
2090 }else if( decay_mode == kKKPiPi ){
2091
2093
2095 vector<double> kp; vector<double> km; vector<double> pip;vector<double> pim;
2096 double pdau[16];
2097 pip.clear();pim.clear();
2098 kp.clear();km.clear();
2099
2100 HepLorentzVector pip_kkpipi = (piPlus_4pi.at(0));
2101 HepLorentzVector pim_kkpipi = (piMinus_4pi.at(0));
2102 HepLorentzVector kp_kkpipi = (kPlus_kkpipi.at(0));
2103 HepLorentzVector km_kkpipi = (kMinus_kkpipi.at(0));
2104
2105 pip.push_back(pip_kkpipi[0]);pip.push_back(pip_kkpipi[1]);pip.push_back(pip_kkpipi[2]);pip.push_back(pip_kkpipi[3]);
2106 pim.push_back(pim_kkpipi[0]);pim.push_back(pim_kkpipi[1]);pim.push_back(pim_kkpipi[2]);pim.push_back(pim_kkpipi[3]);
2107 kp.push_back(kp_kkpipi[0]);kp.push_back(kp_kkpipi[1]);kp.push_back(kp_kkpipi[2]);kp.push_back(kp_kkpipi[3]);
2108 km.push_back(km_kkpipi[0]);km.push_back(km_kkpipi[1]);km.push_back(km_kkpipi[2]);km.push_back(km_kkpipi[3]);
2109
2110 pdau[0]=kp_kkpipi[0]; pdau[1]=kp_kkpipi[1]; pdau[2]=kp_kkpipi[2]; pdau[3]=kp_kkpipi[3];
2111 pdau[4]=km_kkpipi[0]; pdau[5]=km_kkpipi[1]; pdau[6]=km_kkpipi[2]; pdau[7]=km_kkpipi[3];
2112 pdau[8]=pip_kkpipi[0];pdau[9]=pip_kkpipi[1];pdau[10]=pip_kkpipi[2];pdau[11]=pip_kkpipi[3];
2113 pdau[12]=pim_kkpipi[0];pdau[13]=pim_kkpipi[1];pdau[14]=pim_kkpipi[2];pdau[15]=pim_kkpipi[3];
2114
2116 D0 = tKKpipi.
AMP(pdau,1);
2117
2118 pdau[0]=-km_kkpipi[0]; pdau[1]=-km_kkpipi[1]; pdau[2]=-km_kkpipi[2]; pdau[3]=km_kkpipi[3];
2119 pdau[4]=-kp_kkpipi[0]; pdau[5]=-kp_kkpipi[1]; pdau[6]=-kp_kkpipi[2]; pdau[7]=kp_kkpipi[3];
2120 pdau[8]=-pim_kkpipi[0]; pdau[9]=-pim_kkpipi[1]; pdau[10]=-pim_kkpipi[2];pdau[11]=pim_kkpipi[3];
2121 pdau[12]=-pip_kkpipi[0];pdau[13]=-pip_kkpipi[1];pdau[14]=-pip_kkpipi[2];pdau[15]=pip_kkpipi[3];
2122 D0bar = tKKpipi.
AMP(pdau,1);
2123
2124 if( charm == 1){
2125
2126 r2D0 = std::norm(D0bar)/std::norm(D0);
2127 double temp = std::arg(D0)-std::arg(D0bar);
2128 log << MSG::INFO << "D0 calculation " << sqrt(r2D0) << " "<< temp << endmsg;
2129 while (temp < -TMath::Pi())
2130 {
2131 temp += 2.0 * TMath::Pi();
2132 }
2133 while (temp > TMath::Pi())
2134 {
2135 temp -= 2.0 * TMath::Pi();
2136 }
2137 deltaD0 = temp;
2138 }
2139 else {
2140 r2D0 = std::norm(D0)/std::norm(D0bar);
2141 double temp = std::arg(D0bar)-std::arg(D0);
2142 while (temp < -TMath::Pi())
2143 {
2144 temp += 2.0 * TMath::Pi();
2145 }
2146 while (temp > TMath::Pi())
2147 {
2148 temp -= 2.0 * TMath::Pi();
2149 }
2150 deltaD0 = temp;
2151 }
2152
2153 }
else if(
num[ kLeptonPlus ] == 1 )
2154 {
2155 decay_mode = kSLPlus ;
2157
2158 r2D0 = 0. ;
2159 deltaD0 = 0. ;
2160 }
2161 else if(
num[ kLeptonMinus ] == 1 )
2162 {
2163 decay_mode = kSLMinus ;
2165
2166 r2D0 = 0. ;
2167 deltaD0 = 0. ;
2168 }
2169
2170 else if(
2171 ( nDaughters == 2 &&
2172 ( (
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 ) ||
2173 nUFP0 == 2 ||
2174 num[ kNeutralScalar ] == 2 ||
2175 ( nUFP0 == 1 && nUFV0 == 1 ) ||
2176 (
num[ kKPlus ] == 1 &&
num[ kKMinus ] == 1 ) ||
2179 (
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
2180 (
num[ kK0S ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
2181 (
num[ kK0L ] == 1 && nUFV0 == 1 ) ||
2182 (
num[ kUFVPlus ] ==1 &&
num [ kPiMinus ] == 1 ) ||
2183 (
num[ kUFVMinus ] ==1 &&
num [ kPiPlus ] == 1 ) ) ) ||
2184 ( nDaughters == 3 &&
2185 ( (
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) ||
2186 ( nCPPlusEig == 1 &&
num[ kPi0 ] == 2 ) ||
2187 (
num[ kK0S ] == 3 ) || (
num[ kK0S ] == 1 &&
num[ kK0L ] == 2 ) ||
2188 (
num[ kK0S ] == 1 &&
num[ kK0L ] == 1 && nUFP0 == 1 ) ||
2189 (
num[ kK0S ] == 1 && nUFP0 == 2 )
2190 ) ) ||
2191 ( nDaughters == 4 &&
2192 (
num[ kK0L ] == 1 && nUFP0 == 3 )||
2193 ( (
num[ kK0S ] == 2 ||
num[ kK0L ] == 2 ) && nUFP0 == 2 ) )
2194 )
2195 {
2196 decay_mode = kCPPlus ;
2198
2199 r2D0 = 1. ;
2200 deltaD0 = 0.;
2201 }
2202 else if((
num[ kPiPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) ){
2203
2204 decay_mode = kCPPlus ;
2206
2207 FCP = 0.973;
2208 r2D0 = 1. ;
2209 deltaD0 = 0.;
2210 }
2211
2212 else if(
2213 ( nDaughters == 2 &&
2214 ( (
num[ kK0S ] == 1 && nUFP0 == 1 ) ||
2215 (
num[ kK0L ] == 1 &&
num[ kNeutralScalar ] == 1 ) ||
2216 (
num[ kK0S ] == 1 && nUFV0 == 1 ) ||
2217 (
num[ kNeutralScalar ] == 1 && nUFV0 == 1 ) ||
2218 ( nUFP0 == 1 &&
num[ kNeutralScalar ] == 1 ) ) ) ||
2219 ( nDaughters == 3 &&
2220 ( ( nCPMinusEig == 3 &&
num[ kPi0 ] == 2 ) ||
2221 (
num[ kPi0 ] == 3 ) ||
2222 (
num[ kK0L ] == 3 ) || (
num[ kK0S ] == 2 &&
num[ kK0L ] == 1 ) ||
2223 ( (
num[ kK0S ] == 2 ||
num[ kK0L ] == 2 ) && nUFP0 == 1 ) ||
2224 (
num[ kK0L ] == 1 && nUFP0 == 2 ) ) ) ||
2225 ( nDaughters == 4 &&
2226 (
num[ kK0S ] == 1 &&
num[ kPi0 ] == 3 )|| ( (
num[ kK0S ] == 1 &&
num[ kK0L ] == 1 ) && nUFP0 == 2 ) )
2227 )
2228 {
2229 decay_mode = kCPMinus ;
2231
2232 r2D0 = 1. ;
2234 }
2235 else if( nStrange == nAntiStrange + 1 )
2236 {
2237 if(m_debug)cout<< nDaughters <<endl;
2238 if(m_debug)cout<<
num[ kKMinus ]<<endl;
2239 if(m_debug)cout<<
num[ kPiMinus ]<<endl;
2240 if(m_debug)cout<<
num[ kPiPlus ]<<endl;
2241 if( charm == 1 )
2242 {
2243 if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 2 &&
num[ kPiMinus ] == 1 ) && nDaughters == 4 ){
2244 if(m_debug)cout<< "True K-3Pi "<<endl;
2245 decay_mode = kFlavoredCF_3 ;
2247
2249 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2250 double pdau[16];
2251 pi1.clear();pi2.clear();pi3.clear();
2252 kp.clear();
2253
2254 HepLorentzVector kp_kpipipi = (kMinus_kkpipi.at(0));
2255 HepLorentzVector pi1_kpipipi = (piPlus_4pi.at(0));
2256 HepLorentzVector pi2_kpipipi = (piPlus_4pi.at(1));
2257 HepLorentzVector pi3_kpipipi = (piMinus_4pi.at(0));
2258
2259 kp.push_back( kp_kpipipi[0]); kp.push_back(kp_kpipipi[1]); kp.push_back(kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2260 pi1.push_back(pi1_kpipipi[0]);pi1.push_back(pi1_kpipipi[1]);pi1.push_back(pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2261 pi2.push_back(pi2_kpipipi[0]);pi2.push_back(pi2_kpipipi[1]);pi2.push_back(pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2262 pi3.push_back(pi3_kpipipi[0]);pi3.push_back(pi3_kpipipi[1]);pi3.push_back(pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2263
2264 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2265 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2266 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2267 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2268
2270 D0 = tKpipipi.
AMP(pdau,1);
2271
2273 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2274 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2275 deltaD0 = ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2276 r2D0 = std::norm(D0bar)/std::norm(D0);
2277
2278 }
else if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2279 decay_mode = kFlavoredCF_1 ;
2281 r2D0 = pow(m_rCF_1,2) ;
2283 RD0 = m_RCF_1;
2284 }else{
2285
2286 if(m_debug)cout<< "True K-Pi "<<endl;
2287 decay_mode = kFlavoredCF_0 ;
2289 r2D0 = pow(m_rCF_0,2) ;
2291 RD0 = m_RCF_0;
2292 }
2293 }
2294 else
2295 {
2296 if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 2 &&
num[ kPiMinus ] == 1 ) && nDaughters == 4 ){
2297 decay_mode = kFlavoredCF_3 ;
2299
2301 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2302 double pdau[16];
2303 pi1.clear();pi2.clear();pi3.clear();
2304 kp.clear();
2305
2306 HepLorentzVector kp_kpipipi = (kMinus_kkpipi.at(0));
2307 HepLorentzVector pi1_kpipipi = (piPlus_4pi.at(0));
2308 HepLorentzVector pi2_kpipipi = (piPlus_4pi.at(1));
2309 HepLorentzVector pi3_kpipipi = (piMinus_4pi.at(0));
2310
2311 kp.push_back( kp_kpipipi[0]); kp.push_back(kp_kpipipi[1]); kp.push_back(kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2312 pi1.push_back(pi1_kpipipi[0]);pi1.push_back(pi1_kpipipi[1]);pi1.push_back(pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2313 pi2.push_back(pi2_kpipipi[0]);pi2.push_back(pi2_kpipipi[1]);pi2.push_back(pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2314 pi3.push_back(pi3_kpipipi[0]);pi3.push_back(pi3_kpipipi[1]);pi3.push_back(pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2315
2316 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2317 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2318 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2319 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2320
2322 D0 = tKpipipi.
AMP(pdau,1);
2323
2325 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2326 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2327 deltaD0 = - ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2328 r2D0 = std::norm(D0)/std::norm(D0bar);
2329
2330 }
else if( (
num[ kKMinus ] == 1 &&
num[ kPiPlus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2331 decay_mode = kFlavoredCF_1 ;
2333 r2D0 = 1. / pow( m_rCF_1,2 ) ;
2335 RD0 = m_RCF_1;
2336 }else{
2337
2338 decay_mode = kFlavoredCF_0 ;
2340 r2D0 = 1. / pow( m_rCF_0,2 ) ;
2342 RD0 = m_RCF_0;
2343 }
2344 }
2345 }
2346 else if( nAntiStrange == nStrange + 1 )
2347 {
2348 if( charm == -1 )
2349 {
2350 if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 2 &&
num[ kPiPlus ] == 1 ) && nDaughters == 4 ){
2351 decay_mode = kFlavoredCFBar_3 ;
2353
2355 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2356 double pdau[16];
2357 pi1.clear();pi2.clear();pi3.clear();
2358 kp.clear();
2359
2360 HepLorentzVector kp_kpipipi = (kPlus_kkpipi.at(0));
2361 HepLorentzVector pi1_kpipipi = (piMinus_4pi.at(0));
2362 HepLorentzVector pi2_kpipipi = (piMinus_4pi.at(1));
2363 HepLorentzVector pi3_kpipipi = (piPlus_4pi.at(0));
2364
2365 kp.push_back( -kp_kpipipi[0]); kp.push_back(-kp_kpipipi[1]); kp.push_back(-kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2366 pi1.push_back(-pi1_kpipipi[0]);pi1.push_back(-pi1_kpipipi[1]);pi1.push_back(-pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2367 pi2.push_back(-pi2_kpipipi[0]);pi2.push_back(-pi2_kpipipi[1]);pi2.push_back(-pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2368 pi3.push_back(-pi3_kpipipi[0]);pi3.push_back(-pi3_kpipipi[1]);pi3.push_back(-pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2369
2370 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2371 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2372 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2373 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2374
2376 D0 = tKpipipi.
AMP(pdau,1);
2377
2379 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2380 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2381 deltaD0 = ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2382 r2D0 = std::norm(D0bar)/std::norm(D0);
2383
2384
2385 }
else if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2386 decay_mode = kFlavoredCFBar_1 ;
2388 r2D0 = pow(m_rCF_1,2) ;
2390 RD0 = m_RCF_1;
2391 }else{
2392
2393 decay_mode = kFlavoredCFBar_0 ;
2395 r2D0 = pow(m_rCF_0,2) ;
2397 RD0 = m_RCF_0;
2398 }
2399 }
2400 else
2401 {
2402 if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 2 &&
num[ kPiPlus ] == 1 ) && nDaughters == 4 ){
2403 decay_mode = kFlavoredCFBar_3 ;
2405
2407 vector<double> kp; vector<double> pi1; vector<double> pi2;vector<double> pi3;
2408 double pdau[16];
2409 pi1.clear();pi2.clear();pi3.clear();
2410 kp.clear();
2411
2412 HepLorentzVector kp_kpipipi = (kPlus_kkpipi.at(0));
2413 HepLorentzVector pi1_kpipipi = (piMinus_4pi.at(0));
2414 HepLorentzVector pi2_kpipipi = (piMinus_4pi.at(1));
2415 HepLorentzVector pi3_kpipipi = (piPlus_4pi.at(0));
2416
2417 kp.push_back( -kp_kpipipi[0]); kp.push_back(-kp_kpipipi[1]); kp.push_back(-kp_kpipipi[2]); kp.push_back(kp_kpipipi[3]);
2418 pi1.push_back(-pi1_kpipipi[0]);pi1.push_back(-pi1_kpipipi[1]);pi1.push_back(-pi1_kpipipi[2]);pi1.push_back(pi1_kpipipi[3]);
2419 pi2.push_back(-pi2_kpipipi[0]);pi2.push_back(-pi2_kpipipi[1]);pi2.push_back(-pi2_kpipipi[2]);pi2.push_back(pi2_kpipipi[3]);
2420 pi3.push_back(-pi3_kpipipi[0]);pi3.push_back(-pi3_kpipipi[1]);pi3.push_back(-pi3_kpipipi[2]);pi3.push_back(pi3_kpipipi[3]);
2421
2422 pdau[0]=kp[0]; pdau[1]=kp[1]; pdau[2]=kp[2] ; pdau[3]=kp[3];
2423 pdau[4]=pi1[0]; pdau[5]=pi1[1]; pdau[6]=pi1[2]; pdau[7]=pi1[3];
2424 pdau[8]=pi2[0]; pdau[9]=pi2[1]; pdau[10]=pi2[2];pdau[11]=pi2[3];
2425 pdau[12]=pi3[0];pdau[13]=pi3[1];pdau[14]=pi3[2];pdau[15]=pi3[3];
2426
2428 D0 = tKpipipi.
AMP(pdau,1);
2429
2431 std::complex<double> dcs_offset = 0.0601387 *
exp( std::complex<double>(0,1) * 1.04827 *
M_PI / 180. );
2432 D0bar = dcs_offset*tpiKpipi.
AMP(pdau,1);
2433 deltaD0 = - ( std::arg(D0 * std::conj(D0bar)) + m_dCF_3 );
2434 r2D0 = std::norm(D0)/std::norm(D0bar);
2435
2436 }
else if( (
num[ kKPlus ] == 1 &&
num[ kPiMinus ] == 1 &&
num[ kPi0 ] == 1 ) && nDaughters == 3 ){
2437 decay_mode = kFlavoredCFBar_1 ;
2439 r2D0 = 1. / pow( m_rCF_1,2 ) ;
2441 RD0 = m_RCF_1;
2442 }else{
2443
2444 decay_mode = kFlavoredCFBar_0 ;
2446 r2D0 = 1. / pow( m_rCF_0,2 ) ;
2448 RD0 = m_RCF_0;
2449 }
2450 }
2451 }
2452 else if( nStrange == nAntiStrange )
2453 {
2454 if( (
num[ kKPlus ] > 0 &&
2455 (
num[ kKPlus ] ==
num[ kFVMinus ] ||
2456 num[ kKPlus ] == nFV0Bar ) ) ||
2457 ( nK0 > 0 &&
2458 nFV0 != nFV0Bar &&
2459 nK0 == nFV0Bar ) ||
2460 (
num[ kPiPlus ] > 0 &&
2461 num[ kPiPlus ] ==
num[ kUFVMinus ] ) )
2462 {
2463 decay_mode = kFlavoredCS ;
2465
2466 if( charm == 1 )
2467 {
2468 r2D0 = pow( m_rCS, 2 ) ;
2470 }
2471 else
2472 {
2473 r2D0 = 1. / pow( m_rCS, 2 ) ;
2475 }
2476 }
2477 else if( (
num[ kKMinus ] > 0 && (
num[ kKMinus ] ==
num[ kFVPlus ] ||
num[ kKMinus ] == nFV0 ) ) ||
2478 ( nK0 > 0 && nFV0 != nFV0Bar && nK0 == nFV0 ) ||
2479 (
num[ kPiMinus ] > 0 &&
num[ kPiMinus ] ==
num[ kUFVPlus ] ) )
2480 {
2481 decay_mode = kFlavoredCSBar ;
2483
2484 if( charm == -1 )
2485 {
2486 r2D0 = pow( m_rCS, 2 ) ;
2488 }
2489 else
2490 {
2491 r2D0 = 1. / pow( m_rCS, 2 ) ;
2493 }
2494 }
2495
2496
2497
2498
2499 else if( ( nDaughters >= 3 &&
num[ kPiPlus ] ==
num[ kPiMinus ] &&
2500 num[ kKPlus ] ==
num[ kKMinus ] && nChargedPiK + nCPEig == nDaughters ) ||
2501 nUFV0 == nDaughters ||
2502 (
num[ kKStar0 ] > 0 &&
num[ kKStar0 ] ==
num[ kKStar0Bar ] ) ||
2503 (
num[ kK10 ] > 0 &&
num[ kK10 ] ==
num[ kK10Bar ] ) ||
2504 (
num[ kUFVPlus ] == 1 &&
num[ kUFVMinus ] == 1 )
2505
2506 )
2507 {
2508 log << MSG::DEBUG <<" [ Self-conjugate mixed-CP ]" << endmsg ;
2509
2510 if( RandFlat::shoot() > 0.5 )
2511 {
2512 if( RandFlat::shoot() > 0.5 )
2513 {
2514 decay_mode = kCPPlus ;
2516
2517 r2D0 = 1. ;
2519 }
2520 else
2521 {
2522 decay_mode = kCPMinus ;
2524
2525 r2D0 = 1. ;
2526 deltaD0 = 0. ;
2527 }
2528 }
2529 else
2530 {
2531
2532 if( nK0 % 2 )
2533 {
2534
2536
2537 if( charm == -1 )
2538 {
2539 cutoff = 1. - cutoff ;
2540 }
2541
2542 log << MSG::DEBUG <<" [ cutoff = " << cutoff << " ]" << endmsg ;
2543
2544 decay_mode = ( RandFlat::shoot() > cutoff ) ? kFlavoredCF_0 : kFlavoredCFBar_0 ;
2545
2546 if( ( decay_mode == kFlavoredCF_0 && charm == 1 ) ||
2547 ( decay_mode == kFlavoredCFBar_0 && charm == -1 ) )
2548 {
2550
2551 r2D0 = sqrt( m_rCF_0 ) ;
2553 }
2554 else
2555 {
2557
2558 r2D0 = 1. / sqrt( m_rCF_0 ) ;
2560 }
2561 }
2562 else
2563 {
2564
2566
2567 if( charm == -1 )
2568 {
2569 cutoff = 1. - cutoff ;
2570 }
2571
2572 log << MSG::DEBUG <<" [ cutoff = " << cutoff << " ]" << endmsg ;
2573
2574 decay_mode = ( RandFlat::shoot() > cutoff ) ?
2575 kFlavoredCS : kFlavoredCSBar ;
2577
2578 if( ( decay_mode == kFlavoredCS && charm == 1 ) ||
2579 ( decay_mode == kFlavoredCSBar && charm == -1 ) )
2580 {
2581 r2D0 = sqrt( m_rCS ) ;
2583 }
2584 else
2585 {
2586 r2D0 = 1. / sqrt( m_rCS ) ;
2588 }
2589 }
2590 }
2591 }
2592 }
2593
2594 if (
num[kUnknown] >= 1)
2595 {
2596 cout << "decay mode " << decay_mode << endl ;
2597 cout << "D #" << charm << endl ;
2598 cout <<
"pi+: " <<
num[ kPiPlus ] << endl ;
2599 cout <<
"pi-: " <<
num[ kPiMinus ] << endl ;
2600 cout <<
"pi0: " <<
num[ kPi0 ] << endl ;
2601 cout <<
"eta: " <<
num[ kEta ] << endl ;
2602 cout <<
"eta': " <<
num[ kEtaPrime ] << endl ;
2603 cout <<
"f0/a0: " <<
num[ kNeutralScalar ] << endl ;
2604 cout <<
"UFV+: " <<
num[ kUFVPlus ] << endl ;
2605 cout <<
"UFV-: " <<
num[ kUFVMinus ] << endl ;
2606 cout <<
"rho0: " <<
num[ kRho0 ] << endl ;
2607 cout <<
"omega: " <<
num[ kOmega ] << endl ;
2608 cout <<
"phi: " <<
num[ kPhi ] << endl ;
2609 cout <<
"K+: " <<
num[ kKPlus ] << endl ;
2610 cout <<
"K-: " <<
num[ kKMinus ] << endl ;
2611 cout <<
"K0S: " <<
num[ kK0S ] << endl ;
2612 cout <<
"K0L: " <<
num[ kK0L ] << endl ;
2613 cout <<
"FV+: " <<
num[ kFVPlus ] << endl ;
2614 cout <<
"FV-: " <<
num[ kFVMinus ] << endl ;
2615 cout <<
"K*0: " <<
num[ kKStar0 ] << endl ;
2616 cout <<
"K*0b: " <<
num[ kKStar0Bar ] << endl ;
2617 cout <<
"K10: " <<
num[ kK10 ] << endl ;
2618 cout <<
"K10b: " <<
num[ kK10Bar ] << endl ;
2619 cout <<
"l+: " <<
num[ kLeptonPlus ] << endl ;
2620 cout <<
"l-: " <<
num[ kLeptonMinus ] << endl ;
2621 cout <<
"nu: " <<
num[ kNeutrino ] << endl ;
2622 cout <<
"gamma: " <<
num[ kGamma ] << endl ;
2623 cout <<
"Unknown: " <<
num[ 25 ] << endl ;
2624 }
2625
2626
2627 d0_info[0]=decay_mode;
2628 d0_info[1]=r2D0;
2629 d0_info[2]=deltaD0;
2630 d0_info[3]=RD0;
2631 d0_info[4]=FCP;
2632 d0_info[5]=mnm_gen;
2633 d0_info[6]=mpn_gen;
2634 d0_info[7]= double (isKsPiPi);
2635 d0_info[8]=mpm_gen;
2636 return d0_info;
2637}
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)
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 > Pi01, vector< double > Pi02)