|
47 | 47 | #include "Math/Vector4D.h" |
48 | 48 | #include "TString.h" |
49 | 49 |
|
| 50 | +#include <algorithm> |
50 | 51 | #include <array> |
51 | 52 | #include <format> |
52 | 53 | #include <map> |
@@ -127,8 +128,8 @@ struct DileptonMC { |
127 | 128 | Configurable<int> cfg_nbin_aco{"cfg_nbin_aco", 1, "number of bins for acoplanarity"}; // 10 |
128 | 129 | Configurable<int> cfg_nbin_asym_pt{"cfg_nbin_asym_pt", 1, "number of bins for pt asymmetry"}; // 10 |
129 | 130 | Configurable<int> cfg_nbin_dphi_e_ee{"cfg_nbin_dphi_e_ee", 1, "number of bins for dphi_ee_e"}; // 18 |
130 | | - ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, 0.f, 2 * M_PI}, "phi bins for polarization analysis"}; |
131 | 131 | ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {1, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; |
| 132 | + ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; |
132 | 133 | Configurable<int> cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; |
133 | 134 | ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {1, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> |
134 | 135 |
|
@@ -803,27 +804,57 @@ struct DileptonMC { |
803 | 804 | } |
804 | 805 |
|
805 | 806 | template <typename TTrack, typename TMCParticles> |
806 | | - int FindLF(TTrack const& posmc, TTrack const& negmc, TMCParticles const& mcparticles) |
| 807 | + int FindSMULS(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) |
807 | 808 | { |
808 | 809 | int arr[] = { |
809 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 22, mcparticles), |
810 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 111, mcparticles), |
811 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 221, mcparticles), |
812 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 331, mcparticles), |
813 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 113, mcparticles), |
814 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 223, mcparticles), |
815 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 333, mcparticles), |
816 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 443, mcparticles), |
817 | | - FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 100443, mcparticles) |
818 | | - // FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 553, mcparticles), |
819 | | - // FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 100553, mcparticles), |
820 | | - // FindCommonMotherFrom2Prongs(posmc, negmc, -pdg_lepton, pdg_lepton, 200553, mcparticles) |
| 810 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 22, mcparticles), |
| 811 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 111, mcparticles), |
| 812 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 221, mcparticles), |
| 813 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 331, mcparticles), |
| 814 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 113, mcparticles), |
| 815 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 223, mcparticles), |
| 816 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 333, mcparticles), |
| 817 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 443, mcparticles), |
| 818 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100443, mcparticles) |
| 819 | + // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 553, mcparticles), |
| 820 | + // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100553, mcparticles), |
| 821 | + // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 200553, mcparticles) |
821 | 822 | }; |
822 | 823 | int size = sizeof(arr) / sizeof(*arr); |
823 | 824 | int max = *std::max_element(arr, arr + size); |
824 | 825 | return max; |
825 | 826 | } |
826 | 827 |
|
| 828 | + template <typename TTrack, typename TMCParticles> |
| 829 | + int FindSMLSPP(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) |
| 830 | + { |
| 831 | + int arr[] = { |
| 832 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 111, mcparticles), |
| 833 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 221, mcparticles), |
| 834 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 331, mcparticles), |
| 835 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 113, mcparticles), |
| 836 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 223, mcparticles), |
| 837 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 333, mcparticles)}; |
| 838 | + int size = sizeof(arr) / sizeof(*arr); |
| 839 | + int max = *std::max_element(arr, arr + size); |
| 840 | + return max; |
| 841 | + } |
| 842 | + |
| 843 | + template <typename TTrack, typename TMCParticles> |
| 844 | + int FindSMLSMM(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) |
| 845 | + { |
| 846 | + int arr[] = { |
| 847 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 111, mcparticles), |
| 848 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 221, mcparticles), |
| 849 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 331, mcparticles), |
| 850 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 113, mcparticles), |
| 851 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 223, mcparticles), |
| 852 | + FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 333, mcparticles)}; |
| 853 | + int size = sizeof(arr) / sizeof(*arr); |
| 854 | + int max = *std::max_element(arr, arr + size); |
| 855 | + return max; |
| 856 | + } |
| 857 | + |
827 | 858 | template <bool isSmeared, typename T> |
828 | 859 | bool isInAcceptance(T const& lepton) |
829 | 860 | { |
@@ -1490,7 +1521,7 @@ struct DileptonMC { |
1490 | 1521 | } else if (cfgPolarizationFrame == 1) { |
1491 | 1522 | o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrP1, arrP2, beamE1, beamE2, beamP1, beamP2, t1.sign(), cos_thetaPol, phiPol); |
1492 | 1523 | } |
1493 | | - o2::math_utils::bringTo02Pi(phiPol); |
| 1524 | + o2::math_utils::bringToPMPi(phiPol); |
1494 | 1525 | float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f; |
1495 | 1526 |
|
1496 | 1527 | if ((FindCommonMotherFrom2ProngsWithoutPDG(t1mc, t2mc) > 0 || IsHF(t1mc, t2mc, mcparticles) > 0) && is_pair_from_same_mcevent) { // for bkg study |
@@ -1533,7 +1564,7 @@ struct DileptonMC { |
1533 | 1564 | if (cfgRequireTrueAssociation && (t1mc.emmceventId() != collision.emmceventId() || t2mc.emmceventId() != collision.emmceventId())) { |
1534 | 1565 | return false; |
1535 | 1566 | } |
1536 | | - int mother_id = FindLF(t1mc, t2mc, mcparticles); |
| 1567 | + int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)}); |
1537 | 1568 | int hfee_type = IsHF(t1mc, t2mc, mcparticles); |
1538 | 1569 | if (mother_id < 0 && hfee_type < 0) { |
1539 | 1570 | return false; |
@@ -1708,7 +1739,7 @@ struct DileptonMC { |
1708 | 1739 | return false; |
1709 | 1740 | } |
1710 | 1741 |
|
1711 | | - int mother_id = FindLF(t1, t2, mcparticles); |
| 1742 | + int mother_id = std::max({FindSMULS(t1, t2, mcparticles), FindSMULS(t2, t1, mcparticles), FindSMLSPP(t1, t2, mcparticles), FindSMLSMM(t1, t2, mcparticles)}); |
1712 | 1743 | int hfee_type = IsHF(t1, t2, mcparticles); |
1713 | 1744 | if (mother_id < 0 && hfee_type < 0) { |
1714 | 1745 | return false; |
@@ -1797,7 +1828,7 @@ struct DileptonMC { |
1797 | 1828 | } else if (cfgPolarizationFrame == 1) { |
1798 | 1829 | o2::aod::pwgem::dilepton::utils::pairutil::getAngleHX(arrP1, arrP2, beamE1, beamE2, beamP1, beamP2, -t1.pdgCode() / pdg_lepton, cos_thetaPol, phiPol); |
1799 | 1830 | } |
1800 | | - o2::math_utils::bringTo02Pi(phiPol); |
| 1831 | + o2::math_utils::bringToPMPi(phiPol); |
1801 | 1832 | float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f; |
1802 | 1833 |
|
1803 | 1834 | // bool isInAcc = isInAcceptance<isSmeared>(t1) && isInAcceptance<isSmeared>(t2); |
@@ -2226,7 +2257,7 @@ struct DileptonMC { |
2226 | 2257 | if (!((t1mc.isPhysicalPrimary() || t1mc.producedByGenerator()) && (t2mc.isPhysicalPrimary() || t2mc.producedByGenerator()))) { |
2227 | 2258 | return false; |
2228 | 2259 | } |
2229 | | - int mother_id = FindLF(t1mc, t2mc, mcparticles); |
| 2260 | + int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)}); |
2230 | 2261 | int hfee_type = IsHF(t1mc, t2mc, mcparticles); |
2231 | 2262 | if (mother_id < 0 && hfee_type < 0) { |
2232 | 2263 | return false; |
|
0 commit comments