From 6662d5c19fc1fe49f118aa8b3d4d27ca819ba508 Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+singhra1994@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:17:41 +0200 Subject: [PATCH 1/9] Refactor TOF PID selection logic for Lambda0 daughters Updated TOF PID cuts for protons and pions, added checks for TOF presence in selection criteria. --- .../TableProducer/correlatorLcScHadrons.cxx | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index ec2d88cfe95..3dd2d590e4a 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -353,7 +353,7 @@ struct HfCorrelatorLcScHadrons { Configurable cfgV0DaughPIDCutsTPCPr{"cfgV0DaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; Configurable cfgV0DaughPIDCutsTPCPi{"cfgV0DaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; Configurable cfgV0DaughPIDCutsTOFPi{"cfgV0DaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; - Configurable cfgV0DaughPIDCutsTOFPr{"cfgV0DaughPIDCutsTOFPr", 2.5, "max. TOFnSigma Pion"}; + Configurable cfgV0DaughPIDCutsTOFPr{"cfgV0DaughPIDCutsTOFPr", -2.5, "min. TOFnSigma Proton (put only negative value)"}; Configurable cfgHypMassWindow{"cfgHypMassWindow", 0.1, "single lambda mass selection"}; Configurable cfgIsCorrCollMatchV0{"cfgIsCorrCollMatchV0", true, "check if daughter and mother collision are same"}; Configurable cfgCalDataDrivenEffPr{"cfgCalDataDrivenEffPr", false, "calculate data driven efficiency of proton using Lambda"}; @@ -368,6 +368,7 @@ struct HfCorrelatorLcScHadrons { Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; Configurable cfgPV{"cfgPV", 10., "maximum z-vertex"}; Configurable calEffV0{"calEffV0", false, "calculate lambda0 efficiency"}; + Configurable checkTOFForPion{"checkTOFForPion", false, "if True, TOF selection on pion V0 wil only be applied if TOF present"}; } cfgV0; // Event Mixing for the Data Mode @@ -602,28 +603,33 @@ struct HfCorrelatorLcScHadrons { if (std::abs(track.eta()) > cfgCharmCand.etaTrackMax) { return false; } + // --------------------------------------------------------- // 1. Proton PID Selection // --------------------------------------------------------- if (std::abs(pid) == kProton) { + bool hasTOFProton = (pid > 0) ? v0.positiveHasTOF() : v0.negativeHasTOF(); bool passTOF = false; if (track.pt() > cfgV0.cfgV0DaughPrPtMax || track.pt() < cfgV0.cfgV0DaughPrPtMin) { return false; } - if (track.hasTOF()) { + + if (hasTOFProton && (track.pt() > cfgCharmCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // pid > 0: Proton from Lambda (LaPr) // pid < 0: Antiproton from Anti-Lambda (ALaPr) double strangeTOF = (pid > 0) ? v0.tofNSigmaLaPr() : v0.tofNSigmaALaPr(); - passTOF = std::abs(strangeTOF) > cfgV0.cfgV0DaughPIDCutsTOFPr; + passTOF = strangeTOF > cfgV0.cfgV0DaughPIDCutsTOFPr; + } else { // if strange TOF is unavailable - passTOF = std::abs(track.tofNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTOFPr; + passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; } + } - if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) || passTOF) { + if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { return false; } } @@ -631,14 +637,15 @@ struct HfCorrelatorLcScHadrons { // --------------------------------------------------------- // 2. Pion PID Selection // --------------------------------------------------------- - if (std::abs(pid) == kPiPlus) { + if (std::abs(pid) == kPiPlus && cfgV0.checkTOFForPion) { + bool hasTOFPion = (pid < 0) ? v0.negativeHasTOF() : v0.positiveHasTOF(); bool passTOF = false; if (track.pt() > cfgV0.cfgV0DaughPiPtMax || track.pt() < cfgV0.cfgV0DaughPiPtMin) { return false; } - if (track.hasTOF()) { + if (hasTOFPion && (track.pt() > cfgCharmCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay. // We evaluate both applicable hypotheses based on charge sign and pick the best match. @@ -649,13 +656,13 @@ struct HfCorrelatorLcScHadrons { // Fallback to standard track TOF passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; } + } - if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) || passTOF) { + if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { return false; } } - return true; } @@ -826,6 +833,7 @@ struct HfCorrelatorLcScHadrons { // Correlate Lc with all Lambda V0 in the same event for (const auto& v0 : v0s) { + const int v0Lambda = 1; const int v0AntiLambda = -1; @@ -836,6 +844,7 @@ struct HfCorrelatorLcScHadrons { auto posTrackV0 = v0.template posTrack_as(); auto negTrackV0 = v0.template negTrack_as(); + if ((candidate.prong0Id() == posTrackV0.globalIndex()) || (candidate.prong1Id() == posTrackV0.globalIndex()) || (candidate.prong2Id() == posTrackV0.globalIndex()) || (candidate.prong0Id() == negTrackV0.globalIndex()) || (candidate.prong1Id() == negTrackV0.globalIndex()) || (candidate.prong2Id() == negTrackV0.globalIndex())) { if (!cfgCharmCand.storeAutoCorrelationFlag) { continue; @@ -843,12 +852,13 @@ struct HfCorrelatorLcScHadrons { correlationStatus = true; } + if (cfgV0.cfgIsCorrCollMatchV0 && ((v0.collisionId() != posTrackV0.collisionId()) || (v0.collisionId() != negTrackV0.collisionId()))) { continue; } // Process Lambda (proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { + if ((std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow ) && v0.alpha() > 0) { if (isSelectedV0Daughter(posTrackV0, v0, kProton) && isSelectedV0Daughter(negTrackV0, v0, kPiMinus)) { if (selLcPKPi) { @@ -869,7 +879,7 @@ struct HfCorrelatorLcScHadrons { } // Process anti-Lambda (anti-proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if ((std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) && v0.alpha() < 0) { if (isSelectedV0Daughter(negTrackV0, v0, kProtonBar) && isSelectedV0Daughter(posTrackV0, v0, kPiPlus)) { if (selLcPKPi) { @@ -956,7 +966,7 @@ struct HfCorrelatorLcScHadrons { } // Process Lambda (proton + pion) - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { entryHadron(v0.mLambda(), trackV0Pos.eta(), trackV0Pos.pt() * trackV0Pos.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Pos.tpcNSigmaPr(), trackV0Pos.tpcNSigmaKa(), trackV0Pos.tpcNSigmaPi(), trackV0Pos.tofNSigmaPr(), trackV0Pos.tofNSigmaKa(), trackV0Pos.tofNSigmaPi()); @@ -980,7 +990,7 @@ struct HfCorrelatorLcScHadrons { } } - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { entryHadron(v0.mAntiLambda(), trackV0Neg.eta(), trackV0Neg.pt() * trackV0Neg.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Neg.tpcNSigmaPr(), trackV0Neg.tpcNSigmaKa(), trackV0Neg.tpcNSigmaPi(), trackV0Neg.tofNSigmaPr(), trackV0Neg.tofNSigmaKa(), trackV0Neg.tofNSigmaPi()); @@ -1013,7 +1023,7 @@ struct HfCorrelatorLcScHadrons { auto const& partV0Pos = trackV0Pos.mcParticle(); auto const& partV0Neg = trackV0Neg.mcParticle(); - if (passV0Sel && v0Mc.pdgCode() == kLambda0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); @@ -1028,7 +1038,7 @@ struct HfCorrelatorLcScHadrons { } } } - if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); From 43373825e192bddc3ecdaa9b4243b59351a08e21 Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+singhra1994@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:18:34 +0200 Subject: [PATCH 2/9] Refactor V0 daughter selection criteria --- .../TableProducer/correlatorXicHadrons.cxx | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index 4cb726052ea..dda2481e373 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -647,33 +647,38 @@ struct HfCorrelatorXicHadrons { } template - bool isSelectedV0Daughter(Tracktype const& track, V0Type v0, int pid) + bool isSelectedV0Daughter(Tracktype const& track, V0Type const& v0, int pid) { - if (std::abs(track.eta()) > cfgXicCand.etaTrackMax) { + if (std::abs(track.eta()) > cfgCharmCand.etaTrackMax) { return false; } + // --------------------------------------------------------- // 1. Proton PID Selection // --------------------------------------------------------- if (std::abs(pid) == kProton) { + bool hasTOFProton = (pid > 0) ? v0.positiveHasTOF() : v0.negativeHasTOF(); bool passTOF = false; - if (track.pt() > cfgV0.cfgDaughPrPtMax || track.pt() < cfgV0.cfgDaughPrPtMin) { + if (track.pt() > cfgV0.cfgV0DaughPrPtMax || track.pt() < cfgV0.cfgV0DaughPrPtMin) { return false; } - if (track.hasTOF()) { + + if (hasTOFProton && (track.pt() > cfgCharmCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // pid > 0: Proton from Lambda (LaPr) // pid < 0: Antiproton from Anti-Lambda (ALaPr) double strangeTOF = (pid > 0) ? v0.tofNSigmaLaPr() : v0.tofNSigmaALaPr(); - passTOF = std::abs(strangeTOF) > cfgV0.cfgDaughPIDCutsTOFPr; + passTOF = strangeTOF > cfgV0.cfgV0DaughPIDCutsTOFPr; + } else { // if strange TOF is unavailable - passTOF = std::abs(track.tofNSigmaPr()) > cfgV0.cfgDaughPIDCutsTOFPr; + passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; } + } - if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgDaughPIDCutsTPCPr) || passTOF) { + if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { return false; } } @@ -681,31 +686,32 @@ struct HfCorrelatorXicHadrons { // --------------------------------------------------------- // 2. Pion PID Selection // --------------------------------------------------------- - if (std::abs(pid) == kPiPlus) { + if (std::abs(pid) == kPiPlus && cfgV0.checkTOFForPion) { + bool hasTOFPion = (pid < 0) ? v0.negativeHasTOF() : v0.positiveHasTOF(); bool passTOF = false; - if (track.pt() > cfgV0.cfgDaughPiPtMax || track.pt() < cfgV0.cfgDaughPiPtMin) { + if (track.pt() > cfgV0.cfgV0DaughPiPtMax || track.pt() < cfgV0.cfgV0DaughPiPtMin) { return false; } - if (track.hasTOF()) { + if (hasTOFPion && (track.pt() > cfgCharmCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay. // We evaluate both applicable hypotheses based on charge sign and pick the best match. double tofLa = (pid > 0) ? v0.tofNSigmaALaPi() : v0.tofNSigmaLaPi(); - passTOF = tofLa > cfgV0.cfgDaughPIDCutsTOFPi; + passTOF = std::abs(tofLa) > cfgV0.cfgV0DaughPIDCutsTOFPi; } else { // Fallback to standard track TOF - passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgDaughPIDCutsTOFPi; + passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; } + } - if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgDaughPIDCutsTPCPi) || passTOF) { + if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { return false; } } - return true; } @@ -730,7 +736,7 @@ struct HfCorrelatorXicHadrons { } // Process Lambda (proton + pion) - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { entryHadron(v0.mLambda(), trackV0Pos.eta(), trackV0Pos.pt() * trackV0Pos.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Pos.tpcNSigmaPr(), trackV0Pos.tpcNSigmaKa(), trackV0Pos.tpcNSigmaPi(), trackV0Pos.tofNSigmaPr(), trackV0Pos.tofNSigmaKa(), trackV0Pos.tofNSigmaPi()); @@ -754,7 +760,7 @@ struct HfCorrelatorXicHadrons { } } - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { entryHadron(v0.mAntiLambda(), trackV0Neg.eta(), trackV0Neg.pt() * trackV0Neg.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Neg.tpcNSigmaPr(), trackV0Neg.tpcNSigmaKa(), trackV0Neg.tpcNSigmaPi(), trackV0Neg.tofNSigmaPr(), trackV0Neg.tofNSigmaKa(), trackV0Neg.tofNSigmaPi()); @@ -787,7 +793,7 @@ struct HfCorrelatorXicHadrons { auto const& partV0Pos = trackV0Pos.mcParticle(); auto const& partV0Neg = trackV0Neg.mcParticle(); - if (passV0Sel && v0Mc.pdgCode() == kLambda0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); @@ -802,7 +808,7 @@ struct HfCorrelatorXicHadrons { } } } - if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); @@ -1032,7 +1038,7 @@ struct HfCorrelatorXicHadrons { } // Process Lambda (proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { if (selXicCand) { @@ -1050,7 +1056,7 @@ struct HfCorrelatorXicHadrons { } // Process anti-Lambda (anti-proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { if (selXicCand) { @@ -1484,14 +1490,14 @@ struct HfCorrelatorXicHadrons { auto const& trackV0Pos = assocParticle.template posTrack_as(); auto const& trackV0Neg = assocParticle.template negTrack_as(); - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, assocParticle, kProton) && isSelectedV0Daughter(trackV0Neg, assocParticle, kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } } - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, assocParticle, -kProton) && isSelectedV0Daughter(trackV0Pos, assocParticle, -kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } From 019512e790472d8b1cb1e64e412555823aee081c Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+singhra1994@users.noreply.github.com> Date: Tue, 4 Aug 2026 00:06:23 +0200 Subject: [PATCH 3/9] Add V0 daughter configurations and update selection logic --- .../TableProducer/correlatorXicHadrons.cxx | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index dda2481e373..342cfe54ccd 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -20,6 +20,7 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" #include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" @@ -377,14 +378,14 @@ struct HfCorrelatorXicHadrons { } cfgXicCand; struct : ConfigurableGroup { - Configurable cfgDaughPrPtMax{"cfgDaughPrPtMax", 5., "max. pT Daughter Proton"}; - Configurable cfgDaughPrPtMin{"cfgDaughPrPtMin", 0.3, "min. pT Daughter Proton"}; - Configurable cfgDaughPiPtMax{"cfgDaughPiPtMax", 10., "max. pT Daughter Pion"}; - Configurable cfgDaughPiPtMin{"cfgDaughPiPtMin", 0.3, "min. pT Daughter Pion"}; - Configurable cfgDaughPIDCutsTPCPr{"cfgDaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; - Configurable cfgDaughPIDCutsTPCPi{"cfgDaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; - Configurable cfgDaughPIDCutsTOFPi{"cfgDaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; - Configurable cfgDaughPIDCutsTOFPr{"cfgDaughPIDCutsTOFPr", 2.5, "max. TOFnSigma Pion"}; + Configurable cfgV0DaughPrPtMax{"cfgV0DaughPrPtMax", 5., "max. pT Daughter Proton"}; + Configurable cfgV0DaughPrPtMin{"cfgV0DaughPrPtMin", 0.3, "min. pT Daughter Proton"}; + Configurable cfgV0DaughPiPtMax{"cfgV0DaughPiPtMax", 10., "max. pT Daughter Pion"}; + Configurable cfgV0DaughPiPtMin{"cfgV0DaughPiPtMin", 0.3, "min. pT Daughter Pion"}; + Configurable cfgV0DaughPIDCutsTPCPr{"cfgV0DaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; + Configurable cfgV0DaughPIDCutsTPCPi{"cfgV0DaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; + Configurable cfgV0DaughPIDCutsTOFPi{"cfgV0DaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; + Configurable cfgV0DaughPIDCutsTOFPr{"cfgV0DaughPIDCutsTOFPr", -2.5, "min. TOFnSigma Proton (put only negative value)"}; Configurable cfgHypMassWindow{"cfgHypMassWindow", 0.1, "single lambda mass selection"}; Configurable cfgIsCorrCollMatchV0{"cfgIsCorrCollMatchV0", true, "check if daughter and mother collision are same"}; Configurable cfgCalDataDrivenEffPr{"cfgCalDataDrivenEffPr", false, "calculate data driven efficiency of proton using Lambda"}; @@ -399,6 +400,7 @@ struct HfCorrelatorXicHadrons { Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; Configurable cfgPV{"cfgPV", 10., "maximum z-vertex"}; Configurable calEffV0{"calEffV0", false, "calculate lambda0 efficiency"}; + Configurable checkTOFForPion{"checkTOFForPion", false, "if True, TOF selection on pion V0 wil only be applied if TOF present"}; } cfgV0; SliceCache cache; @@ -649,7 +651,7 @@ struct HfCorrelatorXicHadrons { template bool isSelectedV0Daughter(Tracktype const& track, V0Type const& v0, int pid) { - if (std::abs(track.eta()) > cfgCharmCand.etaTrackMax) { + if (std::abs(track.eta()) > cfgXicCand.etaTrackMax) { return false; } @@ -664,7 +666,7 @@ struct HfCorrelatorXicHadrons { return false; } - if (hasTOFProton && (track.pt() > cfgCharmCand.tofPIDThreshold)) { + if (hasTOFProton && (track.pt() > cfgXicCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // pid > 0: Proton from Lambda (LaPr) // pid < 0: Antiproton from Anti-Lambda (ALaPr) @@ -694,7 +696,7 @@ struct HfCorrelatorXicHadrons { return false; } - if (hasTOFPion && (track.pt() > cfgCharmCand.tofPIDThreshold)) { + if (hasTOFPion && (track.pt() > cfgXicCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay. // We evaluate both applicable hypotheses based on charge sign and pick the best match. @@ -855,12 +857,12 @@ struct HfCorrelatorXicHadrons { if (std::abs(currentDaughter.pdgCode()) == kProton) { - if (currentDaughter.pt() > cfgV0.cfgDaughPrPtMax || currentDaughter.pt() < cfgV0.cfgDaughPrPtMin) { + if (currentDaughter.pt() > cfgV0.cfgV0DaughPrPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPrPtMin) { continue; } } else if (std::abs(currentDaughter.pdgCode()) == kPiPlus) { - if (currentDaughter.pt() > cfgV0.cfgDaughPiPtMax || currentDaughter.pt() < cfgV0.cfgDaughPiPtMin) { + if (currentDaughter.pt() > cfgV0.cfgV0DaughPiPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPiPtMin) { continue; } @@ -1490,14 +1492,14 @@ struct HfCorrelatorXicHadrons { auto const& trackV0Pos = assocParticle.template posTrack_as(); auto const& trackV0Neg = assocParticle.template negTrack_as(); - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, assocParticle, kProton) && isSelectedV0Daughter(trackV0Neg, assocParticle, kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } } - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, assocParticle, -kProton) && isSelectedV0Daughter(trackV0Pos, assocParticle, -kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } @@ -1688,7 +1690,7 @@ struct HfCorrelatorXicHadrons { /// Data processing: XicPlus with V0 Lambda void processDataXicPlusV0(SelCollisions::iterator const& collision, TracksData const& tracks, - aod::V0Datas const& v0s, + soa::Join const& v0s, CandsXicPlusDataFiltered const& candidates, aod::BCsWithTimestamps const&) { @@ -1699,7 +1701,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: XicPlus with V0 Lambda void processMcRecXicPlusV0(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, CandsXicPlusMcRecFiltered const& candidates, aod::McParticles const& mcParticles) { @@ -1710,7 +1712,7 @@ struct HfCorrelatorXicHadrons { /// Data processing: Xic0 with V0 Lambda void processDataXic0V0(SelCollisions::iterator const& collision, TracksData const& tracks, - aod::V0Datas const& v0s, + soa::Join const& v0s, CandsXic0DataFiltered const& candidates, aod::BCsWithTimestamps const&) { @@ -1721,7 +1723,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: Xic0 with V0 Lambda void processMcRecXic0V0(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, CandsXic0McRecFiltered const& candidates, aod::McParticles const& mcParticles) { @@ -1732,7 +1734,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: Xic0 with V0 Lambda void processV0McRec(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, aod::McParticles const& mcParticles) { fillEffV0(collision, v0s, tracks, mcParticles); @@ -1789,7 +1791,7 @@ struct HfCorrelatorXicHadrons { /// NOTE: V0 mixed events are more complex - need proper binning and collision matching void processDataMixedEventXicPlusV0(SelCollisions const& collisions, CandsXicPlusDataFiltered const& candidates, - aod::V0Datas const& v0s, + soa::Join const& v0s, TracksData const& tracks) { doMixEvent(collisions, v0s, candidates, tracks); @@ -1799,7 +1801,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco Mixed Event: XicPlus with V0 Lambda void processMcRecMixedEventXicPlusV0(SelCollisions const& collisions, CandsXicPlusMcRecFiltered const& candidates, - soa::Join const& v0s, + soa::Join const& v0s, TracksWithMc const& tracks, aod::McParticles const& mcParticles) { @@ -1810,7 +1812,7 @@ struct HfCorrelatorXicHadrons { /// Data Mixed Event: Xic0 with V0 Lambda void processDataMixedEventXic0V0(SelCollisions const& collisions, CandsXic0DataFiltered const& candidates, - aod::V0Datas const& v0s, + soa::Join const& v0s, TracksData const& tracks) { doMixEvent(collisions, v0s, candidates, tracks); @@ -1820,7 +1822,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco Mixed Event: Xic0 with V0 Lambda void processMcRecMixedEventXic0V0(SelCollisions const& collisions, CandsXic0McRecFiltered const& candidates, - soa::Join const& v0s, + soa::Join const& v0s, TracksWithMc const& tracks, aod::McParticles const& mcParticles) { From 8d7344bcf2bad9163e0676ff52b54e16951d0cc3 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 3 Aug 2026 22:08:38 +0000 Subject: [PATCH 4/9] Please consider the following formatting changes --- PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx | 15 +++++---------- PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx | 2 -- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 3dd2d590e4a..98865d64e10 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -626,7 +626,6 @@ struct HfCorrelatorLcScHadrons { // if strange TOF is unavailable passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; } - } if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { @@ -656,7 +655,6 @@ struct HfCorrelatorLcScHadrons { // Fallback to standard track TOF passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; } - } if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { @@ -833,7 +831,6 @@ struct HfCorrelatorLcScHadrons { // Correlate Lc with all Lambda V0 in the same event for (const auto& v0 : v0s) { - const int v0Lambda = 1; const int v0AntiLambda = -1; @@ -844,7 +841,6 @@ struct HfCorrelatorLcScHadrons { auto posTrackV0 = v0.template posTrack_as(); auto negTrackV0 = v0.template negTrack_as(); - if ((candidate.prong0Id() == posTrackV0.globalIndex()) || (candidate.prong1Id() == posTrackV0.globalIndex()) || (candidate.prong2Id() == posTrackV0.globalIndex()) || (candidate.prong0Id() == negTrackV0.globalIndex()) || (candidate.prong1Id() == negTrackV0.globalIndex()) || (candidate.prong2Id() == negTrackV0.globalIndex())) { if (!cfgCharmCand.storeAutoCorrelationFlag) { continue; @@ -852,13 +848,12 @@ struct HfCorrelatorLcScHadrons { correlationStatus = true; } - if (cfgV0.cfgIsCorrCollMatchV0 && ((v0.collisionId() != posTrackV0.collisionId()) || (v0.collisionId() != negTrackV0.collisionId()))) { continue; } // Process Lambda (proton-pion) - if ((std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow ) && v0.alpha() > 0) { + if ((std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) && v0.alpha() > 0) { if (isSelectedV0Daughter(posTrackV0, v0, kProton) && isSelectedV0Daughter(negTrackV0, v0, kPiMinus)) { if (selLcPKPi) { @@ -879,7 +874,7 @@ struct HfCorrelatorLcScHadrons { } // Process anti-Lambda (anti-proton-pion) - if ((std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) && v0.alpha() < 0) { + if ((std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) && v0.alpha() < 0) { if (isSelectedV0Daughter(negTrackV0, v0, kProtonBar) && isSelectedV0Daughter(posTrackV0, v0, kPiPlus)) { if (selLcPKPi) { @@ -966,7 +961,7 @@ struct HfCorrelatorLcScHadrons { } // Process Lambda (proton + pion) - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { entryHadron(v0.mLambda(), trackV0Pos.eta(), trackV0Pos.pt() * trackV0Pos.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Pos.tpcNSigmaPr(), trackV0Pos.tpcNSigmaKa(), trackV0Pos.tpcNSigmaPi(), trackV0Pos.tofNSigmaPr(), trackV0Pos.tofNSigmaKa(), trackV0Pos.tofNSigmaPi()); @@ -1023,7 +1018,7 @@ struct HfCorrelatorLcScHadrons { auto const& partV0Pos = trackV0Pos.mcParticle(); auto const& partV0Neg = trackV0Neg.mcParticle(); - if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); @@ -1038,7 +1033,7 @@ struct HfCorrelatorLcScHadrons { } } } - if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index 342cfe54ccd..c762895c401 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -677,7 +677,6 @@ struct HfCorrelatorXicHadrons { // if strange TOF is unavailable passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; } - } if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { @@ -707,7 +706,6 @@ struct HfCorrelatorXicHadrons { // Fallback to standard track TOF passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; } - } if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { From b8d44576edff21cbaa83da7b6c2ac0915a7863ef Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+singhra1994@users.noreply.github.com> Date: Tue, 4 Aug 2026 03:59:47 +0200 Subject: [PATCH 5/9] Refactor V0 daughter PID configuration and selection --- .../TableProducer/correlatorXicHadrons.cxx | 100 ++++++++++-------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index c762895c401..9f09be91d2a 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -20,7 +20,6 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" #include "PWGHF/Utils/utilsAnalysis.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" @@ -378,14 +377,14 @@ struct HfCorrelatorXicHadrons { } cfgXicCand; struct : ConfigurableGroup { - Configurable cfgV0DaughPrPtMax{"cfgV0DaughPrPtMax", 5., "max. pT Daughter Proton"}; - Configurable cfgV0DaughPrPtMin{"cfgV0DaughPrPtMin", 0.3, "min. pT Daughter Proton"}; - Configurable cfgV0DaughPiPtMax{"cfgV0DaughPiPtMax", 10., "max. pT Daughter Pion"}; - Configurable cfgV0DaughPiPtMin{"cfgV0DaughPiPtMin", 0.3, "min. pT Daughter Pion"}; - Configurable cfgV0DaughPIDCutsTPCPr{"cfgV0DaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; - Configurable cfgV0DaughPIDCutsTPCPi{"cfgV0DaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; - Configurable cfgV0DaughPIDCutsTOFPi{"cfgV0DaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; - Configurable cfgV0DaughPIDCutsTOFPr{"cfgV0DaughPIDCutsTOFPr", -2.5, "min. TOFnSigma Proton (put only negative value)"}; + Configurable cfgDaughPrPtMax{"cfgDaughPrPtMax", 5., "max. pT Daughter Proton"}; + Configurable cfgDaughPrPtMin{"cfgDaughPrPtMin", 0.3, "min. pT Daughter Proton"}; + Configurable cfgDaughPiPtMax{"cfgDaughPiPtMax", 10., "max. pT Daughter Pion"}; + Configurable cfgDaughPiPtMin{"cfgDaughPiPtMin", 0.3, "min. pT Daughter Pion"}; + Configurable cfgDaughPIDCutsTPCPr{"cfgDaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; + Configurable cfgDaughPIDCutsTPCPi{"cfgDaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; + Configurable cfgDaughPIDCutsTOFPi{"cfgDaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; + Configurable cfgDaughPIDCutsTOFPr{"cfgDaughPIDCutsTOFPr", 2.5, "max. TOFnSigma Pion"}; Configurable cfgHypMassWindow{"cfgHypMassWindow", 0.1, "single lambda mass selection"}; Configurable cfgIsCorrCollMatchV0{"cfgIsCorrCollMatchV0", true, "check if daughter and mother collision are same"}; Configurable cfgCalDataDrivenEffPr{"cfgCalDataDrivenEffPr", false, "calculate data driven efficiency of proton using Lambda"}; @@ -400,7 +399,6 @@ struct HfCorrelatorXicHadrons { Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; Configurable cfgPV{"cfgPV", 10., "maximum z-vertex"}; Configurable calEffV0{"calEffV0", false, "calculate lambda0 efficiency"}; - Configurable checkTOFForPion{"checkTOFForPion", false, "if True, TOF selection on pion V0 wil only be applied if TOF present"}; } cfgV0; SliceCache cache; @@ -649,37 +647,33 @@ struct HfCorrelatorXicHadrons { } template - bool isSelectedV0Daughter(Tracktype const& track, V0Type const& v0, int pid) + bool isSelectedV0Daughter(Tracktype const& track, V0Type v0, int pid) { if (std::abs(track.eta()) > cfgXicCand.etaTrackMax) { return false; } - // --------------------------------------------------------- // 1. Proton PID Selection // --------------------------------------------------------- if (std::abs(pid) == kProton) { - bool hasTOFProton = (pid > 0) ? v0.positiveHasTOF() : v0.negativeHasTOF(); bool passTOF = false; - if (track.pt() > cfgV0.cfgV0DaughPrPtMax || track.pt() < cfgV0.cfgV0DaughPrPtMin) { + if (track.pt() > cfgV0.cfgDaughPrPtMax || track.pt() < cfgV0.cfgDaughPrPtMin) { return false; } - - if (hasTOFProton && (track.pt() > cfgXicCand.tofPIDThreshold)) { + if (track.hasTOF()) { if constexpr (std::experimental::is_detected::value) { // pid > 0: Proton from Lambda (LaPr) // pid < 0: Antiproton from Anti-Lambda (ALaPr) double strangeTOF = (pid > 0) ? v0.tofNSigmaLaPr() : v0.tofNSigmaALaPr(); - passTOF = strangeTOF > cfgV0.cfgV0DaughPIDCutsTOFPr; - + passTOF = std::abs(strangeTOF) > cfgV0.cfgDaughPIDCutsTOFPr; } else { // if strange TOF is unavailable - passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; + passTOF = std::abs(track.tofNSigmaPr()) > cfgV0.cfgDaughPIDCutsTOFPr; } } - if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { + if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgDaughPIDCutsTPCPr) || passTOF) { return false; } } @@ -687,31 +681,31 @@ struct HfCorrelatorXicHadrons { // --------------------------------------------------------- // 2. Pion PID Selection // --------------------------------------------------------- - if (std::abs(pid) == kPiPlus && cfgV0.checkTOFForPion) { - bool hasTOFPion = (pid < 0) ? v0.negativeHasTOF() : v0.positiveHasTOF(); + if (std::abs(pid) == kPiPlus) { bool passTOF = false; - if (track.pt() > cfgV0.cfgV0DaughPiPtMax || track.pt() < cfgV0.cfgV0DaughPiPtMin) { + if (track.pt() > cfgV0.cfgDaughPiPtMax || track.pt() < cfgV0.cfgDaughPiPtMin) { return false; } - if (hasTOFPion && (track.pt() > cfgXicCand.tofPIDThreshold)) { + if (track.hasTOF()) { if constexpr (std::experimental::is_detected::value) { // A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay. // We evaluate both applicable hypotheses based on charge sign and pick the best match. double tofLa = (pid > 0) ? v0.tofNSigmaALaPi() : v0.tofNSigmaLaPi(); - passTOF = std::abs(tofLa) > cfgV0.cfgV0DaughPIDCutsTOFPi; + passTOF = tofLa > cfgV0.cfgDaughPIDCutsTOFPi; } else { // Fallback to standard track TOF - passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; + passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgDaughPIDCutsTOFPi; } } - if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { + if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgDaughPIDCutsTPCPi) || passTOF) { return false; } } + return true; } @@ -736,7 +730,7 @@ struct HfCorrelatorXicHadrons { } // Process Lambda (proton + pion) - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { entryHadron(v0.mLambda(), trackV0Pos.eta(), trackV0Pos.pt() * trackV0Pos.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Pos.tpcNSigmaPr(), trackV0Pos.tpcNSigmaKa(), trackV0Pos.tpcNSigmaPi(), trackV0Pos.tofNSigmaPr(), trackV0Pos.tofNSigmaKa(), trackV0Pos.tofNSigmaPi()); @@ -760,7 +754,7 @@ struct HfCorrelatorXicHadrons { } } - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { entryHadron(v0.mAntiLambda(), trackV0Neg.eta(), trackV0Neg.pt() * trackV0Neg.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Neg.tpcNSigmaPr(), trackV0Neg.tpcNSigmaKa(), trackV0Neg.tpcNSigmaPi(), trackV0Neg.tofNSigmaPr(), trackV0Neg.tofNSigmaKa(), trackV0Neg.tofNSigmaPi()); @@ -793,7 +787,7 @@ struct HfCorrelatorXicHadrons { auto const& partV0Pos = trackV0Pos.mcParticle(); auto const& partV0Neg = trackV0Neg.mcParticle(); - if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); @@ -808,7 +802,7 @@ struct HfCorrelatorXicHadrons { } } } - if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); @@ -855,12 +849,12 @@ struct HfCorrelatorXicHadrons { if (std::abs(currentDaughter.pdgCode()) == kProton) { - if (currentDaughter.pt() > cfgV0.cfgV0DaughPrPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPrPtMin) { + if (currentDaughter.pt() > cfgV0.cfgDaughPrPtMax || currentDaughter.pt() < cfgV0.cfgDaughPrPtMin) { continue; } } else if (std::abs(currentDaughter.pdgCode()) == kPiPlus) { - if (currentDaughter.pt() > cfgV0.cfgV0DaughPiPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPiPtMin) { + if (currentDaughter.pt() > cfgV0.cfgDaughPiPtMax || currentDaughter.pt() < cfgV0.cfgDaughPiPtMin) { continue; } @@ -1038,7 +1032,7 @@ struct HfCorrelatorXicHadrons { } // Process Lambda (proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { + if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { if (selXicCand) { @@ -1056,7 +1050,7 @@ struct HfCorrelatorXicHadrons { } // Process anti-Lambda (anti-proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { + if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { if (selXicCand) { @@ -1490,14 +1484,14 @@ struct HfCorrelatorXicHadrons { auto const& trackV0Pos = assocParticle.template posTrack_as(); auto const& trackV0Neg = assocParticle.template negTrack_as(); - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() > 0) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow) { if (isSelectedV0Daughter(trackV0Pos, assocParticle, kProton) && isSelectedV0Daughter(trackV0Neg, assocParticle, kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } } - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() < 0) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow) { if (isSelectedV0Daughter(trackV0Neg, assocParticle, -kProton) && isSelectedV0Daughter(trackV0Pos, assocParticle, -kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } @@ -1577,6 +1571,20 @@ struct HfCorrelatorXicHadrons { listDaughters.clear(); const std::size_t nDaughtersExpected = IsXicPlus ? XicDecayDaughtersCount::XicPlusDaughtersCount : XicDecayDaughtersCount::Xic0DaughtersCount; + if (IsXicPlus) { + // Final state: p, pi-, pi-, pi+, pi+ + std::array const arrDaughXicPlusPDG = {kProton, kPiMinus, kPiMinus, kPiPlus, kPiPlus}; + + // Pass -1 to automatically traverse the entire cascade down to the final state + RecoDecay::getDaughters(particle, &listDaughters, arrDaughXicPlusPDG); + } else { + // Final state: p, pi-, pi-, pi+ + std::array const arrDaughXic0PDG = {kProton, kPiMinus, kPiMinus, kPiPlus}; + + // Pass -1 to automatically traverse the entire cascade down to the final state + RecoDecay::getDaughters(particle, &listDaughters, arrDaughXic0PDG); + } + int counterDaughters = 0; std::vector prongsId(nDaughtersExpected); if (listDaughters.size() == nDaughtersExpected) { @@ -1688,7 +1696,7 @@ struct HfCorrelatorXicHadrons { /// Data processing: XicPlus with V0 Lambda void processDataXicPlusV0(SelCollisions::iterator const& collision, TracksData const& tracks, - soa::Join const& v0s, + aod::V0Datas const& v0s, CandsXicPlusDataFiltered const& candidates, aod::BCsWithTimestamps const&) { @@ -1699,7 +1707,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: XicPlus with V0 Lambda void processMcRecXicPlusV0(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, CandsXicPlusMcRecFiltered const& candidates, aod::McParticles const& mcParticles) { @@ -1710,7 +1718,7 @@ struct HfCorrelatorXicHadrons { /// Data processing: Xic0 with V0 Lambda void processDataXic0V0(SelCollisions::iterator const& collision, TracksData const& tracks, - soa::Join const& v0s, + aod::V0Datas const& v0s, CandsXic0DataFiltered const& candidates, aod::BCsWithTimestamps const&) { @@ -1721,7 +1729,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: Xic0 with V0 Lambda void processMcRecXic0V0(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, CandsXic0McRecFiltered const& candidates, aod::McParticles const& mcParticles) { @@ -1732,7 +1740,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: Xic0 with V0 Lambda void processV0McRec(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, aod::McParticles const& mcParticles) { fillEffV0(collision, v0s, tracks, mcParticles); @@ -1789,7 +1797,7 @@ struct HfCorrelatorXicHadrons { /// NOTE: V0 mixed events are more complex - need proper binning and collision matching void processDataMixedEventXicPlusV0(SelCollisions const& collisions, CandsXicPlusDataFiltered const& candidates, - soa::Join const& v0s, + aod::V0Datas const& v0s, TracksData const& tracks) { doMixEvent(collisions, v0s, candidates, tracks); @@ -1799,7 +1807,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco Mixed Event: XicPlus with V0 Lambda void processMcRecMixedEventXicPlusV0(SelCollisions const& collisions, CandsXicPlusMcRecFiltered const& candidates, - soa::Join const& v0s, + soa::Join const& v0s, TracksWithMc const& tracks, aod::McParticles const& mcParticles) { @@ -1810,7 +1818,7 @@ struct HfCorrelatorXicHadrons { /// Data Mixed Event: Xic0 with V0 Lambda void processDataMixedEventXic0V0(SelCollisions const& collisions, CandsXic0DataFiltered const& candidates, - soa::Join const& v0s, + aod::V0Datas const& v0s, TracksData const& tracks) { doMixEvent(collisions, v0s, candidates, tracks); @@ -1820,7 +1828,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco Mixed Event: Xic0 with V0 Lambda void processMcRecMixedEventXic0V0(SelCollisions const& collisions, CandsXic0McRecFiltered const& candidates, - soa::Join const& v0s, + soa::Join const& v0s, TracksWithMc const& tracks, aod::McParticles const& mcParticles) { From ab0522e57bc44e206dc7fbc7f880c3126428d072 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 4 Aug 2026 02:00:39 +0000 Subject: [PATCH 6/9] Please consider the following formatting changes --- PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index 9f09be91d2a..464a44d50eb 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -1574,13 +1574,13 @@ struct HfCorrelatorXicHadrons { if (IsXicPlus) { // Final state: p, pi-, pi-, pi+, pi+ std::array const arrDaughXicPlusPDG = {kProton, kPiMinus, kPiMinus, kPiPlus, kPiPlus}; - + // Pass -1 to automatically traverse the entire cascade down to the final state RecoDecay::getDaughters(particle, &listDaughters, arrDaughXicPlusPDG); } else { // Final state: p, pi-, pi-, pi+ std::array const arrDaughXic0PDG = {kProton, kPiMinus, kPiMinus, kPiPlus}; - + // Pass -1 to automatically traverse the entire cascade down to the final state RecoDecay::getDaughters(particle, &listDaughters, arrDaughXic0PDG); } From 047b5dfbdb4d2097e5459162fe19eaa084f902e2 Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+singhra1994@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:26:10 +0200 Subject: [PATCH 7/9] Refactor charge variable declarations to use auto --- PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 98865d64e10..0ffe4481249 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -1630,7 +1630,7 @@ struct HfCorrelatorLcScHadrons { registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -PIHalf)); registry.fill(HIST("hYMcGen"), yCand); - int8_t chargeCand = pdg->GetParticle(particle.pdgCode())->Charge() / PDGChargeScale; // Retrieve charge + auto chargeCand = pdg->GetParticle(particle.pdgCode())->Charge() / PDGChargeScale; // Retrieve charge if (chargeCand == ChargeZero) { chargeCand = (particle.pdgCode() > ChargeZero) ? AssignedChargeSc0 : -AssignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1 } @@ -1859,8 +1859,8 @@ struct HfCorrelatorLcScHadrons { if (cfgCharmCand.pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; // proton PID } - int8_t const chargeLc = static_cast(pdg->GetParticle(candidate.pdgCode())->Charge()); // Retrieve charge - int8_t const chargeAssoc = static_cast(pdg->GetParticle(particleAssoc.pdgCode())->Charge()); // Retrieve charge + auto const chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge + auto const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge float cent = 100.0; // will be updated later int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); @@ -1911,8 +1911,8 @@ struct HfCorrelatorLcScHadrons { PROCESS_SWITCH(HfCorrelatorLcScHadrons, processLambda0EffCal, "Mc process for lambda0", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +WorkflowSpec defineDataProcessing(ConfigContext const& context) { - return WorkflowSpec{adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(context), + adaptAnalysisTask(context)}; } From fa98e599c2242d522653b47f0ea0fa424dc194e8 Mon Sep 17 00:00:00 2001 From: Ravindra Singh <56298081+singhra1994@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:27:12 +0200 Subject: [PATCH 8/9] Enhance V0 daughter selection and processing Updated V0 daughter selection criteria and added new configurable parameters for V0 daughters. Adjusted processing functions to accommodate changes in V0 handling. --- .../TableProducer/correlatorXicHadrons.cxx | 98 ++++++++++--------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index 464a44d50eb..01c8c519f04 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -20,6 +20,7 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" #include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" @@ -377,14 +378,14 @@ struct HfCorrelatorXicHadrons { } cfgXicCand; struct : ConfigurableGroup { - Configurable cfgDaughPrPtMax{"cfgDaughPrPtMax", 5., "max. pT Daughter Proton"}; - Configurable cfgDaughPrPtMin{"cfgDaughPrPtMin", 0.3, "min. pT Daughter Proton"}; - Configurable cfgDaughPiPtMax{"cfgDaughPiPtMax", 10., "max. pT Daughter Pion"}; - Configurable cfgDaughPiPtMin{"cfgDaughPiPtMin", 0.3, "min. pT Daughter Pion"}; - Configurable cfgDaughPIDCutsTPCPr{"cfgDaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; - Configurable cfgDaughPIDCutsTPCPi{"cfgDaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; - Configurable cfgDaughPIDCutsTOFPi{"cfgDaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; - Configurable cfgDaughPIDCutsTOFPr{"cfgDaughPIDCutsTOFPr", 2.5, "max. TOFnSigma Pion"}; + Configurable cfgV0DaughPrPtMax{"cfgV0DaughPrPtMax", 5., "max. pT Daughter Proton"}; + Configurable cfgV0DaughPrPtMin{"cfgV0DaughPrPtMin", 0.3, "min. pT Daughter Proton"}; + Configurable cfgV0DaughPiPtMax{"cfgV0DaughPiPtMax", 10., "max. pT Daughter Pion"}; + Configurable cfgV0DaughPiPtMin{"cfgV0DaughPiPtMin", 0.3, "min. pT Daughter Pion"}; + Configurable cfgV0DaughPIDCutsTPCPr{"cfgV0DaughPIDCutsTPCPr", 2.5, "max. TPCnSigma Proton"}; + Configurable cfgV0DaughPIDCutsTPCPi{"cfgV0DaughPIDCutsTPCPi", 2.5, "max. TPCnSigma Pion"}; + Configurable cfgV0DaughPIDCutsTOFPi{"cfgV0DaughPIDCutsTOFPi", 2.5, "max. TOFnSigma Pion"}; + Configurable cfgV0DaughPIDCutsTOFPr{"cfgV0DaughPIDCutsTOFPr", -2.5, "min. TOFnSigma Proton (put only negative value)"}; Configurable cfgHypMassWindow{"cfgHypMassWindow", 0.1, "single lambda mass selection"}; Configurable cfgIsCorrCollMatchV0{"cfgIsCorrCollMatchV0", true, "check if daughter and mother collision are same"}; Configurable cfgCalDataDrivenEffPr{"cfgCalDataDrivenEffPr", false, "calculate data driven efficiency of proton using Lambda"}; @@ -399,6 +400,7 @@ struct HfCorrelatorXicHadrons { Configurable cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; Configurable cfgPV{"cfgPV", 10., "maximum z-vertex"}; Configurable calEffV0{"calEffV0", false, "calculate lambda0 efficiency"}; + Configurable checkTOFForPion{"checkTOFForPion", false, "if True, TOF selection on pion V0 wil only be applied if TOF present"}; } cfgV0; SliceCache cache; @@ -647,33 +649,38 @@ struct HfCorrelatorXicHadrons { } template - bool isSelectedV0Daughter(Tracktype const& track, V0Type v0, int pid) + bool isSelectedV0Daughter(Tracktype const& track, V0Type const& v0, int pid) { if (std::abs(track.eta()) > cfgXicCand.etaTrackMax) { return false; } + // --------------------------------------------------------- // 1. Proton PID Selection // --------------------------------------------------------- if (std::abs(pid) == kProton) { + bool hasTOFProton = (pid > 0) ? v0.positiveHasTOF() : v0.negativeHasTOF(); bool passTOF = false; - if (track.pt() > cfgV0.cfgDaughPrPtMax || track.pt() < cfgV0.cfgDaughPrPtMin) { + if (track.pt() > cfgV0.cfgV0DaughPrPtMax || track.pt() < cfgV0.cfgV0DaughPrPtMin) { return false; } - if (track.hasTOF()) { + + if (hasTOFProton && (track.pt() > cfgXicCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // pid > 0: Proton from Lambda (LaPr) // pid < 0: Antiproton from Anti-Lambda (ALaPr) double strangeTOF = (pid > 0) ? v0.tofNSigmaLaPr() : v0.tofNSigmaALaPr(); - passTOF = std::abs(strangeTOF) > cfgV0.cfgDaughPIDCutsTOFPr; + passTOF = strangeTOF > cfgV0.cfgV0DaughPIDCutsTOFPr; + } else { // if strange TOF is unavailable - passTOF = std::abs(track.tofNSigmaPr()) > cfgV0.cfgDaughPIDCutsTOFPr; + passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; } + } - if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgDaughPIDCutsTPCPr) || passTOF) { + if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { return false; } } @@ -681,31 +688,32 @@ struct HfCorrelatorXicHadrons { // --------------------------------------------------------- // 2. Pion PID Selection // --------------------------------------------------------- - if (std::abs(pid) == kPiPlus) { + if (std::abs(pid) == kPiPlus && cfgV0.checkTOFForPion) { + bool hasTOFPion = (pid < 0) ? v0.negativeHasTOF() : v0.positiveHasTOF(); bool passTOF = false; - if (track.pt() > cfgV0.cfgDaughPiPtMax || track.pt() < cfgV0.cfgDaughPiPtMin) { + if (track.pt() > cfgV0.cfgV0DaughPiPtMax || track.pt() < cfgV0.cfgV0DaughPiPtMin) { return false; } - if (track.hasTOF()) { + if (hasTOFPion && (track.pt() > cfgXicCand.tofPIDThreshold)) { if constexpr (std::experimental::is_detected::value) { // A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay. // We evaluate both applicable hypotheses based on charge sign and pick the best match. double tofLa = (pid > 0) ? v0.tofNSigmaALaPi() : v0.tofNSigmaLaPi(); - passTOF = tofLa > cfgV0.cfgDaughPIDCutsTOFPi; + passTOF = std::abs(tofLa) > cfgV0.cfgV0DaughPIDCutsTOFPi; } else { // Fallback to standard track TOF - passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgDaughPIDCutsTOFPi; + passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; } + } - if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgDaughPIDCutsTPCPi) || passTOF) { + if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { return false; } } - return true; } @@ -730,7 +738,7 @@ struct HfCorrelatorXicHadrons { } // Process Lambda (proton + pion) - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { entryHadron(v0.mLambda(), trackV0Pos.eta(), trackV0Pos.pt() * trackV0Pos.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Pos.tpcNSigmaPr(), trackV0Pos.tpcNSigmaKa(), trackV0Pos.tpcNSigmaPi(), trackV0Pos.tofNSigmaPr(), trackV0Pos.tofNSigmaKa(), trackV0Pos.tofNSigmaPi()); @@ -754,7 +762,7 @@ struct HfCorrelatorXicHadrons { } } - if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (passV0Sel && std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { entryHadron(v0.mAntiLambda(), trackV0Neg.eta(), trackV0Neg.pt() * trackV0Neg.sign(), 0, 0, v0.pt()); entryTrkPID(trackV0Neg.tpcNSigmaPr(), trackV0Neg.tpcNSigmaKa(), trackV0Neg.tpcNSigmaPi(), trackV0Neg.tofNSigmaPr(), trackV0Neg.tofNSigmaKa(), trackV0Neg.tofNSigmaPi()); @@ -787,7 +795,7 @@ struct HfCorrelatorXicHadrons { auto const& partV0Pos = trackV0Pos.mcParticle(); auto const& partV0Neg = trackV0Neg.mcParticle(); - if (passV0Sel && v0Mc.pdgCode() == kLambda0) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0 && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); @@ -802,7 +810,7 @@ struct HfCorrelatorXicHadrons { } } } - if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar) { + if (passV0Sel && v0Mc.pdgCode() == kLambda0Bar && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { registry.fill(HIST("hV0LambdaMcRec"), v0.mAntiLambda(), v0.pt(), partV0Neg.pt()); registry.fill(HIST("hV0LambdaReflMcRec"), v0.mLambda(), v0.pt(), partV0Pos.pt()); @@ -849,12 +857,12 @@ struct HfCorrelatorXicHadrons { if (std::abs(currentDaughter.pdgCode()) == kProton) { - if (currentDaughter.pt() > cfgV0.cfgDaughPrPtMax || currentDaughter.pt() < cfgV0.cfgDaughPrPtMin) { + if (currentDaughter.pt() > cfgV0.cfgV0DaughPrPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPrPtMin) { continue; } } else if (std::abs(currentDaughter.pdgCode()) == kPiPlus) { - if (currentDaughter.pt() > cfgV0.cfgDaughPiPtMax || currentDaughter.pt() < cfgV0.cfgDaughPiPtMin) { + if (currentDaughter.pt() > cfgV0.cfgV0DaughPiPtMax || currentDaughter.pt() < cfgV0.cfgV0DaughPiPtMin) { continue; } @@ -1032,7 +1040,7 @@ struct HfCorrelatorXicHadrons { } // Process Lambda (proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - v0.mLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, v0, kProton) && isSelectedV0Daughter(trackV0Neg, v0, kPiMinus)) { if (selXicCand) { @@ -1050,7 +1058,7 @@ struct HfCorrelatorXicHadrons { } // Process anti-Lambda (anti-proton-pion) - if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - v0.mAntiLambda()) < cfgV0.cfgHypMassWindow && v0.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, v0, kProtonBar) && isSelectedV0Daughter(trackV0Pos, v0, kPiPlus)) { if (selXicCand) { @@ -1484,14 +1492,14 @@ struct HfCorrelatorXicHadrons { auto const& trackV0Pos = assocParticle.template posTrack_as(); auto const& trackV0Neg = assocParticle.template negTrack_as(); - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() > 0) { if (isSelectedV0Daughter(trackV0Pos, assocParticle, kProton) && isSelectedV0Daughter(trackV0Neg, assocParticle, kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } } - if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow) { + if (std::abs(o2::constants::physics::MassLambda - assocParticle.mAntiLambda()) < cfgV0.cfgHypMassWindow && assocParticle.alpha() < 0) { if (isSelectedV0Daughter(trackV0Neg, assocParticle, -kProton) && isSelectedV0Daughter(trackV0Pos, assocParticle, -kPiPlus)) { fillCorrelationTable(cfgXicCand.fillTrkPID, assocParticle, ptCand, etaCand, phiCand, outputMlXic, poolBin, correlationStatus, yCand, massCand, *mcParticles); } @@ -1571,7 +1579,7 @@ struct HfCorrelatorXicHadrons { listDaughters.clear(); const std::size_t nDaughtersExpected = IsXicPlus ? XicDecayDaughtersCount::XicPlusDaughtersCount : XicDecayDaughtersCount::Xic0DaughtersCount; - if (IsXicPlus) { + if (IsXicPlus) { // Final state: p, pi-, pi-, pi+, pi+ std::array const arrDaughXicPlusPDG = {kProton, kPiMinus, kPiMinus, kPiPlus, kPiPlus}; @@ -1696,7 +1704,7 @@ struct HfCorrelatorXicHadrons { /// Data processing: XicPlus with V0 Lambda void processDataXicPlusV0(SelCollisions::iterator const& collision, TracksData const& tracks, - aod::V0Datas const& v0s, + soa::Join const& v0s, CandsXicPlusDataFiltered const& candidates, aod::BCsWithTimestamps const&) { @@ -1707,7 +1715,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: XicPlus with V0 Lambda void processMcRecXicPlusV0(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, CandsXicPlusMcRecFiltered const& candidates, aod::McParticles const& mcParticles) { @@ -1718,7 +1726,7 @@ struct HfCorrelatorXicHadrons { /// Data processing: Xic0 with V0 Lambda void processDataXic0V0(SelCollisions::iterator const& collision, TracksData const& tracks, - aod::V0Datas const& v0s, + soa::Join const& v0s, CandsXic0DataFiltered const& candidates, aod::BCsWithTimestamps const&) { @@ -1729,7 +1737,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: Xic0 with V0 Lambda void processMcRecXic0V0(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, CandsXic0McRecFiltered const& candidates, aod::McParticles const& mcParticles) { @@ -1740,7 +1748,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco processing: Xic0 with V0 Lambda void processV0McRec(SelCollisions::iterator const& collision, TracksWithMc const& tracks, - soa::Join const& v0s, + soa::Join const& v0s, aod::McParticles const& mcParticles) { fillEffV0(collision, v0s, tracks, mcParticles); @@ -1797,7 +1805,7 @@ struct HfCorrelatorXicHadrons { /// NOTE: V0 mixed events are more complex - need proper binning and collision matching void processDataMixedEventXicPlusV0(SelCollisions const& collisions, CandsXicPlusDataFiltered const& candidates, - aod::V0Datas const& v0s, + soa::Join const& v0s, TracksData const& tracks) { doMixEvent(collisions, v0s, candidates, tracks); @@ -1807,7 +1815,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco Mixed Event: XicPlus with V0 Lambda void processMcRecMixedEventXicPlusV0(SelCollisions const& collisions, CandsXicPlusMcRecFiltered const& candidates, - soa::Join const& v0s, + soa::Join const& v0s, TracksWithMc const& tracks, aod::McParticles const& mcParticles) { @@ -1818,7 +1826,7 @@ struct HfCorrelatorXicHadrons { /// Data Mixed Event: Xic0 with V0 Lambda void processDataMixedEventXic0V0(SelCollisions const& collisions, CandsXic0DataFiltered const& candidates, - aod::V0Datas const& v0s, + soa::Join const& v0s, TracksData const& tracks) { doMixEvent(collisions, v0s, candidates, tracks); @@ -1828,7 +1836,7 @@ struct HfCorrelatorXicHadrons { /// MC Reco Mixed Event: Xic0 with V0 Lambda void processMcRecMixedEventXic0V0(SelCollisions const& collisions, CandsXic0McRecFiltered const& candidates, - soa::Join const& v0s, + soa::Join const& v0s, TracksWithMc const& tracks, aod::McParticles const& mcParticles) { @@ -1902,7 +1910,7 @@ struct HfCorrelatorXicHadrons { candSign = ParticleType::AntiParticle; } - int8_t const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); + auto const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); float cent = 100.0; int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); @@ -1924,8 +1932,8 @@ struct HfCorrelatorXicHadrons { PROCESS_SWITCH(HfCorrelatorXicHadrons, processMcGenMixedEvent, "Process Mixed Event McGen", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +WorkflowSpec defineDataProcessing(ConfigContext const& context) { - return WorkflowSpec{adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(context), + adaptAnalysisTask(context)}; } From b60f1ce191a7959dc465b8b66a90b7d0daa2e304 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 4 Aug 2026 18:27:53 +0000 Subject: [PATCH 9/9] Please consider the following formatting changes --- PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx | 4 ++-- PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index 0ffe4481249..da60d9982c2 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -1859,8 +1859,8 @@ struct HfCorrelatorLcScHadrons { if (cfgCharmCand.pidTrkApplied && (std::abs(particleAssoc.pdgCode()) != kProton)) { continue; // proton PID } - auto const chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge - auto const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge + auto const chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge + auto const chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge float cent = 100.0; // will be updated later int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); diff --git a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx index 01c8c519f04..249b4eea990 100644 --- a/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorXicHadrons.cxx @@ -677,7 +677,6 @@ struct HfCorrelatorXicHadrons { // if strange TOF is unavailable passTOF = track.tofNSigmaPr() > cfgV0.cfgV0DaughPIDCutsTOFPr; } - } if ((std::abs(track.tpcNSigmaPr()) > cfgV0.cfgV0DaughPIDCutsTPCPr) && !passTOF) { @@ -707,7 +706,6 @@ struct HfCorrelatorXicHadrons { // Fallback to standard track TOF passTOF = std::abs(track.tofNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTOFPi; } - } if ((std::abs(track.tpcNSigmaPi()) > cfgV0.cfgV0DaughPIDCutsTPCPi) && !passTOF) { @@ -1579,7 +1577,7 @@ struct HfCorrelatorXicHadrons { listDaughters.clear(); const std::size_t nDaughtersExpected = IsXicPlus ? XicDecayDaughtersCount::XicPlusDaughtersCount : XicDecayDaughtersCount::Xic0DaughtersCount; - if (IsXicPlus) { + if (IsXicPlus) { // Final state: p, pi-, pi-, pi+, pi+ std::array const arrDaughXicPlusPDG = {kProton, kPiMinus, kPiMinus, kPiPlus, kPiPlus};