From aebf951b3bacb9cf285cb79444dae10ac31f2c3b Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Fri, 4 Dec 2026 18:58:41 +0100 Subject: [PATCH 1/3] Adjust details of B->JPsi matching --- .../dataCreatorJpsiHadReduced.cxx | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 6c24a1339c4..69aa66e01c6 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -634,23 +634,25 @@ struct HfDataCreatorJpsiHadReduced { } if (jpsiDauPdgs.size() - std::count(jpsiDauPdgs.begin(), jpsiDauPdgs.end(), kGamma) == nProngsJpsi) { flag = signB * o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToMuMuPiK; - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1); - // we also test pi(K)-mu swapping - if (indexRec < 0) { - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1); - if (indexRec > -1) { - flagSwapped = true; + const auto& kstarPart = particlesMc.rawIteratorAt(dauIndices[0]+1); + if (RecoDecay::isMatchedMCGen(particlesMc, kstarPart, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1) || RecoDecay::isMatchedMCGen(particlesMc, kstarPart, signB * Pdg::kK0Star892, std::array{signB * kKPlus, -1 * signB * kPiPlus, +kGamma}, false, nullptr, 1)) { + // we found the K* in the right decay channel, we check possible reflections + channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0; + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1); + // we also test pi(K)-mu swapping + if (indexRec < 0) { + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1); + if (indexRec > -1) { + flagSwapped = true; + } } - } - if (indexRec < 0) { - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1); - if (indexRec > -1) { - flagSwapped = true; + if (indexRec < 0) { + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1); + if (indexRec > -1) { + flagSwapped = true; + } } } - if (indexRec > -1) { - channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0; - } } } @@ -684,23 +686,25 @@ struct HfDataCreatorJpsiHadReduced { } if (jpsiDauPdgs.size() - std::count(jpsiDauPdgs.begin(), jpsiDauPdgs.end(), kGamma) == nProngsJpsi) { flag = signB * o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToEEPiK; - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1); - // we also test pi(K)-mu swapping - if (indexRec < 0) { - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1); - if (indexRec > -1) { - flagSwapped = true; + const auto& kstarPart = particlesMc.rawIteratorAt(dauIndices[0]+1); + if (RecoDecay::isMatchedMCGen(particlesMc, kstarPart, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1) || RecoDecay::isMatchedMCGen(particlesMc, kstarPart, signB * Pdg::kK0Star892, std::array{signB * kKPlus, -1 * signB * kPiPlus, +kGamma}, false, nullptr, 1)) { + // we found the K* in the right decay channel, we check possible reflections + channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0; + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1); + // we also test pi(K)-e swapping + if (indexRec < 0) { + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[3]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1); + if (indexRec > -1) { + flagSwapped = true; + } } - } - if (indexRec < 0) { - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, &sign, 1); - if (indexRec > -1) { - flagSwapped = true; + if (indexRec < 0) { + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[1]}, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1); + if (indexRec > -1) { + flagSwapped = true; + } } } - if (indexRec > -1) { - channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0; - } } } @@ -961,14 +965,14 @@ struct HfDataCreatorJpsiHadReduced { flag = sign * o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToMuMuPiK; // Check K*0 -> K+pi- const auto& kStarPart = particlesMc.rawIteratorAt(particle.daughtersIds().back()); - if (RecoDecay::isMatchedMCGen(particlesMc, kStarPart, static_cast(Pdg::kK0Star892), std::array{+kKPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particlesMc, kStarPart, static_cast(Pdg::kK0Star892), std::array{+kKPlus, -kPiPlus, +kGamma}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMc, kStarPart, static_cast(Pdg::kK0Star892), std::array{+kKPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particlesMc, kStarPart, sign * static_cast(Pdg::kK0Star892), std::array{sign * kKPlus, -1 * sign * kPiPlus, +kGamma}, false)) { channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0; } } } // save information for B0 task - if (std::abs(flag) != o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToMuMuPiK) { + if (std::abs(flag) != o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0) { continue; } From a73591347ebffba4595d9d7784d8284e38ac1c79 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Fri, 4 Dec 2026 19:00:38 +0100 Subject: [PATCH 2/3] Revert wrong change --- PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index 69aa66e01c6..c8e8824f94e 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -972,7 +972,7 @@ struct HfDataCreatorJpsiHadReduced { } // save information for B0 task - if (std::abs(flag) != o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0) { + if (std::abs(flag) != o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToMuMuPiK) { continue; } From 428b1158bcc03b37f2f444a2c1be9d0b9c741a77 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 4 Dec 2026 18:02:37 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index c8e8824f94e..9279e83b1b0 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -634,7 +634,7 @@ struct HfDataCreatorJpsiHadReduced { } if (jpsiDauPdgs.size() - std::count(jpsiDauPdgs.begin(), jpsiDauPdgs.end(), kGamma) == nProngsJpsi) { flag = signB * o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToMuMuPiK; - const auto& kstarPart = particlesMc.rawIteratorAt(dauIndices[0]+1); + const auto& kstarPart = particlesMc.rawIteratorAt(dauIndices[0] + 1); if (RecoDecay::isMatchedMCGen(particlesMc, kstarPart, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1) || RecoDecay::isMatchedMCGen(particlesMc, kstarPart, signB * Pdg::kK0Star892, std::array{signB * kKPlus, -1 * signB * kPiPlus, +kGamma}, false, nullptr, 1)) { // we found the K* in the right decay channel, we check possible reflections channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0; @@ -686,7 +686,7 @@ struct HfDataCreatorJpsiHadReduced { } if (jpsiDauPdgs.size() - std::count(jpsiDauPdgs.begin(), jpsiDauPdgs.end(), kGamma) == nProngsJpsi) { flag = signB * o2::hf_decay::hf_cand_beauty::B0ToJpsiPiKToEEPiK; - const auto& kstarPart = particlesMc.rawIteratorAt(dauIndices[0]+1); + const auto& kstarPart = particlesMc.rawIteratorAt(dauIndices[0] + 1); if (RecoDecay::isMatchedMCGen(particlesMc, kstarPart, Pdg::kK0Star892, std::array{+kKPlus, -kPiPlus}, true, nullptr, 1) || RecoDecay::isMatchedMCGen(particlesMc, kstarPart, signB * Pdg::kK0Star892, std::array{signB * kKPlus, -1 * signB * kPiPlus, +kGamma}, false, nullptr, 1)) { // we found the K* in the right decay channel, we check possible reflections channel = o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0;