From e9703f55ea1f0b022653dc005fad1730fd16af1a Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:30:36 +0800 Subject: [PATCH 1/6] Add files via upload --- .../Strangeness/lambdaspincorrderived.cxx | 60 +++++++++++++------ 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index 1a3b71e02f8..da98bf4d0b1 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -352,6 +352,9 @@ struct lambdaspincorrderived { Configurable cfgV5NeighborEta{"cfgV5NeighborEta", 0, "v5: neighbor bins in eta (use symmetric ±N, edge-safe)"}; Configurable cfgV5NeighborPhi{"cfgV5NeighborPhi", 0, "v5: neighbor bins in phi (use symmetric ±N, periodic wrap)"}; Configurable cfgV5MaxMatches{"cfgV5MaxMatches", 50, "v5: max ME replacements per SE pair (after all cuts)"}; + + Configurable cfgV6MinMatches{"cfgV6MinMatches", 5,"Minimum accepted ME pairs per replacement branch; <=0 disables threshold"}; + Configurable cfgMixSeed{"cfgMixSeed", 0xdecafbadULL, "RNG seed for downsampling matches (deterministic)"}; Configurable cfgV6CarryUnmatched{"cfgV6CarryUnmatched", false, "Carry data and MC V6 replacement branches with zero matches to later data frames"}; Configurable cfgV6MaxPendingBranches{"cfgV6MaxPendingBranches", 0, "Maximum retained V6 branches per data or MC buffer; <=0 means unlimited"}; @@ -617,6 +620,11 @@ struct lambdaspincorrderived { histos.add("etaCent", "etaCent", HistType::kTH2D, {{32, -0.8, 0.8}, {8, 0.0, 80.0}}, true); histos.add("hNMEperSE_leg1", "ME replacements per SE pair, leg1", HistType::kTH1D, {{12, -0.5, 11.5}}, true); histos.add("hNMEperSE_leg2", "ME replacements per SE pair, leg2", HistType::kTH1D, {{12, -0.5, 11.5}}, true); + + histos.add("hNMEperSE_leg1_aftercut", "ME replacements per SE pair, leg1", HistType::kTH1D, {{12, -0.5, 11.5}}, true); + histos.add("hNMEperSE_leg2_aftercut", "ME replacements per SE pair, leg2", HistType::kTH1D, {{12, -0.5, 11.5}}, true); + + } if (fillHistConfig.fillWeightQAHistos) { @@ -934,31 +942,26 @@ struct lambdaspincorrderived { } if (v0Configurations.useAdditionalCut) { - // additional cuts - if (candidate.v0Status() == 0 && (std::abs(candidate.tpcNsigmaPos()) > v0Configurations.maxTpcNsigma || std::abs(candidate.tpcNsigmaNeg()) > v0Configurations.maxTpcNsigma)) { - return false; - } - if (candidate.v0Status() == 1 && (std::abs(candidate.tpcNsigmaNeg()) > v0Configurations.maxTpcNsigma || std::abs(candidate.tpcNsigmaPos()) > v0Configurations.maxTpcNsigma)) { + + if (std::abs(candidate.tpcNsigmaPos()) > v0Configurations.maxTpcNsigma || + std::abs(candidate.tpcNsigmaNeg()) > v0Configurations.maxTpcNsigma) { return false; } - if (candidate.tpcPosNClsCrossedRows() < v0Configurations.minTpcNClsCrossedRows) { + if (candidate.tpcPosNClsCrossedRows() < v0Configurations.minTpcNClsCrossedRows || + candidate.tpcNegNClsCrossedRows() < v0Configurations.minTpcNClsCrossedRows) { return false; } - if (candidate.tpcNegNClsCrossedRows() < v0Configurations.minTpcNClsCrossedRows) { + if (std::abs(candidate.ctau()) > v0Configurations.maxCtau) { return false; } - if (candidate.ctau() > v0Configurations.maxCtau) { + if (v0Configurations.useK0sRejection && + std::abs(candidate.mK0Short() - o2::constants::physics::MassK0Short) < + v0Configurations.confK0sMassWindow) { return false; } - - if (v0Configurations.useK0sRejection) { - if (std::abs(candidate.mK0Short() - o2::constants::physics::MassK0Short) < v0Configurations.confK0sMassWindow) { - return false; - } - } } return true; @@ -1914,7 +1917,7 @@ struct lambdaspincorrderived { } } } - PROCESS_SWITCH(lambdaspincorrderived, processDataSys, "Process Sys analysis", true); + PROCESS_SWITCH(lambdaspincorrderived, processDataSys, "Process Sys analysis", false); template void fillReplacementControlMap(int tag1, int tag2, int leg, bool isTarget, LV const& particle, float weight) @@ -3146,7 +3149,9 @@ struct lambdaspincorrderived { ++nAccepted; } - if (nAccepted == 0) { + const int minRequired = cfgV6MinMatches.value > 0 ? cfgV6MinMatches.value : 1; + + if (nAccepted < minRequired) { ++it; continue; } @@ -3282,12 +3287,12 @@ struct lambdaspincorrderived { const auto hasPendingSpace = [&]() { return cfgV6MaxPendingBranches.value <= 0 || static_cast(v6Pending.data.size()) < cfgV6MaxPendingBranches.value; }; - if (doMixLeg1 && nFill1 == 0 && hasPendingSpace()) { + if (doMixLeg1 && nFill1 < (cfgV6MinMatches.value > 0 ? cfgV6MinMatches.value : 1) && hasPendingSpace()) { v6Pending.data.push_back({storeV6Candidate(t1, curColIdx), storeV6Candidate(t2, curColIdx), colBin, 1, 0, static_cast(t1.globalIndex()) ^ splitmix64(static_cast(t2.globalIndex())) ^ splitmix64(static_cast(curColIdx))}); ++pendingAdded; } - if (doMixLeg2 && nFill2 == 0 && hasPendingSpace()) { + if (doMixLeg2 && nFill2 < (cfgV6MinMatches.value > 0 ? cfgV6MinMatches.value : 1) && hasPendingSpace()) { v6Pending.data.push_back({storeV6Candidate(t2, curColIdx), storeV6Candidate(t1, curColIdx), colBin, 2, 0, static_cast(t2.globalIndex()) ^ splitmix64(static_cast(t1.globalIndex())) ^ splitmix64(static_cast(curColIdx))}); ++pendingAdded; @@ -3296,9 +3301,25 @@ struct lambdaspincorrderived { histos.fill(HIST("hNMEperSE_leg2"), nFill2); histos.fill(HIST("hNMEperSE_leg1"), nFill1); + // Reject branches with fewer accepted mixed pairs than required. + if (cfgV6MinMatches.value > 0) { + if (nFill1 < cfgV6MinMatches.value) { + nFill1 = 0; + } + if (nFill2 < cfgV6MinMatches.value) { + nFill2 = 0; + } + } + if (nFill1 <= 0 && nFill2 <= 0) { continue; } + + + histos.fill(HIST("hNMEperSE_leg2_aftercut"), nFill2); + histos.fill(HIST("hNMEperSE_leg1_aftercut"), nFill1); + + // Residual-weight QA needs a leg-specific normalization: // TGT_leg is filled once per same-event target candidate with weight 1. // REP_leg is the average replacement distribution for that same target. @@ -3423,7 +3444,7 @@ struct lambdaspincorrderived { pendingAtStart, pendingMatched, pendingExpired, pendingAdded, v6Pending.data.size()); } } - PROCESS_SWITCH(lambdaspincorrderived, processMEV6, "Process data ME v6 with radius buffer", false); + PROCESS_SWITCH(lambdaspincorrderived, processMEV6, "Process data ME v6 with radius buffer", true); void processMEV6Sys(EventCandidates const& collisions, AllTrackCandidates const& V0s) { @@ -4572,3 +4593,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } + From 6f867884a405d3750c0abbe1f3aa28af059e4b56 Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:31:02 +0800 Subject: [PATCH 2/6] Add files via upload --- .../Strangeness/lambdaspincorrelation.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx b/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx index 615c4be269d..e3e01faaa7e 100644 --- a/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx @@ -372,8 +372,13 @@ struct lambdaspincorrelation { tpcNegNClsCrossedRows.push_back(negtrack1.tpcNClsCrossedRows()); ctau.push_back(ctauLambda); - tpcNsigmaPos.push_back(std::abs(postrack1.tpcNSigmaPr())); - tpcNsigmaNeg.push_back(std::abs(negtrack1.tpcNSigmaPi())); + if (lambdaTag) { + tpcNsigmaPos.push_back(std::abs(postrack1.tpcNSigmaPr())); + tpcNsigmaNeg.push_back(std::abs(negtrack1.tpcNSigmaPi())); + } else if (aLambdaTag) { + tpcNsigmaPos.push_back(std::abs(postrack1.tpcNSigmaPi())); + tpcNsigmaNeg.push_back(std::abs(negtrack1.tpcNSigmaPr())); + } mK0Short.push_back(v0.mK0Short()); @@ -735,3 +740,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } + From 11cbc71281bd56d02290aa29b803d05a13264e97 Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:41:36 +0800 Subject: [PATCH 3/6] Add files via upload --- PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index da98bf4d0b1..30de7880947 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -353,7 +353,7 @@ struct lambdaspincorrderived { Configurable cfgV5NeighborPhi{"cfgV5NeighborPhi", 0, "v5: neighbor bins in phi (use symmetric ±N, periodic wrap)"}; Configurable cfgV5MaxMatches{"cfgV5MaxMatches", 50, "v5: max ME replacements per SE pair (after all cuts)"}; - Configurable cfgV6MinMatches{"cfgV6MinMatches", 5,"Minimum accepted ME pairs per replacement branch; <=0 disables threshold"}; + Configurable cfgV6MinMatches{"cfgV6MinMatches", 5, "Minimum accepted ME pairs per replacement branch; <=0 disables threshold"}; Configurable cfgMixSeed{"cfgMixSeed", 0xdecafbadULL, "RNG seed for downsampling matches (deterministic)"}; Configurable cfgV6CarryUnmatched{"cfgV6CarryUnmatched", false, "Carry data and MC V6 replacement branches with zero matches to later data frames"}; @@ -623,8 +623,6 @@ struct lambdaspincorrderived { histos.add("hNMEperSE_leg1_aftercut", "ME replacements per SE pair, leg1", HistType::kTH1D, {{12, -0.5, 11.5}}, true); histos.add("hNMEperSE_leg2_aftercut", "ME replacements per SE pair, leg2", HistType::kTH1D, {{12, -0.5, 11.5}}, true); - - } if (fillHistConfig.fillWeightQAHistos) { @@ -942,7 +940,7 @@ struct lambdaspincorrderived { } if (v0Configurations.useAdditionalCut) { - + if (std::abs(candidate.tpcNsigmaPos()) > v0Configurations.maxTpcNsigma || std::abs(candidate.tpcNsigmaNeg()) > v0Configurations.maxTpcNsigma) { return false; @@ -3315,11 +3313,9 @@ struct lambdaspincorrderived { continue; } - histos.fill(HIST("hNMEperSE_leg2_aftercut"), nFill2); histos.fill(HIST("hNMEperSE_leg1_aftercut"), nFill1); - // Residual-weight QA needs a leg-specific normalization: // TGT_leg is filled once per same-event target candidate with weight 1. // REP_leg is the average replacement distribution for that same target. From 73aa97510bcd49dd25c83483f3ce573d529f9dba Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:42:01 +0800 Subject: [PATCH 4/6] Add files via upload From 963de1fb50a44f65b3755874fff8e3de259d867a Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:45:59 +0800 Subject: [PATCH 5/6] Add files via upload --- PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index 30de7880947..1361ed3109c 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -4589,4 +4589,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } - From d140a9099a712e2a29bfb83ec7e6854398e123b4 Mon Sep 17 00:00:00 2001 From: suyoupeng <109774812+15071832337@users.noreply.github.com> Date: Mon, 16 Nov 2026 15:46:28 +0800 Subject: [PATCH 6/6] Add files via upload --- PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx b/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx index e3e01faaa7e..820b1c9a937 100644 --- a/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx +++ b/PWGLF/TableProducer/Strangeness/lambdaspincorrelation.cxx @@ -740,4 +740,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } -