From 658fb4ced272dda67b8a2e2e63fc65e64bacdbf6 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Fri, 30 Jan 2026 18:52:54 +0100 Subject: [PATCH 01/11] Add process function for systematic --- PWGLF/Tasks/Resonances/f1protoncorrelation.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 63568887fab..2627cb00e01 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -952,6 +952,7 @@ struct f1protoncorrelation { { const float maxMomPi = maxMomentumPion; const float maxMomK = maxMomentumKaon; + // const float pTofPiMin = momentumTOFPionMin; // const float pTofPiMax = momentumTOFPionMax; // const float pTofKMin = momentumTOFKaonMin; From 6c70891020c6b067384bc5f0958440cb18d012b7 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Sun, 1 Feb 2026 11:04:28 +0100 Subject: [PATCH 02/11] Fix clang issue --- PWGLF/Tasks/Resonances/f1protoncorrelation.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 2627cb00e01..63568887fab 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -952,7 +952,6 @@ struct f1protoncorrelation { { const float maxMomPi = maxMomentumPion; const float maxMomK = maxMomentumKaon; - // const float pTofPiMin = momentumTOFPionMin; // const float pTofPiMax = momentumTOFPionMax; // const float pTofKMin = momentumTOFKaonMin; From db909133b909473e029d6989384c89c59073a072 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Wed, 25 Feb 2026 19:58:49 +0100 Subject: [PATCH 03/11] Old process function --- PWGLF/Tasks/Resonances/f1protoncorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 63568887fab..e96cc342fdc 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -1056,7 +1056,7 @@ struct f1protoncorrelation { histos.fill(HIST("hPhaseSpaceProtonKaonSame"), Proton.Eta() - Kaon.Eta(), PhiAtSpecificRadiiTPC(Proton, Kaon, protontrack.protonCharge(), kaonCharge, bz, bz), relative_momentum); // Phase Space Proton kaon if (pionCharge == protontrack.protonCharge()) histos.fill(HIST("hPhaseSpaceProtonPionSame"), Proton.Eta() - Pion.Eta(), PhiAtSpecificRadiiTPC(Proton, Pion, protontrack.protonCharge(), pionCharge, bz, bz), relative_momentum); // Phase Space Proton Pion - histos.fill(HIST("h2SameEventf1pptCorrelation"), F1.M(), relative_momentum, Proton.Pt()); + histos.fill(HIST("h2SameEventf1pptCorrelation"), F1.M(), relative_momentum, Proton.Pt()); } activePair.push_back(sysId); } From 4b837afc498f1f1065e66974150936395682fff5 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Mon, 2 Mar 2026 18:33:50 +0100 Subject: [PATCH 04/11] Add Event loss in phi meson task and add MC process function for spincorrelation task --- .../Strangeness/lambdaspincorrderived.cxx | 55 ++++++++++++++++--- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index a6845963d35..3451f919984 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -1192,19 +1192,36 @@ struct lambdaspincorrderived { if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) continue; - // Collect partners from nominal key, plus wrapped neighbor only for φ-edge bins std::vector matches; - matches.reserve(128); // or keep binVec.size() if you prefer + const int maxKeep = maxMatchesPerPair.value; // default 25 + matches.reserve(std::max(64, maxKeep > 0 ? maxKeep : 64)); + const int64_t curColIdx = static_cast(collision1.index()); + std::unordered_set seenRow; + seenRow.reserve(static_cast(std::max(256, 4 * (maxKeep > 0 ? maxKeep : 64)))); - auto collectFrom = [&](int phiBinUse) { - const size_t keyUse = linearKey(colBin, status, ptB, etaB, phiBinUse, mB, + auto collectFrom = [&](int ptUse, int etaUse, int phiUse) { + if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { + return; // early stop + } + + const size_t keyUse = linearKey(colBin, status, ptUse, etaUse, phiUse, mB, nStat, nPt, nEta, nPhi, nM); auto const& vec = buffer[keyUse]; + for (const auto& bc : vec) { + if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { + break; + } if (bc.collisionIdx == curColIdx) { continue; // must be from different event } + + // dedupe first + if (!seenRow.insert(bc.rowIndex).second) { + continue; + } + auto tX = V0s.iteratorAt(static_cast(bc.rowIndex)); if (!selectionV0(tX)) { continue; @@ -1212,17 +1229,37 @@ struct lambdaspincorrderived { if (!checkKinematics(t1, tX)) { continue; } + matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); } }; // 1) nominal φ-bin collectFrom(phiB); - // 2) wrap only at boundaries: 0 <-> nPhi-1 - if (phiB == 0) { - collectFrom(nPhi - 1); - } else if (phiB == nPhi - 1) { - collectFrom(0); + // scan pt±1, eta±1, phi±1 (wrapped) + for (int dpt = -1; dpt <= 1; ++dpt) { + const int ptUse = ptB + dpt; + if (ptUse < 0 || ptUse >= nPt) { + continue; + } + for (int deta = -1; deta <= 1; ++deta) { + const int etaUse = etaB + deta; + if (etaUse < 0 || etaUse >= nEta) { + continue; + } + for (int phiUse : phiBins) { + collectFrom(ptUse, etaUse, phiUse); + if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { + break; + } + } + if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { + break; + } + } + if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { + break; + } } if (matches.empty()) { From 2ec008d7d7f57138c0a243b60b51a05c5ae18a9a Mon Sep 17 00:00:00 2001 From: skundu692 Date: Mon, 2 Mar 2026 20:29:09 +0100 Subject: [PATCH 05/11] Add new MC process function for mixing --- .../Strangeness/lambdaspincorrderived.cxx | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index 3451f919984..9f564fd5a22 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -1192,36 +1192,19 @@ struct lambdaspincorrderived { if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) continue; + // Collect partners from nominal key, plus wrapped neighbor only for φ-edge bins std::vector matches; - const int maxKeep = maxMatchesPerPair.value; // default 25 - matches.reserve(std::max(64, maxKeep > 0 ? maxKeep : 64)); - + matches.reserve(128); // or keep binVec.size() if you prefer const int64_t curColIdx = static_cast(collision1.index()); - std::unordered_set seenRow; - seenRow.reserve(static_cast(std::max(256, 4 * (maxKeep > 0 ? maxKeep : 64)))); - - auto collectFrom = [&](int ptUse, int etaUse, int phiUse) { - if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { - return; // early stop - } - const size_t keyUse = linearKey(colBin, status, ptUse, etaUse, phiUse, mB, + auto collectFrom = [&](int phiBinUse) { + const size_t keyUse = linearKey(colBin, status, ptB, etaB, phiBinUse, mB, nStat, nPt, nEta, nPhi, nM); auto const& vec = buffer[keyUse]; - for (const auto& bc : vec) { - if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { - break; - } if (bc.collisionIdx == curColIdx) { continue; // must be from different event } - - // dedupe first - if (!seenRow.insert(bc.rowIndex).second) { - continue; - } - auto tX = V0s.iteratorAt(static_cast(bc.rowIndex)); if (!selectionV0(tX)) { continue; @@ -1229,7 +1212,6 @@ struct lambdaspincorrderived { if (!checkKinematics(t1, tX)) { continue; } - matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex}); } }; From afabca56cbcb57853002e43ef93f99238e84740e Mon Sep 17 00:00:00 2001 From: skundu692 Date: Mon, 2 Mar 2026 20:55:25 +0100 Subject: [PATCH 06/11] Fix clang error --- PWGLF/Tasks/Resonances/f1protoncorrelation.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index e96cc342fdc..63568887fab 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -1056,7 +1056,7 @@ struct f1protoncorrelation { histos.fill(HIST("hPhaseSpaceProtonKaonSame"), Proton.Eta() - Kaon.Eta(), PhiAtSpecificRadiiTPC(Proton, Kaon, protontrack.protonCharge(), kaonCharge, bz, bz), relative_momentum); // Phase Space Proton kaon if (pionCharge == protontrack.protonCharge()) histos.fill(HIST("hPhaseSpaceProtonPionSame"), Proton.Eta() - Pion.Eta(), PhiAtSpecificRadiiTPC(Proton, Pion, protontrack.protonCharge(), pionCharge, bz, bz), relative_momentum); // Phase Space Proton Pion - histos.fill(HIST("h2SameEventf1pptCorrelation"), F1.M(), relative_momentum, Proton.Pt()); + histos.fill(HIST("h2SameEventf1pptCorrelation"), F1.M(), relative_momentum, Proton.Pt()); } activePair.push_back(sysId); } From ebf13af802b661cc1d376927c955420cd52b7d25 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Tue, 3 Mar 2026 21:19:20 +0100 Subject: [PATCH 07/11] Add new process function for mixing --- PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index 9f564fd5a22..e6e7449a841 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -202,6 +202,7 @@ struct lambdaspincorrderived { Configurable ConfWeightPathLAL2{"ConfWeightPathLAL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathALL2{"ConfWeightPathALL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; + // Mixing ///////// Configurable cfgV5NeighborPt{"cfgV5NeighborPt", 0, "v5: neighbor bins in pT (use symmetric ±N, edge-safe)"}; @@ -1775,6 +1776,7 @@ struct lambdaspincorrderived { out.erase(std::unique(out.begin(), out.end()), out.end()); } + static inline void collectNeighborBinsClamp(int b, int nBins, int nNeighbor, std::vector& out) { out.clear(); @@ -1915,7 +1917,6 @@ struct lambdaspincorrderived { continue; // same-event ordering } - // no shared daughters (same-event) if (t1.protonIndex() == t2.protonIndex()) continue; if (t1.pionIndex() == t2.pionIndex()) @@ -2149,6 +2150,7 @@ struct lambdaspincorrderived { continue; const int status = mcacc::v0Status(t1); + if (status < 0 || status >= nStat) { continue; } From 83bc66541e9ae75cbcb8f7389f1db6b09ed36cc5 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Thu, 5 Mar 2026 18:19:17 +0100 Subject: [PATCH 08/11] Add new process function for spin correlation --- .../Strangeness/lambdaspincorrderived.cxx | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index e6e7449a841..cf4b1d86183 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -1219,30 +1219,11 @@ struct lambdaspincorrderived { // 1) nominal φ-bin collectFrom(phiB); - // scan pt±1, eta±1, phi±1 (wrapped) - for (int dpt = -1; dpt <= 1; ++dpt) { - const int ptUse = ptB + dpt; - if (ptUse < 0 || ptUse >= nPt) { - continue; - } - for (int deta = -1; deta <= 1; ++deta) { - const int etaUse = etaB + deta; - if (etaUse < 0 || etaUse >= nEta) { - continue; - } - for (int phiUse : phiBins) { - collectFrom(ptUse, etaUse, phiUse); - if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { - break; - } - } - if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { - break; - } - } - if (maxKeep > 0 && static_cast(matches.size()) >= maxKeep) { - break; - } + // 2) wrap only at boundaries: 0 <-> nPhi-1 + if (phiB == 0) { + collectFrom(nPhi - 1); + } else if (phiB == nPhi - 1) { + collectFrom(0); } if (matches.empty()) { From 220e5a03edaff85aa62f545ef2775eee07035b6b Mon Sep 17 00:00:00 2001 From: skundu692 Date: Sat, 7 Mar 2026 13:16:21 +0100 Subject: [PATCH 09/11] Fix event mixing sliding for spin correlation --- PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index cf4b1d86183..ece5c8265da 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -1898,6 +1898,7 @@ struct lambdaspincorrderived { continue; // same-event ordering } + // no shared daughters (same-event) if (t1.protonIndex() == t2.protonIndex()) continue; if (t1.pionIndex() == t2.pionIndex()) @@ -2131,7 +2132,6 @@ struct lambdaspincorrderived { continue; const int status = mcacc::v0Status(t1); - if (status < 0 || status >= nStat) { continue; } From 59d44b367a24d1376923f969854ea08d79ad65ca Mon Sep 17 00:00:00 2001 From: skundu692 Date: Sat, 7 Mar 2026 13:24:50 +0100 Subject: [PATCH 10/11] Apply clang-format --- PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index ece5c8265da..a6845963d35 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -202,7 +202,6 @@ struct lambdaspincorrderived { Configurable ConfWeightPathLAL2{"ConfWeightPathLAL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathALL2{"ConfWeightPathALL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; - // Mixing ///////// Configurable cfgV5NeighborPt{"cfgV5NeighborPt", 0, "v5: neighbor bins in pT (use symmetric ±N, edge-safe)"}; @@ -1757,7 +1756,6 @@ struct lambdaspincorrderived { out.erase(std::unique(out.begin(), out.end()), out.end()); } - static inline void collectNeighborBinsClamp(int b, int nBins, int nNeighbor, std::vector& out) { out.clear(); From eabfe0e7f74a85961b25e1c505b22adff9bca1b2 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Sun, 8 Mar 2026 11:32:19 +0100 Subject: [PATCH 11/11] Change Phi binning range and add QA histogram to monitor centrality distribution --- .../Strangeness/lambdaspincorrderived.cxx | 72 +++++++++++++++---- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index a6845963d35..0ff87544f97 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -191,7 +191,9 @@ struct lambdaspincorrderived { TH3D* hweight22; TH3D* hweight32; TH3D* hweight42; + TH2D* hweightCentPair = nullptr; + Configurable ConfWeightPathCentPair{"ConfWeightPathCentPair", "", "Centrality x pair-type weight path"}; Configurable ConfWeightPathLL{"ConfWeightPathLL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathALAL{"ConfWeightPathALAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathLAL{"ConfWeightPathLAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; @@ -278,6 +280,9 @@ struct lambdaspincorrderived { histos.add("ptCent", "ptCent", HistType::kTH2D, {{100, 0.0, 10.0}, {8, 0.0, 80.0}}, true); histos.add("etaCent", "etaCent", HistType::kTH2D, {{32, -0.8, 0.8}, {8, 0.0, 80.0}}, true); + histos.add("hCentPairTypeSE", "SE pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); + histos.add("hCentPairTypeME", "ME pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); + // --- 3D SE/ME pair-space maps per category (LL, LAL, ALL, ALAL) histos.add("SE_LL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); histos.add("SE_LAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); @@ -368,6 +373,9 @@ struct lambdaspincorrderived { hweight32 = ccdb->getForTimeStamp(ConfWeightPathALL2.value, cfgCcdbParam.nolaterthan.value); hweight42 = ccdb->getForTimeStamp(ConfWeightPathALAL2.value, cfgCcdbParam.nolaterthan.value); } + if (!ConfWeightPathCentPair.value.empty()) { + hweightCentPair = ccdb->getForTimeStamp(ConfWeightPathCentPair.value, cfgCcdbParam.nolaterthan.value); + } } template @@ -694,6 +702,18 @@ struct lambdaspincorrderived { } } + static inline int pairTypeCode(int tag1, int tag2) + { + if (tag1 == 0 && tag2 == 0) { + return 0; // LL + } else if (tag1 == 0 && tag2 == 1) { + return 1; // LAL + } else if (tag1 == 1 && tag2 == 0) { + return 2; // ALL + } else { + return 3; // ALAL + } + } ROOT::Math::PtEtaPhiMVector lambda0, proton0; ROOT::Math::PtEtaPhiMVector lambda, proton; ROOT::Math::PtEtaPhiMVector lambda2, proton2; @@ -737,6 +757,8 @@ struct lambdaspincorrderived { proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton); lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass()); histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi)); + const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status()); + histos.fill(HIST("hCentPairTypeSE"), collision.cent(), ptype, 1.0); if (v0.v0Status() == 0 && v02.v0Status() == 0) { fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0); } @@ -1030,7 +1052,8 @@ struct lambdaspincorrderived { MixBinner(float ptMin_, float ptMax_, float ptStep_, float etaAbsMax, float etaStep_, float phiStep_) - : ptMin(ptMin_), ptMax(ptMax_), ptStep(ptStep_), etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), phiMin(0.f), phiMax(static_cast(2.0 * TMath::Pi())), phiStep(phiStep_) + : ptMin(ptMin_), ptMax(ptMax_), ptStep(ptStep_), etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), phiMin(-static_cast(TMath::Pi())), phiMax(+static_cast(TMath::Pi())), phiStep(phiStep_) + // : ptMin(ptMin_), ptMax(ptMax_), ptStep(ptStep_), etaMin(-etaAbsMax), etaMax(+etaAbsMax), etaStep(etaStep_), phiMin(0.f), phiMax(static_cast(2.0 * TMath::Pi())), phiStep(phiStep_) { ptStep = (ptStep > 0.f ? ptStep : 0.1f); etaStep = (etaStep > 0.f ? etaStep : 0.1f); @@ -1138,7 +1161,7 @@ struct lambdaspincorrderived { // Bin kinematics (φ already constrained via your call-site) const int ptB = mb.ptBin(t.lambdaPt()); const int etaB = mb.etaBin(t.lambdaEta()); - const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), 0.0F, harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), -TMath::Pi(), harmonic)); const int mB = mb.massBin(t.lambdaMass()); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) continue; @@ -1187,7 +1210,7 @@ struct lambdaspincorrderived { // Bin of t1 defines where to search (exact bin, but handle φ wrap at edges) const int ptB = mb.ptBin(t1.lambdaPt()); const int etaB = mb.etaBin(t1.lambdaEta()); - const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), 0.0F, harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), -TMath::Pi(), harmonic)); const int mB = mb.massBin(t1.lambdaMass()); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) continue; @@ -1410,6 +1433,8 @@ struct lambdaspincorrderived { RecoDecay::constrainAngle(mcacc::lamPhi(v0) - mcacc::lamPhi(v02), -TMath::Pi(), harmonicDphi)); + const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); + histos.fill(HIST("hCentPairTypeSE"), mcacc::cent(collision), ptype, 1.0); // datatype=0 (same event) fillHistograms(mcacc::v0Status(v0), mcacc::v0Status(v02), lambda, lambda2, proton, proton2, @@ -1573,7 +1598,7 @@ struct lambdaspincorrderived { const int ptB = mb.ptBin(mcacc::lamPt(t)); const int etaB = mb.etaBin(mcacc::lamEta(t)); - const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), 0.0F, harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), -TMath::Pi(), harmonic)); const int mB = mb.massBin(mcacc::lamMass(t)); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) { continue; @@ -1625,7 +1650,7 @@ struct lambdaspincorrderived { const int ptB = mb.ptBin(mcacc::lamPt(t1)); const int etaB = mb.etaBin(mcacc::lamEta(t1)); - const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t1), 0.0F, harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t1), -TMath::Pi(), harmonic)); const int mB = mb.massBin(mcacc::lamMass(t1)); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) { continue; @@ -1846,7 +1871,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv.Rapidity()); // treat "eta axis" as rapidity axis } - const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), 0.0F, harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(t.lambdaPhi(), -TMath::Pi(), harmonic)); const int mB = mb.massBin(t.lambdaMass()); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) { @@ -1919,7 +1944,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv1.Rapidity()); } - const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), 0.0F, harmonic)); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(t1.lambdaPhi(), -TMath::Pi(), harmonic)); const int mB = mb.massBin(t1.lambdaMass()); if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0) { @@ -2011,12 +2036,22 @@ struct lambdaspincorrderived { auto lambda2 = ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass()); + const int ptype = pairTypeCode(tX.v0Status(), t2.v0Status()); + double centPairWeight = 1.0; + if (hweightCentPair) { + const int bin = hweightCentPair->FindBin(col1.cent(), ptype); + centPairWeight = hweightCentPair->GetBinContent(bin); + if (centPairWeight <= 0.0) { + centPairWeight = 1.0; + } + } + const float meWeight = wBase * centPairWeight; const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wBase); - + histos.fill(HIST("hCentPairTypeME"), col1.cent(), ptype, wBase); fillHistograms(tX.v0Status(), t2.v0Status(), lambda, lambda2, proton, proton2, - /*datatype=*/1, /*mixpairweight=*/wBase); + /*datatype=*/1, /*mixpairweight=*/meWeight); } } } @@ -2076,7 +2111,7 @@ struct lambdaspincorrderived { etaB = mb.etaBin(lv.Rapidity()); } - const int phiB = mb.phiBin(phi0To2Pi(mcacc::lamPhi(t))); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t), -TMath::Pi(), harmonic)); if (ptB < 0 || etaB < 0 || phiB < 0) { continue; } @@ -2142,8 +2177,7 @@ struct lambdaspincorrderived { mcacc::lamPhi(t1), mcacc::lamMass(t1)); etaB = mb.etaBin(lv1.Rapidity()); } - - const int phiB = mb.phiBin(phi0To2Pi(mcacc::lamPhi(t1))); + const int phiB = mb.phiBin(RecoDecay::constrainAngle(mcacc::lamPhi(t1), -TMath::Pi(), harmonic)); if (ptB < 0 || etaB < 0 || phiB < 0) { continue; } @@ -2230,12 +2264,22 @@ struct lambdaspincorrderived { auto l2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)); + const int ptype = pairTypeCode(mcacc::v0Status(tX), mcacc::v0Status(t2)); + double centPairWeight = 1.0; + if (hweightCentPair) { + const int bin = hweightCentPair->FindBin(mcacc::cent(col1), ptype); + centPairWeight = hweightCentPair->GetBinContent(bin); + if (centPairWeight <= 0.0) { + centPairWeight = 1.0; + } + } + const float meWeight = wBase * centPairWeight; const float dPhi = deltaPhiMinusPiToPi((float)lX.Phi(), (float)l2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wBase); - + histos.fill(HIST("hCentPairTypeME"), mcacc::cent(col1), ptype, wBase); fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2), lX, l2, pX, p2, - /*datatype=*/1, /*mixpairweight=*/wBase); + /*datatype=*/1, /*mixpairweight=*/meWeight); } } }