From 9a9618d885737f623a6fdc723f75ddf8529e3db2 Mon Sep 17 00:00:00 2001 From: Shirajum Monira Date: Sun, 22 Feb 2026 01:42:51 +0200 Subject: [PATCH 1/4] implemented bitmask in mc reco --- .../femtoUniversePairTaskTrackV0Extended.cxx | 124 +++++++++++++----- 1 file changed, 93 insertions(+), 31 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index bcc85d0acc2..c595b053903 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -58,6 +58,8 @@ struct FemtoUniversePairTaskTrackV0Extended { using FemtoRecoParticles = soa::Join; Preslice perColMC = aod::femtouniverseparticle::fdCollisionId; + using FemtoBasicParticles = soa::Join; + /// To apply narrow cut Configurable confZVertexCut{"confZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; Configurable confEta{"confEta", 0.8, "Eta cut for the global track"}; @@ -1533,7 +1535,8 @@ struct FemtoUniversePairTaskTrackV0Extended { } PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processPairFractionsMCTruthV0, "Process MC data to obtain pair fractions for V0V0 MC truth pairs", false); - void processMCReco(FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts) + template + void doMCReco(PartType const& parts, aod::FdMCParticles const& mcparts) { for (const auto& part : parts) { auto mcPartId = part.fdMCParticleId(); @@ -1542,55 +1545,104 @@ struct FemtoUniversePairTaskTrackV0Extended { const auto& mcpart = mcparts.iteratorAt(mcPartId); // if (part.partType() == aod::femtouniverseparticle::ParticleType::kV0) { + if (!invMLambda(part.mLambda(), part.mAntiLambda())) + continue; if (mcpart.pdgMCTruth() == kLambda0) { - const auto& posChild = parts.iteratorAt(part.globalIndex() - 2); - const auto& negChild = parts.iteratorAt(part.globalIndex() - 1); - /// Daughters that do not pass this condition are not selected - if (isParticleTPC(posChild, 0) && isParticleTPC(negChild, 1)) { - registryMCreco.fill(HIST("plus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // lambda - if (auto mcpartIdChild = posChild.fdMCParticleId(); mcpartIdChild != -1) { - const auto& mcpartChild = mcparts.iteratorAt(mcpartIdChild); - registryMCreco.fill(HIST("plus/MCrecoLambdaChildPr"), mcpartChild.pt(), mcpartChild.eta()); // lambda proton child - } - if (auto mcpartIdChild = negChild.fdMCParticleId(); mcpartIdChild != -1) { - const auto& mcpartChild = mcparts.iteratorAt(mcpartIdChild); - registryMCreco.fill(HIST("plus/MCrecoLambdaChildPi"), mcpartChild.pt(), mcpartChild.eta()); // lambda pion child + const auto& posChild = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex()); + const auto& negChild = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex()); + if constexpr (std::experimental::is_detected::value) { + /// Daughters that do not pass this condition are not selected + if (!isParticleTPC(posChild, 0) || !isParticleTPC(negChild, 1)) + continue; + + if (!isParticleTOF(posChild, 0) || !isParticleTOF(negChild, 1)) + continue; + + } else { + if ((posChild.pidCut() & (1u << 0)) == 0 || (negChild.pidCut() & (1u << 1)) == 0) + continue; + + if (ConfV0Selection.confUseStrangenessTOF) { + if ((part.pidCut() & 3) != 3) + continue; + } else { + if ((posChild.pidCut() & (8u << 0)) == 0 || (negChild.pidCut() & (8u << 1)) == 0) + continue; } } + registryMCreco.fill(HIST("plus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // lambda + } else if (mcpart.pdgMCTruth() == kLambda0Bar) { - const auto& posChild = parts.iteratorAt(part.globalIndex() - 2); - const auto& negChild = parts.iteratorAt(part.globalIndex() - 1); - /// Daughters that do not pass this condition are not selected - if (isParticleTPC(posChild, 1) && isParticleTPC(negChild, 0)) { - registryMCreco.fill(HIST("minus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // anti-lambda - if (auto mcpartIdChild = posChild.fdMCParticleId(); mcpartIdChild != -1) { - const auto& mcpartChild = mcparts.iteratorAt(mcpartIdChild); - registryMCreco.fill(HIST("minus/MCrecoLambdaChildPi"), mcpartChild.pt(), mcpartChild.eta()); // anti-lambda pion child - } - if (auto mcpartIdChild = negChild.fdMCParticleId(); mcpartIdChild != -1) { - const auto& mcpartChild = mcparts.iteratorAt(mcpartIdChild); - registryMCreco.fill(HIST("minus/MCrecoLambdaChildPr"), mcpartChild.pt(), mcpartChild.eta()); // anti-lambda proton child + const auto& posChild = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex()); + const auto& negChild = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex()); + if constexpr (std::experimental::is_detected::value) { + /// Daughters that do not pass this condition are not selected + if (!isParticleTPC(posChild, 1) || !isParticleTPC(negChild, 0)) + continue; + + if (!isParticleTOF(posChild, 1) || !isParticleTOF(negChild, 0)) + continue; + + } else { + if ((posChild.pidCut() & (1u << 1)) == 0 || (negChild.pidCut() & (1u << 0)) == 0) + continue; + + if (ConfV0Selection.confUseStrangenessTOF) { + if ((part.pidCut() & 12) != 12) + continue; + } else { + if ((posChild.pidCut() & (8u << 1)) == 0 || (negChild.pidCut() & (8u << 0)) == 0) + continue; } } + registryMCreco.fill(HIST("minus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // anti-lambda } } else if (part.partType() == aod::femtouniverseparticle::ParticleType::kTrack) { - if (part.sign() > 0) { + if (part.mAntiLambda() > 0) { // mAntiLambda is the sign here registryMCreco.fill(HIST("plus/MCrecoAllPt"), mcpart.pt()); - if (mcpart.pdgMCTruth() == kPiPlus && isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()))) { + if (mcpart.pdgMCTruth() == kPiPlus) { + if constexpr (std::experimental::is_detected::value) { + if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()))) + continue; + } else { + if ((part.pidCut() & 128u) == 0) // 128 for pion combined + continue; + } registryMCreco.fill(HIST("plus/MCrecoPi"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPiPt"), mcpart.pt()); - } else if (mcpart.pdgMCTruth() == kProton && isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()))) { + } else if (mcpart.pdgMCTruth() == kProton) { + if constexpr (std::experimental::is_detected::value) { + if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()))) + continue; + } else { + if ((part.pidCut() & 64u) == 0) // 64 for proton combined + continue; + } registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt()); } } - if (part.sign() < 0) { + else if (part.mAntiLambda() < 0) { registryMCreco.fill(HIST("minus/MCrecoAllPt"), mcpart.pt()); - if (mcpart.pdgMCTruth() == kPiMinus && isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()))) { + if (mcpart.pdgMCTruth() == kPiMinus) { + if constexpr (std::experimental::is_detected::value) { + if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePi()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePi()))) + continue; + } else { + if ((part.pidCut() & 128u) == 0) // 128 for pion combined + continue; + } registryMCreco.fill(HIST("minus/MCrecoPi"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPiPt"), mcpart.pt()); - } else if (mcpart.pdgMCTruth() == kProtonBar && isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()))) { + } else if (mcpart.pdgMCTruth() == kProtonBar) { + if constexpr (std::experimental::is_detected::value) { + if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()))) + continue; + } else { + if ((part.pidCut() & 64u) == 0) // 64 for proton combined + continue; + } registryMCreco.fill(HIST("minus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPrPt"), mcpart.pt()); } @@ -1599,7 +1651,17 @@ struct FemtoUniversePairTaskTrackV0Extended { } } + void processMCReco(FemtoRecoParticles const& parts, aod::FdMCParticles const& mcparts) + { + doMCReco(parts, mcparts); + } PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCReco, "Process MC reco data", false); + + void processMCRecoBitmask(FemtoBasicParticles const& parts, aod::FdMCParticles const& mcparts) + { + doMCReco(parts, mcparts); + } + PROCESS_SWITCH(FemtoUniversePairTaskTrackV0Extended, processMCRecoBitmask, "Process MC reco data using bitmask for PID", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 2b5bcd12f34bc8da6bad6b1917d778ccbfebae35 Mon Sep 17 00:00:00 2001 From: Shirajum Monira Date: Tue, 24 Feb 2026 23:44:06 +0200 Subject: [PATCH 2/4] cpp lint fix --- .../Tasks/femtoUniversePairTaskTrackV0Extended.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index c595b053903..9c9880f78a2 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -1621,9 +1621,7 @@ struct FemtoUniversePairTaskTrackV0Extended { registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt()); } - } - - else if (part.mAntiLambda() < 0) { + } else if (part.mAntiLambda() < 0) { registryMCreco.fill(HIST("minus/MCrecoAllPt"), mcpart.pt()); if (mcpart.pdgMCTruth() == kPiMinus) { if constexpr (std::experimental::is_detected::value) { From 4103b57ce74832fc6b29c88c4be5d81d1b7c3bbd Mon Sep 17 00:00:00 2001 From: Shirajum Monira Date: Wed, 25 Feb 2026 15:05:30 +0200 Subject: [PATCH 3/4] implemented fix based on the new definition of lambda invM check --- .../Tasks/femtoUniversePairTaskTrackV0Extended.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 9c9880f78a2..91c5826fbec 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -1545,9 +1545,9 @@ struct FemtoUniversePairTaskTrackV0Extended { const auto& mcpart = mcparts.iteratorAt(mcPartId); // if (part.partType() == aod::femtouniverseparticle::ParticleType::kV0) { - if (!invMLambda(part.mLambda(), part.mAntiLambda())) - continue; if (mcpart.pdgMCTruth() == kLambda0) { + if (!invMLambda(part.mLambda(), part.mAntiLambda(), 0)) + continue; const auto& posChild = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex()); const auto& negChild = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex()); if constexpr (std::experimental::is_detected::value) { @@ -1573,6 +1573,8 @@ struct FemtoUniversePairTaskTrackV0Extended { registryMCreco.fill(HIST("plus/MCrecoLambda"), mcpart.pt(), mcpart.eta()); // lambda } else if (mcpart.pdgMCTruth() == kLambda0Bar) { + if (!invMLambda(part.mLambda(), part.mAntiLambda(), 1)) + continue; const auto& posChild = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex()); const auto& negChild = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex()); if constexpr (std::experimental::is_detected::value) { From 54af310bd46398968ba678704f2bafc1aa567b1b Mon Sep 17 00:00:00 2001 From: Shirajum Monira Date: Thu, 26 Feb 2026 13:36:25 +0200 Subject: [PATCH 4/4] Trigger Build