From d264e7be0dfae57aca6dd5f4ce8415c400d9730a Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Fri, 20 Nov 2026 12:07:14 +0100 Subject: [PATCH 1/3] Add selection of reso channels and add massKK for veto --- PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 17 +++++++++++++++++ PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 3 +++ 2 files changed, 20 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index 1ca03e38744..902ecafd2da 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -91,6 +91,7 @@ DECLARE_SOA_COLUMN(TpcChi2NClLfTrack1, tpcChi2NClLfTrack1, float); DECLARE_SOA_COLUMN(AbsEtaLfTrack1, absEtaLfTrack1, float); //! |eta| DECLARE_SOA_COLUMN(MJpsi, mJpsi, float); //! Invariant mass of Jpsi daughter candidates (GeV/c) DECLARE_SOA_COLUMN(MK0Star, mK0Star, float); //! Invariant mass of K*0 daughter candidates (GeV/c) +DECLARE_SOA_COLUMN(MPhi, mPhi, float); //! Invariant mass of K*0 daughter candidates for Bs veto (GeV/c) DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate particle (GeV/c2) DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) @@ -172,6 +173,7 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som hf_cand_b0tojpsik0star_lite::MJpsi, hf_cand_b0tojpsik0star_lite::PtJpsi, hf_cand_b0tojpsik0star_lite::MK0Star, + hf_cand_b0tojpsik0star_lite::MPhi, hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauPos, hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauNeg, hf_cand_b0tojpsik0star_lite::ImpactParameterLfTrack0, @@ -260,6 +262,7 @@ struct HfTaskB0ToJpsiK0StarReduced { Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; Configurable useJpsiPdgMass{"useJpsiPdgMass", true, "Whether to use J/Psi PDG mass for B+ candidate mass evaluation or to use the invariant mass of the two prongs"}; Configurable useK0StarPdgMass{"useK0StarPdgMass", true, "Whether to use K*0 PDG mass for B+ candidate mass evaluation or to use the invariant mass of the two prongs"}; + Configurable sampleReflections{"sampleReflections", false, "Flag to enable random rejection of one of the two mass hypotheses for reflected candidates"}; // topological cuts Configurable> binsPt{"binsPt", std::vector{hf_cuts_b0_to_jpsi_k0star::vecBinsPt}, "pT bin limits"}; Configurable> cuts{"cuts", {hf_cuts_b0_to_jpsi_k0star::Cuts[0], hf_cuts_b0_to_jpsi_k0star::NBinsPt, hf_cuts_b0_to_jpsi_k0star::NCutVars, hf_cuts_b0_to_jpsi_k0star::labelsPt, hf_cuts_b0_to_jpsi_k0star::labelsCutVar}, "B0 candidate selection per pT bin"}; @@ -423,6 +426,7 @@ struct HfTaskB0ToJpsiK0StarReduced { auto invMassJpsi = RecoDecay::m(std::array{pVecMu0, pVecMu1}, std::array{o2::constants::physics::MassMuonPlus, o2::constants::physics::MassMuonMinus}); auto invMassK0StarKPi = RecoDecay::m(std::array{pVecLfDau0, pVecLfDau1}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); auto invMassK0StarPiK = RecoDecay::m(std::array{pVecLfDau0, pVecLfDau1}, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); + auto invMassKK = RecoDecay::m(std::array{pVecLfDau0, pVecLfDau1}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}); // for mass veto int8_t flagMcMatchRec{0}, flagMcDecayChanRec{0}, flagWrongCollision{0}; bool isSignal = false; @@ -599,6 +603,7 @@ struct HfTaskB0ToJpsiK0StarReduced { invMassJpsi, ptJpsi, isSelKPi ? invMassK0StarKPi : invMassK0StarPiK, + invMassKK, candidate.impactParameter0(), candidate.impactParameter1(), candidate.impactParameter2(), @@ -661,6 +666,15 @@ struct HfTaskB0ToJpsiK0StarReduced { swapped); }; + if (sampleReflections && statusB0KPi >= selectionFlagB0 && statusB0PiK >= selectionFlagB0) { + float const pseudoRndmB = ptCandB0 * 1000. - static_cast(ptCandB0 * 1000); + if (pseudoRndm < 0) { + statusB0KPi = -1; + } else { + statusB0PiK = -1; + } + } + if (statusB0KPi >= selectionFlagB0) { fillTable(true); } @@ -672,6 +686,9 @@ struct HfTaskB0ToJpsiK0StarReduced { /// Fill particle histograms (gen MC truth) void fillCandMcGen(aod::HfMcGenRedB0s::iterator const& particle) { + if (particle.flagMcDecayChanRec() != o2::hf_decay::hf_cand_beauty::B0ToJpsiKstar0) { // we only accept resonant channel + return; + } auto ptParticle = particle.ptTrack(); auto yParticle = particle.yTrack(); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index f47802846cf..d6473b3cb59 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -568,6 +568,9 @@ struct HfTaskBsToJpsiPhiReduced { /// Fill particle histograms (gen MC truth) void fillCandMcGen(aod::HfMcGenRedBss::iterator const& particle) { + if (particle.flagMcDecayChanRec() != o2::hf_decay::hf_cand_beauty::BsToJpsiPhi) { // we only accept resonant channel + return; + } auto ptParticle = particle.ptTrack(); auto yParticle = particle.yTrack(); if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { From c1f6e13a78b0902303785ae53a3e7ef1a18a3759 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Fri, 20 Nov 2026 12:14:22 +0100 Subject: [PATCH 2/3] Update PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx Co-authored-by: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> --- PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index 902ecafd2da..8dddf29c10e 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -668,7 +668,7 @@ struct HfTaskB0ToJpsiK0StarReduced { if (sampleReflections && statusB0KPi >= selectionFlagB0 && statusB0PiK >= selectionFlagB0) { float const pseudoRndmB = ptCandB0 * 1000. - static_cast(ptCandB0 * 1000); - if (pseudoRndm < 0) { + if (pseudoRndm < 0.5) { statusB0KPi = -1; } else { statusB0PiK = -1; From eef51dd7f41e61642f782541dce5674f3353ec7e Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Fri, 20 Nov 2026 12:16:28 +0100 Subject: [PATCH 3/3] Fix typo --- PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index 8dddf29c10e..f65cb53fdbc 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -668,7 +668,7 @@ struct HfTaskB0ToJpsiK0StarReduced { if (sampleReflections && statusB0KPi >= selectionFlagB0 && statusB0PiK >= selectionFlagB0) { float const pseudoRndmB = ptCandB0 * 1000. - static_cast(ptCandB0 * 1000); - if (pseudoRndm < 0.5) { + if (pseudoRndmB < 0.5) { statusB0KPi = -1; } else { statusB0PiK = -1;