// ParticleId.cpp #include "ParticleId.hpp" #include #include #include #include "ParticleTable.hpp" using std::abs; using std::ostream; using std::endl; using std::setw; using std::string; using namespace pdg; //********************************************************************** // Local functions. //********************************************************************** namespace pdg { //********************************************************************** // Data. //********************************************************************** // Quarks. extern ParticleId D(1); extern ParticleId DBAR(-1); extern ParticleId U(2); extern ParticleId UBAR(-2); extern ParticleId S(3); extern ParticleId SBAR(-3); extern ParticleId C(4); extern ParticleId CBAR(-4); extern ParticleId B(5); extern ParticleId BBAR(-5); extern ParticleId T(6); extern ParticleId TBAR(-6); // Leptons. extern ParticleId E_MINUS(11); extern ParticleId E_PLUS(-11); extern ParticleId NUE(12); extern ParticleId NUEBAR(-12); extern ParticleId MU_MINUS(13); extern ParticleId MU_PLUS(-13); extern ParticleId NUMU(14); extern ParticleId NUMUBAR(-14); extern ParticleId TAU_MINUS(15); extern ParticleId TAU_PLUS(-15); extern ParticleId NUTAU(16); extern ParticleId NUTAUBAR(-16); // Bosons. extern ParticleId GLUON(21); extern ParticleId GAMMA(22); extern ParticleId Z(23); extern ParticleId W_PLUS(24); extern ParticleId W_MINUS(-24); extern ParticleId HIGGS(25); // Light I=1 Mesons. extern ParticleId PI_ZERO( 111); extern ParticleId PI_PLUS( 211); extern ParticleId PI_MINUS( -211); extern ParticleId A0_980_ZERO( 9000111); extern ParticleId A0_980_PLUS( 9000211); extern ParticleId A0_980_MINUS( -9000211); extern ParticleId PI_1300_ZERO( 100111); extern ParticleId PI_1300_PLUS( 100211); extern ParticleId PI_1300_MINUS( -100211); extern ParticleId A0_1450_ZERO( 10111); extern ParticleId A0_1450_PLUS( 10211); extern ParticleId A0_1450_MINUS( -10211); extern ParticleId PI_1800_ZERO( 200111); extern ParticleId PI_1800_PLUS( 200211); extern ParticleId PI_1800_MINUS( -200211); extern ParticleId RHO_770_ZERO( 113); extern ParticleId RHO_770_PLUS( 213); extern ParticleId RHO_770_MINUS( -213); extern ParticleId B1_1235_ZERO( 10113); extern ParticleId B1_1235_PLUS( 10213); extern ParticleId B1_1235_MINUS( -10213); extern ParticleId A1_1260_ZERO( 20113); extern ParticleId A1_1260_PLUS( 20213); extern ParticleId A1_1260_MINUS( -20213); extern ParticleId PI1_1400_ZERO( 9000113); extern ParticleId PI1_1400_PLUS( 9000213); extern ParticleId PI1_1400_MINUS( -9000213); extern ParticleId RHO_1450_ZERO( 100113); extern ParticleId RHO_1450_PLUS( 100213); extern ParticleId RHO_1450_MINUS( -100213); extern ParticleId PI1_1600_ZERO( 9010113); extern ParticleId PI1_1600_PLUS( 9010213); extern ParticleId PI1_1600_MINUS( -9010213); extern ParticleId A1_1640_ZERO( 9020113); extern ParticleId A1_1640_PLUS( 9020213); extern ParticleId A1_1640_MINUS( -9020213); extern ParticleId RHO_1700_ZERO( 30113); extern ParticleId RHO_1700_PLUS( 30213); extern ParticleId RHO_1700_MINUS( -30213); extern ParticleId RHO_2150_ZERO( 9030113); extern ParticleId RHO_2150_PLUS( 9030213); extern ParticleId RHO_2150_MINUS( -9030213); extern ParticleId A2_1320_ZERO( 115); extern ParticleId A2_1320_PLUS( 215); extern ParticleId A2_1320_MINUS( -215); extern ParticleId A2_1660_ZERO( 9000115); extern ParticleId A2_1660_PLUS( 9000215); extern ParticleId A2_1660_MINUS( -9000215); extern ParticleId PI2_1670_ZERO( 10115); extern ParticleId PI2_1670_PLUS( 10215); extern ParticleId PI2_1670_MINUS( -10215); extern ParticleId A2_1750_ZERO( 9010115); extern ParticleId A2_1750_PLUS( 9010215); extern ParticleId A2_1750_MINUS( -9010215); extern ParticleId PI2_2100_ZERO( 9020115); extern ParticleId PI2_2100_PLUS( 9020215); extern ParticleId PI2_2100_MINUS( -9020215); extern ParticleId RHO3_1690_ZERO( 117); extern ParticleId RHO3_1690_PLUS( 217); extern ParticleId RHO3_1690_MINUS( -217); extern ParticleId RHO3_2250_ZERO( 9000117); extern ParticleId RHO3_2250_PLUS( 9000217); extern ParticleId RHO3_2250_MINUS(-9000217); extern ParticleId A4_2040_ZERO( 119); extern ParticleId A4_2040_PLUS( 219); extern ParticleId A4_2040_MINUS( -219); // Light I=0 mesons. extern ParticleId ETA( 221); extern ParticleId ETA_958( 331); extern ParticleId F0_400( 9000221); extern ParticleId F0_980( 9010221); extern ParticleId ETA_1295( 100221); extern ParticleId F0_1370( 10221); extern ParticleId ETA_1440( 100331); extern ParticleId F0_1500( 9020221); extern ParticleId F0_1710( 10331); extern ParticleId ETA_1760( 200221); extern ParticleId F0_2020( 9030221); extern ParticleId F0_2060( 9040221); extern ParticleId F0_2200( 9050221); extern ParticleId ETA_2225( 9060221); extern ParticleId OMEGA_782( 223); extern ParticleId PHI_1020( 333); extern ParticleId H1_1170( 10223); extern ParticleId F1_1285( 20223); extern ParticleId H1_1380( 10333); extern ParticleId F1_1420( 20333); extern ParticleId OMEGA_1420( 100223); extern ParticleId F1_1510( 9000223); extern ParticleId OMEGA_1650( 30223); extern ParticleId PHI_1680( 100333); extern ParticleId F2_1270( 225); extern ParticleId F2_1430( 9000225); extern ParticleId F2_1525( 335); extern ParticleId F2_1565( 9010225); extern ParticleId F2_1640( 9020225); extern ParticleId ETA2_1645( 10225); extern ParticleId F2_1810( 100225); extern ParticleId ETA2_1870( 10335); extern ParticleId F2_1950( 9030225); extern ParticleId F2_2010( 100335); extern ParticleId F2_2150( 9040225); extern ParticleId F2_2300( 9050225); extern ParticleId F2_2340( 9060225); extern ParticleId OMEGA3_1670( 227); extern ParticleId PHI3_1850( 337); extern ParticleId F4_2050( 229); extern ParticleId FJ_2220( 9000339); extern ParticleId F4_2300( 9000229); // Strange mesons. extern ParticleId K_LONG( 130); extern ParticleId K_SHORT( 310); extern ParticleId K_ZERO( 311); extern ParticleId K_ZBAR( -311); extern ParticleId K_PLUS( 321); extern ParticleId K_MINUS( -321); extern ParticleId K0_1430_ZERO( 10311); extern ParticleId K0_1430_ZBAR( -10311); extern ParticleId K0_1430_PLUS( 10321); extern ParticleId K0_1430_MINUS( -10321); extern ParticleId K0_1460_ZERO( 100311); extern ParticleId K0_1460_ZBAR( -100311); extern ParticleId K0_1460_PLUS( 100321); extern ParticleId K0_1460_MINUS( -100321); extern ParticleId K0_1830_ZERO( 200311); extern ParticleId K0_1830_ZBAR( -200311); extern ParticleId K0_1830_PLUS( 200321); extern ParticleId K0_1830_MINUS( -200321); extern ParticleId K0_STAR_1950_ZERO( 9000311); extern ParticleId K0_STAR_1950_ZBAR( -9000311); extern ParticleId K0_STAR_1950_PLUS( 9000321); extern ParticleId K0_STAR_1950_MINUS(-9000321); extern ParticleId K_STAR_ZERO( 313); extern ParticleId K_STAR_ZBAR( -313); extern ParticleId K_STAR_PLUS( 323); extern ParticleId K_STAR_MINUS( -323); extern ParticleId K1_1270_ZERO( 10313); extern ParticleId K1_1270_ZBAR( -10313); extern ParticleId K1_1270_PLUS( 10323); extern ParticleId K1_1270_MINUS( -10323); extern ParticleId K1_1400_ZERO( 20313); extern ParticleId K1_1400_ZBAR( -20313); extern ParticleId K1_1400_PLUS( 20323); extern ParticleId K1_1400_MINUS( -20323); extern ParticleId K_STAR_1410_ZERO( 100313); extern ParticleId K_STAR_1410_ZBAR( -100313); extern ParticleId K_STAR_1410_PLUS( 100323); extern ParticleId K_STAR_1410_MINUS( -100323); extern ParticleId K1_1650_ZERO( 9000313); extern ParticleId K1_1650_ZBAR( -9000313); extern ParticleId K1_1650_PLUS( 9000323); extern ParticleId K1_1650_MINUS( -9000323); extern ParticleId K_STAR_1680_ZERO( 30313); extern ParticleId K_STAR_1680_ZBAR( -30313); extern ParticleId K_STAR_1680_PLUS( 30323); extern ParticleId K_STAR_1680_MINUS( -30323); extern ParticleId K2_STAR_1430_ZERO( 315); extern ParticleId K2_STAR_1430_ZBAR( -315); extern ParticleId K2_STAR_1430_PLUS( 325); extern ParticleId K2_STAR_1430_MINUS( -325); extern ParticleId K2_1580_ZERO( 9000315); extern ParticleId K2_1580_ZBAR( -9000315); extern ParticleId K2_1580_PLUS( 9000325); extern ParticleId K2_1580_MINUS( -9000325); extern ParticleId K2_1770_ZERO( 10315); extern ParticleId K2_1770_ZBAR( -10315); extern ParticleId K2_1770_PLUS( 10325); extern ParticleId K2_1770_MINUS( -10325); extern ParticleId K2_1820_ZERO( 20315); extern ParticleId K2_1820_ZBAR( -20315); extern ParticleId K2_1820_PLUS( 20325); extern ParticleId K2_1820_MINUS( -20325); extern ParticleId K2_STAR_1980_ZERO( 100315); extern ParticleId K2_STAR_1980_ZBAR( -100315); extern ParticleId K2_STAR_1980_PLUS( 100325); extern ParticleId K2_STAR_1980_MINUS( -100325); extern ParticleId K2_2250_ZERO( 9010315); extern ParticleId K2_2250_ZBAR( -9010315); extern ParticleId K2_2250_PLUS( 9010325); extern ParticleId K2_2250_MINUS( -9010325); extern ParticleId K3_1780_ZERO( 317); extern ParticleId K3_1780_ZBAR( -317); extern ParticleId K3_1780_PLUS( 327); extern ParticleId K3_1780_MINUS( -327); extern ParticleId K3_2320_ZERO( 9010317); extern ParticleId K3_2320_ZBAR( -9010317); extern ParticleId K3_2320_PLUS( 9010327); extern ParticleId K3_2320_MINUS( -9010327); extern ParticleId K4_STAR_2045_ZERO( 319); extern ParticleId K4_STAR_2045_ZBAR( -319); extern ParticleId K4_STAR_2045_PLUS( 329); extern ParticleId K4_STAR_2045_MINUS( -329); extern ParticleId K4_2500_ZERO( 9000319); extern ParticleId K4_2500_ZBAR( -9000319); extern ParticleId K4_2500_PLUS( 9000329); extern ParticleId K4_2500_MINUS( -9000329); // Charmed mesons. extern ParticleId D_PLUS( 411); extern ParticleId D_MINUS( -411); extern ParticleId D_ZERO( 421); extern ParticleId D_ZBAR( -421); extern ParticleId D0_STAR_PLUS( 10411); extern ParticleId D0_STAR_MINUS( -10411); extern ParticleId D0_STAR_ZERO( 10421); extern ParticleId D0_STAR_ZBAR( -10421); extern ParticleId D_STAR_2010_PLUS( 413); extern ParticleId D_STAR_2010_MINUS( -413); extern ParticleId D_STAR_2007_ZERO( 423); extern ParticleId D_STAR_2007_ZBAR( -423); extern ParticleId D1_2420_PLUS( 10413); extern ParticleId D1_2420_MINUS( -10413); extern ParticleId D1_2420_ZERO( 10423); extern ParticleId D1_2420_ZBAR( -10423); extern ParticleId D1_H_PLUS( 20413); extern ParticleId D1_H_MINUS( -20413); extern ParticleId D1_H_ZERO( 20423); extern ParticleId D1_H_ZBAR( -20423); extern ParticleId D2_STAR_2460_PLUS( 415); extern ParticleId D2_STAR_2460_MINUS( -415); extern ParticleId D2_STAR_2460_ZERO( 425); extern ParticleId D2_STAR_2460_ZBAR( -425); extern ParticleId DS_PLUS( 431); extern ParticleId DS_MINUS( -431); extern ParticleId DS0_PLUS( 10431); extern ParticleId DS0_MINUS( -10431); extern ParticleId DS_STAR_PLUS( 433); extern ParticleId DS_STAR_MINUS( -433); extern ParticleId DS1_STAR_2536_PLUS( 10433); extern ParticleId DS1_STAR_2536_MINUS( -10433); extern ParticleId DS1_H_PLUS( 20433); extern ParticleId DS1_H_MINUS( -20433); extern ParticleId DS2_STAR_PLUS( 435); extern ParticleId DS2_STAR_MINUS( -435); // Bottom mesons. extern ParticleId B_ZERO( 511); extern ParticleId B_ZBAR( -511); extern ParticleId B_PLUS( 521); extern ParticleId B_MINUS( -521); extern ParticleId B0_STAR_ZERO( 10511); extern ParticleId B0_STAR_ZBAR( -10511); extern ParticleId B0_STAR_PLUS( 10521); extern ParticleId B0_STAR_MINUS( -10521); extern ParticleId B_STAR_ZERO( 513); extern ParticleId B_STAR_ZBAR( -513); extern ParticleId B_STAR_PLUS( 523); extern ParticleId B_STAR_MINUS( -523); extern ParticleId B1_L_ZERO( 10513); extern ParticleId B1_L_ZBAR( -10513); extern ParticleId B1_L_PLUS( 10523); extern ParticleId B1_L_MINUS( -10523); extern ParticleId B1_H_ZERO( 20513); extern ParticleId B1_H_ZBAR( -20513); extern ParticleId B1_H_PLUS( 20523); extern ParticleId B1_H_MINUS( -20523); extern ParticleId B2_STAR_ZERO( 515); extern ParticleId B2_STAR_ZBAR( -515); extern ParticleId B2_STAR_PLUS( 525); extern ParticleId B2_STAR_MINUS( -525); extern ParticleId BS_ZERO( 531); extern ParticleId BS_ZBAR( -531); extern ParticleId BS0_STAR_ZERO( 10531); extern ParticleId BS0_STAR_ZBAR( -10531); extern ParticleId BS_STAR_ZERO( 533); extern ParticleId BS_STAR_ZBAR( -533); extern ParticleId BS1_L_ZERO( 10533); extern ParticleId BS1_L_ZBAR( -10533); extern ParticleId BS1_H_ZERO( 20533); extern ParticleId BS1_H_ZBAR( -20533); extern ParticleId BS2_STAR_ZERO( 535); extern ParticleId BS2_STAR_ZBAR( -535); extern ParticleId BC_PLUS( 541); extern ParticleId BC_MINUS( -541); extern ParticleId BC0_STAR_PLUS( 10541); extern ParticleId BC0_STAR_MINUS( -10541); extern ParticleId BC_STAR_PLUS( 543); extern ParticleId BC_STAR_MINUS( -543); extern ParticleId BC1_L_PLUS( 10543); extern ParticleId BC1_L_MINUS( -10543); extern ParticleId BC1_H_PLUS( 20543); extern ParticleId BC1_H_MINUS( -20543); extern ParticleId BC2_STAR_PLUS( 545); extern ParticleId BC2_STAR_MINUS( -545); // C CBAR mesons extern ParticleId ETAC_1S( 441); extern ParticleId CHIC0_1P( 10441); extern ParticleId ETAC_2S( 100441); extern ParticleId JPSI_1S( 443); extern ParticleId HC_1P( 10443); extern ParticleId CHIC1_1P( 20443); extern ParticleId PSI_2S( 100443); extern ParticleId PSI_3770( 30443); extern ParticleId PSI_4040( 9000443); extern ParticleId PSI_4160( 9010443); extern ParticleId PSI_4415( 9020443); extern ParticleId CHIC2_1P( 445); extern ParticleId PSI_3836( 9000445); // B BBAR mesons extern ParticleId ETAB_1S( 551); extern ParticleId CHIB0_1P( 10551); extern ParticleId ETAB_2S( 100551); extern ParticleId CHIB0_2P( 110551); extern ParticleId ETAB_3S( 200551); extern ParticleId CHIB0_3P( 210551); extern ParticleId UPSILON_1S( 553); extern ParticleId HB_1P( 10553); extern ParticleId CHIB1_1P( 20553); extern ParticleId UPSILON1_1D( 30553); extern ParticleId UPSILON_2S( 100553); extern ParticleId HB_2P( 110553); extern ParticleId CHIB1_2P( 120553); extern ParticleId UPSILON1_2D( 130553); extern ParticleId UPSILON_3S( 200553); extern ParticleId HB_3P( 210553); extern ParticleId CHIB1_3P( 220553); extern ParticleId UPSILON_4S( 300553); extern ParticleId UPSILON_10860( 9000553); extern ParticleId UPSILON_11020( 9010553); extern ParticleId CHIB2_1P( 555); extern ParticleId ETAB2_1D( 10555); extern ParticleId UPSILON2_1D( 20555); extern ParticleId CHIB2_2P( 100555); extern ParticleId ETAB2_2D( 110555); extern ParticleId UPSILON2_2D( 120555); extern ParticleId CHIB2_3P( 200555); extern ParticleId UPSILON3_1D( 557); extern ParticleId UPSILON3_2D( 100557); // Light baryons. extern ParticleId PROTON( 2212); extern ParticleId NEUTRON( 2112); extern ParticleId DELTA_PLUS_PLUS( 2224); extern ParticleId DELTA_PLUS( 2214); extern ParticleId DELTA_ZERO( 2114); extern ParticleId DELTA_MINUS( 1114); // Strange baryons. extern ParticleId LAMBDA( 3122); extern ParticleId SIGMA_PLUS( 3222); extern ParticleId SIGMA_ZERO( 3212); extern ParticleId SIGMA_MINUS( 3112); extern ParticleId SIGMA_STAR_PLUS( 3224); extern ParticleId SIGMA_STAR_ZERO( 3214); extern ParticleId SIGMA_STAR_MINUS( 3114); extern ParticleId XI_ZERO( 3322); extern ParticleId XI_MINUS( 3312); extern ParticleId XI_STAR_ZERO( 3324); extern ParticleId XI_STAR_MINUS( 3314); extern ParticleId OMEGA_MINUS( 3334); // Charmed baryons. extern ParticleId LAMBDAC( 4122); extern ParticleId SIGMAC_PLUS_PLUS( 4222); extern ParticleId SIGMAC_PLUS( 4212); extern ParticleId SIGMAC_ZERO( 4112); extern ParticleId SIGMAC_STAR_PLUS_PLUS( 4224); extern ParticleId SIGMAC_STAR_PLUS( 4214); extern ParticleId SIGMAC_STAR_ZERO( 4114); extern ParticleId XIC_PLUS( 4232); extern ParticleId XIC_ZERO( 4132); extern ParticleId XIC_PRIME_PLUS( 4322); extern ParticleId XIC_PRIME_ZERO( 4312); extern ParticleId XIC_STAR_PLUS( 4324); extern ParticleId XIC_STAR_ZERO( 4314); extern ParticleId OMEGAC_ZERO( 4332); extern ParticleId OMEGAC_STAR_ZERO( 4334); extern ParticleId XICC_PLUS( 4412); extern ParticleId XICC_PLUS_PLUS( 4422); extern ParticleId XICC_STAR_PLUS( 4414); extern ParticleId XICC_STAR_PLUS_PLUS( 4424); extern ParticleId OMEGACC_PLUS( 4432); extern ParticleId OMEGACC_STAR_PLUS( 4434); extern ParticleId OMEGACCC_PLUS_PLUS( 4444); // Bottom baryons. extern ParticleId LAMBDAB_ZERO( 5122); extern ParticleId SIGMAB_MINUS( 5112); extern ParticleId SIGMAB_ZERO( 5212); extern ParticleId SIGMAB_PLUS( 5222); extern ParticleId SIGMAB_STAR_MINUS( 5114); extern ParticleId SIGMAB_STAR_ZERO( 5214); extern ParticleId SIGMAB_STAR_PLUS( 5224); extern ParticleId XIB_MINUS( 5132); extern ParticleId XIB_ZERO( 5232); extern ParticleId XIB_PRIME_MINUS( 5312); extern ParticleId XIB_PRIME_ZERO( 5322); extern ParticleId XIB_STAR_MINUS( 5314); extern ParticleId XIB_STAR_ZERO( 5324); extern ParticleId OMEGAB_MINUS( 5332); extern ParticleId OMEGAB_STAR_MINUS( 5334); extern ParticleId XIBC_ZERO( 5142); extern ParticleId XIBC_PLUS( 5242); extern ParticleId XIBC_PRIME_ZERO( 5412); extern ParticleId XIBC_PRIME_PLUS( 5422); extern ParticleId XIBC_STAR_ZERO( 5414); extern ParticleId XIBC_STAR_PLUS( 5424); extern ParticleId OMEGABC_ZERO( 5342); extern ParticleId OMEGABC_PRIME_ZERO( 5432); extern ParticleId OMEGABC_STAR_ZERO( 5434); extern ParticleId OMEGABCC_PLUS( 5442); extern ParticleId OMEGABCC_STAR_PLUS( 5444); extern ParticleId XIBB_MINUS( 5512); extern ParticleId XIBB_ZERO( 5522); extern ParticleId XIBB_STAR_MINUS( 5514); extern ParticleId XIBB_STAR_ZERO( 5524); extern ParticleId OMEGABB_MINUS( 5532); extern ParticleId OMEGABB_STAR_MINUS( 5534); extern ParticleId OMEGABBC_ZERO( 5542); extern ParticleId OMEGABBC_STAR_ZERO( 5544); extern ParticleId OMEGABBB_MINUS( 5554); //********************************************************************** // Local functions. //********************************************************************** namespace { ParticleId::Set fill_quarks() { ParticleId::Set pids; pids.insert(D); pids.insert(U); pids.insert(S); pids.insert(C); pids.insert(B); pids.insert(T); return pids; } ParticleId::Set fill_antiquarks() { ParticleId::Set pids; pids.insert(DBAR); pids.insert(UBAR); pids.insert(SBAR); pids.insert(CBAR); pids.insert(BBAR); pids.insert(TBAR); return pids; } ParticleId::Set fill_leptons() { ParticleId::Set pids; pids.insert(E_MINUS); pids.insert(NUE); pids.insert(MU_MINUS); pids.insert(NUMU); pids.insert(TAU_MINUS); pids.insert(NUTAU); return pids; } ParticleId::Set fill_antileptons() { ParticleId::Set pids; pids.insert(E_PLUS); pids.insert(NUEBAR); pids.insert(MU_PLUS); pids.insert(NUMUBAR); pids.insert(TAU_PLUS); pids.insert(NUTAUBAR); return pids; } ParticleId::Set fill_bosons() { ParticleId::Set pids; pids.insert(GLUON); pids.insert(GAMMA); pids.insert(Z); pids.insert(W_PLUS); pids.insert(HIGGS); return pids; } ParticleId::Set fill_i1mesons() { ParticleId::Set pids; pids.insert(PI_ZERO); pids.insert(PI_PLUS); pids.insert(A0_980_ZERO); pids.insert(A0_980_PLUS); pids.insert(PI_1300_ZERO); pids.insert(PI_1300_PLUS); pids.insert(A0_1450_ZERO); pids.insert(A0_1450_PLUS); pids.insert(PI_1800_ZERO); pids.insert(PI_1800_PLUS); pids.insert(RHO_770_ZERO); pids.insert(RHO_770_PLUS); pids.insert(B1_1235_ZERO); pids.insert(B1_1235_PLUS); pids.insert(A1_1260_ZERO); pids.insert(A1_1260_PLUS); pids.insert(PI1_1400_ZERO); pids.insert(PI1_1400_PLUS); pids.insert(RHO_1450_ZERO); pids.insert(RHO_1450_PLUS); pids.insert(PI1_1600_ZERO); pids.insert(PI1_1600_PLUS); pids.insert(A1_1640_ZERO); pids.insert(A1_1640_PLUS); pids.insert(RHO_1700_ZERO); pids.insert(RHO_1700_PLUS); pids.insert(RHO_2150_ZERO); pids.insert(RHO_2150_PLUS); pids.insert(A2_1320_ZERO); pids.insert(A2_1320_PLUS); pids.insert(A2_1660_ZERO); pids.insert(A2_1660_PLUS); pids.insert(PI2_1670_ZERO); pids.insert(PI2_1670_PLUS); pids.insert(A2_1750_ZERO); pids.insert(A2_1750_PLUS); pids.insert(PI2_2100_ZERO); pids.insert(PI2_2100_PLUS); pids.insert(RHO3_1690_ZERO); pids.insert(RHO3_1690_PLUS); pids.insert(RHO3_2250_ZERO); pids.insert(RHO3_2250_PLUS); pids.insert(A4_2040_ZERO); pids.insert(A4_2040_PLUS); return pids; } ParticleId::Set fill_antii1mesons() { ParticleId::Set pids; pids.insert(PI_MINUS); pids.insert(A0_980_MINUS); pids.insert(PI_1300_MINUS); pids.insert(A0_1450_MINUS); pids.insert(PI_1800_MINUS); pids.insert(RHO_770_MINUS); pids.insert(B1_1235_MINUS); pids.insert(A1_1260_MINUS); pids.insert(PI1_1400_MINUS); pids.insert(RHO_1450_MINUS); pids.insert(PI1_1600_MINUS); pids.insert(A1_1640_MINUS); pids.insert(RHO_1700_MINUS); pids.insert(RHO_2150_MINUS); pids.insert(A2_1320_MINUS); pids.insert(A2_1660_MINUS); pids.insert(PI2_1670_MINUS); pids.insert(A2_1750_MINUS); pids.insert(PI2_2100_MINUS); pids.insert(RHO3_1690_MINUS); pids.insert(RHO3_2250_MINUS); pids.insert(A4_2040_MINUS); return pids; } ParticleId::Set fill_i0mesons() { ParticleId::Set pids; pids.insert(ETA); pids.insert(ETA_958); pids.insert(F0_400); pids.insert(F0_980); pids.insert(ETA_1295); pids.insert(F0_1370); pids.insert(ETA_1440); pids.insert(F0_1500); pids.insert(F0_1710); pids.insert(ETA_1760); pids.insert(F0_2020); pids.insert(F0_2060); pids.insert(F0_2200); pids.insert(ETA_2225); pids.insert(OMEGA_782); pids.insert(PHI_1020); pids.insert(H1_1170); pids.insert(F1_1285); pids.insert(H1_1380); pids.insert(F1_1420); pids.insert(OMEGA_1420); pids.insert(F1_1510); pids.insert(OMEGA_1650); pids.insert(PHI_1680); pids.insert(F2_1270); pids.insert(F2_1430); pids.insert(F2_1525); pids.insert(F2_1565); pids.insert(F2_1640); pids.insert(ETA2_1645); pids.insert(F2_1810); pids.insert(ETA2_1870); pids.insert(F2_1950); pids.insert(F2_2010); pids.insert(F2_2150); pids.insert(F2_2300); pids.insert(F2_2340); pids.insert(OMEGA3_1670); pids.insert(PHI3_1850); pids.insert(F4_2050); pids.insert(FJ_2220); pids.insert(F4_2300); return pids; } ParticleId::Set fill_smesons() { ParticleId::Set pids; pids.insert(K_ZERO); pids.insert(K0_1430_ZERO); pids.insert(K0_1460_ZERO); pids.insert(K0_1830_ZERO); pids.insert(K0_STAR_1950_ZERO); pids.insert(K_STAR_ZERO); pids.insert(K1_1270_ZERO); pids.insert(K1_1400_ZERO); pids.insert(K_STAR_1410_ZERO); pids.insert(K1_1650_ZERO); pids.insert(K_STAR_1680_ZERO); pids.insert(K2_STAR_1430_ZERO); pids.insert(K2_1580_ZERO); pids.insert(K2_1770_ZERO); pids.insert(K2_1820_ZERO); pids.insert(K2_STAR_1980_ZERO); pids.insert(K2_2250_ZERO); pids.insert(K3_1780_ZERO); pids.insert(K3_2320_ZERO); pids.insert(K4_STAR_2045_ZERO); pids.insert(K4_2500_ZERO); pids.insert(K_PLUS); pids.insert(K0_1430_PLUS); pids.insert(K0_1460_PLUS); pids.insert(K0_1830_PLUS); pids.insert(K0_STAR_1950_PLUS); pids.insert(K_STAR_PLUS); pids.insert(K1_1270_PLUS); pids.insert(K1_1400_PLUS); pids.insert(K_STAR_1410_PLUS); pids.insert(K1_1650_PLUS); pids.insert(K_STAR_1680_PLUS); pids.insert(K2_STAR_1430_PLUS); pids.insert(K2_1580_PLUS); pids.insert(K2_1770_PLUS); pids.insert(K2_1820_PLUS); pids.insert(K2_STAR_1980_PLUS); pids.insert(K2_2250_PLUS); pids.insert(K3_1780_PLUS); pids.insert(K3_2320_PLUS); pids.insert(K4_STAR_2045_PLUS); pids.insert(K4_2500_PLUS); return pids; } ParticleId::Set fill_antismesons() { ParticleId::Set pids; pids.insert(K_ZBAR); pids.insert(K0_1430_ZBAR); pids.insert(K0_1460_ZBAR); pids.insert(K0_1830_ZBAR); pids.insert(K0_STAR_1950_ZBAR); pids.insert(K_STAR_ZBAR); pids.insert(K1_1270_ZBAR); pids.insert(K1_1400_ZBAR); pids.insert(K_STAR_1410_ZBAR); pids.insert(K1_1650_ZBAR); pids.insert(K_STAR_1680_ZBAR); pids.insert(K2_STAR_1430_ZBAR); pids.insert(K2_1580_ZBAR); pids.insert(K2_1770_ZBAR); pids.insert(K2_1820_ZBAR); pids.insert(K2_STAR_1980_ZBAR); pids.insert(K2_2250_ZBAR); pids.insert(K3_1780_ZBAR); pids.insert(K3_2320_ZBAR); pids.insert(K4_STAR_2045_ZBAR); pids.insert(K4_2500_ZBAR); pids.insert(K_MINUS); pids.insert(K0_1430_MINUS); pids.insert(K0_1460_MINUS); pids.insert(K0_1830_MINUS); pids.insert(K0_STAR_1950_MINUS); pids.insert(K_STAR_MINUS); pids.insert(K1_1270_MINUS); pids.insert(K1_1400_MINUS); pids.insert(K_STAR_1410_MINUS); pids.insert(K1_1650_MINUS); pids.insert(K_STAR_1680_MINUS); pids.insert(K2_STAR_1430_MINUS); pids.insert(K2_1580_MINUS); pids.insert(K2_1770_MINUS); pids.insert(K2_1820_MINUS); pids.insert(K2_STAR_1980_MINUS); pids.insert(K2_2250_MINUS); pids.insert(K3_1780_MINUS); pids.insert(K3_2320_MINUS); pids.insert(K4_STAR_2045_MINUS); pids.insert(K4_2500_MINUS); return pids; } ParticleId::Set fill_cmesons() { ParticleId::Set pids; pids.insert(D_PLUS); pids.insert(D_ZERO); pids.insert(D0_STAR_PLUS); pids.insert(D0_STAR_ZERO); pids.insert(D_STAR_2010_PLUS); pids.insert(D_STAR_2007_ZERO); pids.insert(D1_2420_PLUS); pids.insert(D1_2420_ZERO); pids.insert(D1_H_PLUS); pids.insert(D1_H_ZERO); pids.insert(D2_STAR_2460_PLUS); pids.insert(D2_STAR_2460_ZERO); pids.insert(DS_PLUS); pids.insert(DS0_PLUS); pids.insert(DS_STAR_PLUS); pids.insert(DS1_STAR_2536_PLUS); pids.insert(DS1_H_PLUS); pids.insert(DS2_STAR_PLUS); return pids; } ParticleId::Set fill_anticmesons() { ParticleId::Set pids; pids.insert(D_MINUS); pids.insert(D_ZBAR); pids.insert(D0_STAR_MINUS); pids.insert(D0_STAR_ZBAR); pids.insert(D_STAR_2010_MINUS); pids.insert(D_STAR_2007_ZBAR); pids.insert(D1_2420_MINUS); pids.insert(D1_2420_ZBAR); pids.insert(D1_H_MINUS); pids.insert(D1_H_ZBAR); pids.insert(D2_STAR_2460_MINUS); pids.insert(D2_STAR_2460_ZBAR); pids.insert(DS_MINUS); pids.insert(DS0_MINUS); pids.insert(DS_STAR_MINUS); pids.insert(DS1_STAR_2536_MINUS); pids.insert(DS1_H_MINUS); pids.insert(DS2_STAR_MINUS); return pids; } ParticleId::Set fill_bmesons() { ParticleId::Set pids; pids.insert(B_ZERO); pids.insert(B_PLUS); pids.insert(B0_STAR_ZERO); pids.insert(B0_STAR_PLUS); pids.insert(B_STAR_ZERO); pids.insert(B_STAR_PLUS); pids.insert(B1_L_ZERO); pids.insert(B1_L_PLUS); pids.insert(B1_H_ZERO); pids.insert(B1_H_PLUS); pids.insert(B2_STAR_ZERO); pids.insert(B2_STAR_PLUS); pids.insert(BS_ZERO); pids.insert(BS0_STAR_ZERO); pids.insert(BS_STAR_ZERO); pids.insert(BS1_L_ZERO); pids.insert(BS1_H_ZERO); pids.insert(BS2_STAR_ZERO); pids.insert(BC_PLUS); pids.insert(BC0_STAR_PLUS); pids.insert(BC_STAR_PLUS); pids.insert(BC1_L_PLUS); pids.insert(BC1_H_PLUS); pids.insert(BC2_STAR_PLUS); return pids; } ParticleId::Set fill_antibmesons() { ParticleId::Set pids; pids.insert(B_ZBAR); pids.insert(B_MINUS); pids.insert(B0_STAR_ZBAR); pids.insert(B0_STAR_MINUS); pids.insert(B_STAR_ZBAR); pids.insert(B_STAR_MINUS); pids.insert(B1_L_ZBAR); pids.insert(B1_L_MINUS); pids.insert(B1_H_ZBAR); pids.insert(B1_H_MINUS); pids.insert(B2_STAR_ZBAR); pids.insert(B2_STAR_MINUS); pids.insert(BS_ZBAR); pids.insert(BS0_STAR_ZBAR); pids.insert(BS_STAR_ZBAR); pids.insert(BS1_L_ZBAR); pids.insert(BS1_H_ZBAR); pids.insert(BS2_STAR_ZBAR); pids.insert(BC_MINUS); pids.insert(BC0_STAR_MINUS); pids.insert(BC_STAR_MINUS); pids.insert(BC1_L_MINUS); pids.insert(BC1_H_MINUS); pids.insert(BC2_STAR_MINUS); return pids; } ParticleId::Set fill_ccbarmesons() { ParticleId::Set pids; pids.insert(ETAC_1S); pids.insert(CHIC0_1P); pids.insert(ETAC_2S); pids.insert(JPSI_1S); pids.insert(HC_1P); pids.insert(CHIC1_1P); pids.insert(PSI_2S); pids.insert(PSI_3770); pids.insert(PSI_4040); pids.insert(PSI_4160); pids.insert(PSI_4415); pids.insert(CHIC2_1P); pids.insert(PSI_3836); return pids; } ParticleId::Set fill_bbbarmesons() { ParticleId::Set pids; pids.insert(ETAB_1S); pids.insert(CHIB0_1P); pids.insert(ETAB_2S); pids.insert(CHIB0_2P); pids.insert(ETAB_3S); pids.insert(CHIB0_3P); pids.insert(UPSILON_1S); pids.insert(HB_1P); pids.insert(CHIB1_1P); pids.insert(UPSILON1_1D); pids.insert(UPSILON_2S); pids.insert(HB_2P); pids.insert(CHIB1_2P); pids.insert(UPSILON1_2D); pids.insert(UPSILON_3S); pids.insert(HB_3P); pids.insert(CHIB1_3P); pids.insert(UPSILON_4S); pids.insert(UPSILON_10860); pids.insert(UPSILON_11020); pids.insert(CHIB2_1P); pids.insert(ETAB2_1D); pids.insert(UPSILON2_1D); pids.insert(CHIB2_2P); pids.insert(ETAB2_2D); pids.insert(UPSILON2_2D); pids.insert(CHIB2_3P); pids.insert(UPSILON3_1D); pids.insert(UPSILON3_2D); return pids; } ParticleId::Set fill_udbaryons() { ParticleId::Set pids; pids.insert(PROTON); pids.insert(NEUTRON); pids.insert(DELTA_PLUS_PLUS); pids.insert(DELTA_PLUS); pids.insert(DELTA_ZERO); pids.insert(DELTA_MINUS); return pids; } ParticleId::Set fill_sbaryons() { ParticleId::Set pids; pids.insert(LAMBDA); pids.insert(SIGMA_PLUS); pids.insert(SIGMA_ZERO); pids.insert(SIGMA_MINUS); pids.insert(SIGMA_STAR_PLUS); pids.insert(SIGMA_STAR_ZERO); pids.insert(SIGMA_STAR_MINUS); pids.insert(XI_ZERO); pids.insert(XI_MINUS); pids.insert(XI_STAR_ZERO); pids.insert(XI_STAR_MINUS); pids.insert(OMEGA_MINUS); return pids; } ParticleId::Set fill_cbaryons() { ParticleId::Set pids; pids.insert(LAMBDAC); pids.insert(SIGMAC_PLUS_PLUS); pids.insert(SIGMAC_PLUS); pids.insert(SIGMAC_ZERO); pids.insert(SIGMAC_STAR_PLUS_PLUS); pids.insert(SIGMAC_STAR_PLUS); pids.insert(SIGMAC_STAR_ZERO); pids.insert(XIC_PLUS); pids.insert(XIC_ZERO); pids.insert(XIC_PRIME_PLUS); pids.insert(XIC_PRIME_ZERO); pids.insert(XIC_STAR_PLUS); pids.insert(XIC_STAR_ZERO); pids.insert(OMEGAC_ZERO); pids.insert(OMEGAC_STAR_ZERO); pids.insert(XICC_PLUS); pids.insert(XICC_PLUS_PLUS); pids.insert(XICC_STAR_PLUS); pids.insert(XICC_STAR_PLUS_PLUS); pids.insert(OMEGACC_PLUS); pids.insert(OMEGACC_STAR_PLUS); pids.insert(OMEGACCC_PLUS_PLUS); return pids; } ParticleId::Set fill_bbaryons() { ParticleId::Set pids; pids.insert(LAMBDAB_ZERO); pids.insert(SIGMAB_MINUS); pids.insert(SIGMAB_ZERO); pids.insert(SIGMAB_PLUS); pids.insert(SIGMAB_STAR_MINUS); pids.insert(SIGMAB_STAR_ZERO); pids.insert(SIGMAB_STAR_PLUS); pids.insert(XIB_MINUS); pids.insert(XIB_ZERO); pids.insert(XIB_PRIME_MINUS); pids.insert(XIB_PRIME_ZERO); pids.insert(XIB_STAR_MINUS); pids.insert(XIB_STAR_ZERO); pids.insert(OMEGAB_MINUS); pids.insert(OMEGAB_STAR_MINUS); pids.insert(XIBC_ZERO); pids.insert(XIBC_PLUS); pids.insert(XIBC_PRIME_ZERO); pids.insert(XIBC_PRIME_PLUS); pids.insert(XIBC_STAR_ZERO); pids.insert(XIBC_STAR_PLUS); pids.insert(OMEGABC_ZERO); pids.insert(OMEGABC_PRIME_ZERO); pids.insert(OMEGABC_STAR_ZERO); pids.insert(OMEGABCC_PLUS); pids.insert(OMEGABCC_STAR_PLUS); pids.insert(XIBB_MINUS); pids.insert(XIBB_ZERO); pids.insert(XIBB_STAR_MINUS); pids.insert(XIBB_STAR_ZERO); pids.insert(OMEGABB_MINUS); pids.insert(OMEGABB_STAR_MINUS); pids.insert(OMEGABBC_ZERO); pids.insert(OMEGABBC_STAR_ZERO); pids.insert(OMEGABBB_MINUS); return pids; } ParticleId::Set fill_udmesons() { ParticleId::Set pids; pids.insert(I0MESONS.begin(), I0MESONS.end()); pids.insert(I1MESONS.begin(), I1MESONS.end()); return pids; } ParticleId::Set fill_mesons() { ParticleId::Set pids; pids.insert(UDMESONS.begin(), UDMESONS.end()); pids.insert(SMESONS.begin(), SMESONS.end()); pids.insert(CMESONS.begin(), CMESONS.end()); pids.insert(BMESONS.begin(), BMESONS.end()); return pids; } ParticleId::Set fill_baryons() { ParticleId::Set pids; pids.insert(UDBARYONS.begin(), UDBARYONS.end()); pids.insert(SBARYONS.begin(), SBARYONS.end()); pids.insert(CBARYONS.begin(), CBARYONS.end()); pids.insert(BBARYONS.begin(), BBARYONS.end()); return pids; } ParticleId::Set fill_particles() { ParticleId::Set pids; pids.insert(LEPTONS.begin(), LEPTONS.end()); pids.insert(BOSONS.begin(), BOSONS.end()); pids.insert(MESONS.begin(), MESONS.end()); pids.insert(BARYONS.begin(), BARYONS.end()); return pids; } //********************************************************************** // Reorder indices for sorting. int sort_index(ParticleId pid) { int idx = 0; idx += 1000000*pid.nj(); idx += 100000*pid.nl(); idx += 10000*pid.nr(); idx += 1000*pid.n(); idx += 100*pid.nq1(); idx += 10*pid.nq2(); idx += 1*pid.nq3(); return idx; } // Order based on heavy quarks only. int quark_sort_index(ParticleId pid) { int q1 = pid.nq1(); if ( q1 == 2 ) q1 = 1; int q2 = pid.nq2(); if ( q2 == 2 ) q2 = 1; int q3 = pid.nq3(); if ( q3 == 2 ) q3 = 1; int idx = 0; idx += 100*q1; idx += 10*q2; idx += 1*q3; return idx; } //********************************************************************** ParticleTable PTABLE; //********************************************************************** } // end unnamed namespace //********************************************************************** // Static data. //********************************************************************** extern const ParticleId::Set QUARKS = fill_quarks(); extern const ParticleId::Set ANTIQUARKS = fill_antiquarks(); extern const ParticleId::Set LEPTONS = fill_leptons(); extern const ParticleId::Set ANTILEPTONS = fill_antileptons(); extern const ParticleId::Set BOSONS = fill_bosons(); extern const ParticleId::Set I1MESONS = fill_i1mesons(); extern const ParticleId::Set ANTI_I1MESONS = fill_antii1mesons(); extern const ParticleId::Set I0MESONS = fill_i0mesons(); extern const ParticleId::Set SMESONS = fill_smesons(); extern const ParticleId::Set ANTI_SMESONS = fill_antismesons(); extern const ParticleId::Set CMESONS = fill_cmesons(); extern const ParticleId::Set ANTI_CMESONS = fill_anticmesons(); extern const ParticleId::Set BMESONS = fill_bmesons(); extern const ParticleId::Set ANTI_BMESONS = fill_antibmesons(); extern const ParticleId::Set CCBARMESONS = fill_ccbarmesons(); extern const ParticleId::Set BBBARMESONS = fill_bbbarmesons(); extern const ParticleId::Set UDBARYONS = fill_udbaryons(); extern const ParticleId::Set SBARYONS = fill_sbaryons(); extern const ParticleId::Set CBARYONS = fill_cbaryons(); extern const ParticleId::Set BBARYONS = fill_bbaryons(); extern const ParticleId::Set UDMESONS = fill_udmesons(); extern const ParticleId::Set MESONS = fill_mesons(); extern const ParticleId::Set BARYONS = fill_baryons(); extern const ParticleId::Set PARTICLES = fill_particles(); //********************************************************************** // Non-static member functions. //********************************************************************** // Constructor. ParticleId::ParticleId(int id) : _id(id) { } //********************************************************************** // Return the integer ID. int ParticleId::id() const { return _id; } //********************************************************************** // Return digits. int ParticleId::nsign() const { if ( _id == 0 ) return 0; if ( _id < 0 ) return -1; return 1; } int ParticleId::n() const { int idx = abs(_id)/1000000; return idx - 10*(idx/10); } int ParticleId::nr() const { int idx = abs(_id)/100000; return idx - 10*(idx/10); } int ParticleId::nl() const { int idx = abs(_id)/10000; return idx - 10*(idx/10); } int ParticleId::nq1() const { int idx = abs(_id)/1000; return idx - 10*(idx/10); } int ParticleId::nq2() const { int idx = abs(_id)/100; return idx - 10*(idx/10); } int ParticleId::nq3() const { int idx = abs(_id)/10; return idx - 10*(idx/10); } int ParticleId::nj() const { int idx = abs(_id); return idx - 10*(idx/10); } //********************************************************************** // Comparison. bool ParticleId::is(ParticleId pid) const { return id() == pid.id(); } bool ParticleId::lessthan(ParticleId pid) const { int lhs = id(); int rhs = pid.id(); if ( abs(lhs) == abs(rhs) ) { return lhs < rhs; } /* // First sort by heavy quark. int lq = quark_sort_index(*this); int rq = quark_sort_index(pid); if ( lq != rq ) return lq < rq; // Finally sort as specified in sort_index. return sort_index(*this) < sort_index(pid); */ return abs(lhs) < abs(rhs); } //********************************************************************** // Test standard model type. bool ParticleId::is_quark() const { return abs(_id) >0 && abs(_id)<7; } bool ParticleId::is_lepton() const { return abs(_id)>10 && abs(_id)<17; } bool ParticleId::is_gauge_boson() const { return is(GAMMA) || is(Z) || is(W_PLUS) || is(W_MINUS); } bool ParticleId::is_higgs() const { return is(HIGGS); } bool ParticleId::is_meson() const { return nq1()==0 && nq2()!=0 && nq3()!=0; } bool ParticleId::is_baryon() const { return nq1()!=0 && nq2()!=0 && nq3()!=0; } bool ParticleId::is_hadron() const { return is_meson() || is_baryon(); } //********************************************************************** // Particle properties. bool ParticleId::has_name() const { return PTABLE.has_name(id()); } string ParticleId::name() const { return PTABLE.name(id()); } bool ParticleId::has_mass() const { return PTABLE.has_mass(id()); } double ParticleId::mass() const { return PTABLE.mass(id()); } double ParticleId::dmass1() const { return PTABLE.dmass1(id()); } double ParticleId::dmass2() const { return PTABLE.dmass2(id()); } bool ParticleId::has_width() const { return PTABLE.has_width(id()); } double ParticleId::width() const { return PTABLE.width(id()); } double ParticleId::dwidth1() const { return PTABLE.dwidth1(id()); } double ParticleId::dwidth2() const { return PTABLE.dwidth2(id()); } //********************************************************************** } // end namespace pdg //********************************************************************** // Free functions. //********************************************************************** // Output stream. ostream& operator<<(ostream& lhs, ParticleId rhs) { lhs << setw(8) << rhs.id(); string name = ""; if ( rhs.has_name() ) { name = rhs.name(); } lhs << " " << setw(20) << name; if ( rhs.has_mass() ) { lhs << setw(12) << rhs.mass(); } else { lhs << " "; } if ( rhs.has_width() ) { lhs << setw(13) << rhs.width(); } else { lhs << " "; } return lhs; } ostream& operator<<(ostream& lhs, const ParticleId::Set& rhs) { ParticleId::Set::const_iterator ipid=rhs.begin(); lhs << " ID Name Mass (GeV) Width (GeV)" << endl; lhs << " ------- -------------------- ----------- ------------" << endl; while ( ipid!=rhs.end() ) { lhs << setw(10) << *ipid; ++ipid; if ( ipid == rhs.end() ) break; lhs << endl; } return lhs; } //**********************************************************************