From 478f3380c2ab23933c325965f18b9c78ec6af2c7 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Sun, 20 Sep 2026 22:34:33 +0200 Subject: [PATCH 1/8] Add cpaJPsi and small fixes in B2JPsi code --- .../candidateCreatorBToJpsiReduced.cxx | 24 +++++++++++--- .../dataCreatorJpsiHadReduced.cxx | 3 -- PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 31 ++++++++++++------- PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx | 2 ++ PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 2 ++ .../DataModel/CandidateReconstructionTables.h | 14 +++++++++ 6 files changed, 58 insertions(+), 18 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx index ba5527cfcab..4386f9b2813 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx @@ -176,10 +176,26 @@ struct HfCandidateCreatorBToJpsiReduced { } for (const auto& candJpsi : candsJpsiThisColl) { - o2::track::TrackParametrizationWithError trackPosParCov( - candJpsi.xDauPos(), candJpsi.alphaDauPos(), {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()}, 1 /*Charge*/, 1 /*Muon*/); - o2::track::TrackParametrizationWithError trackNegParCov( - candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()}, -1 /*Charge*/, 1 /*Muon*/); + + std::array parsTrackPos = {candJpsi.yDauPos(), candJpsi.zDauPos(), candJpsi.snpDauPos(), candJpsi.tglDauPos(), candJpsi.signed1PtDauPos()}; + std::array parsTrackNeg = {candJpsi.yDauNeg(), candJpsi.zDauNeg(), candJpsi.snpDauNeg(), candJpsi.tglDauNeg(), candJpsi.signed1PtDauNeg()}; + + std::array covTrackPos = {candJpsi.cYYDauPos(), candJpsi.cZYDauPos(), candJpsi.cZZDauPos(), + candJpsi.cSnpYDauPos(), candJpsi.cSnpZDauPos(), + candJpsi.cSnpSnpDauPos(), candJpsi.cTglYDauPos(), candJpsi.cTglZDauPos(), + candJpsi.cTglSnpDauPos(), candJpsi.cTglTglDauPos(), + candJpsi.c1PtYDauPos(), candJpsi.c1PtZDauPos(), candJpsi.c1PtSnpDauPos(), + candJpsi.c1PtTglDauPos(), candJpsi.c1Pt21Pt2DauPos()}; + + std::array covTrackNeg = {candJpsi.cYYDauNeg(), candJpsi.cZYDauNeg(), candJpsi.cZZDauNeg(), + candJpsi.cSnpYDauNeg(), candJpsi.cSnpZDauNeg(), + candJpsi.cSnpSnpDauNeg(), candJpsi.cTglYDauNeg(), candJpsi.cTglZDauNeg(), + candJpsi.cTglSnpDauNeg(), candJpsi.cTglTglDauNeg(), + candJpsi.c1PtYDauNeg(), candJpsi.c1PtZDauNeg(), candJpsi.c1PtSnpDauNeg(), + candJpsi.c1PtTglDauNeg(), candJpsi.c1Pt21Pt2DauNeg()}; + + o2::track::TrackParametrizationWithError trackPosParCov(candJpsi.xDauPos(), candJpsi.alphaDauPos(), std::move(parsTrackPos), std::move(covTrackPos)); + o2::track::TrackParametrizationWithError trackNegParCov(candJpsi.xDauNeg(), candJpsi.alphaDauNeg(), std::move(parsTrackNeg), std::move(covTrackNeg)); // --------------------------------- // reconstruct J/Psi candidate diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index f4cfcaaa40c..b857ea91d2f 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -1115,7 +1115,6 @@ struct HfDataCreatorJpsiHadReduced { } registry.fill(HIST("hFitCandidatesBPlus"), SVFitting::FitOk); - o2::track::TrackParCov trackParCovBPlus{}; std::array pVecBPlus{}, pVec0{}, pVec1{}, pVec2{}; auto secondaryVertexBPlus = df3.getPCACandidate(); @@ -1124,8 +1123,6 @@ struct HfDataCreatorJpsiHadReduced { df3.getTrack(2).getPxPyPzGlo(pVec2); pVecBPlus = RecoDecay::pVec(pVec0, pVec1, pVec2); pVecJpsi = RecoDecay::pVec(pVec0, pVec1); - trackParCovBPlus = df3.createParentTrackParCov(); - trackParCovBPlus.setAbsCharge(0); // to be sure if (!isBSelected(pVecBPlus, secondaryVertexBPlus, collision)) { continue; diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index d4d5ccf7d1c..6b89392472c 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -91,7 +91,9 @@ 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(M, m, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(MK0StarBar, mK0StarBar, float); //! Invariant mass of K*0bar daughter candidates (GeV/c) +DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate particle (GeV/c2) +DECLARE_SOA_COLUMN(MBar, mBar, float); //! Invariant mass of candidate antiparticle (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) DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) @@ -127,7 +129,8 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float); DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate -DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate +DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate particle +DECLARE_SOA_COLUMN(CtXYBar, ctXYBar, float); //! Pseudo-proper decay length of candidate antiparticle DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of B daughters DECLARE_SOA_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, float); //! Impact parameter product of Jpsi daughters DECLARE_SOA_COLUMN(ImpactParameterProductK0Star, impactParameterProductK0Star, float); //! Impact parameter product of K*0 daughters @@ -148,18 +151,21 @@ DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with some B0 properties hf_cand_b0tojpsik0star_lite::M, + hf_cand_b0tojpsik0star_lite::MBar, hf_cand_b0tojpsik0star_lite::Pt, hf_cand_b0tojpsik0star_lite::Eta, hf_cand_b0tojpsik0star_lite::Phi, hf_cand_b0tojpsik0star_lite::Y, hf_cand_b0tojpsik0star_lite::Cpa, hf_cand_b0tojpsik0star_lite::CpaXY, + hf_cand_b0tojpsik0star_lite::CpaJpsi, hf_cand::Chi2PCA, hf_cand_b0tojpsik0star_lite::DecayLength, hf_cand_b0tojpsik0star_lite::DecayLengthXY, hf_cand_b0tojpsik0star_lite::DecayLengthNormalised, hf_cand_b0tojpsik0star_lite::DecayLengthXYNormalised, hf_cand_b0tojpsik0star_lite::CtXY, + hf_cand_b0tojpsik0star_lite::CtXYBar, hf_cand_b0tojpsik0star_lite::ImpactParameterProduct, hf_cand_b0tojpsik0star_lite::ImpactParameterProductJpsi, hf_cand_b0tojpsik0star_lite::ImpactParameterProductK0Star, @@ -171,6 +177,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::MK0StarBar, hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauPos, hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauNeg, hf_cand_b0tojpsik0star_lite::ImpactParameterLfTrack0, @@ -565,37 +572,39 @@ struct HfTaskB0ToJpsiK0StarReduced { } auto fillTable = [&](bool isSelKPi) { - auto ctXY = isSelKPi ? candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}) - : candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); - auto mlScoreSig = isSelKPi ? mlScoreSigKPi : mlScoreSigPiK; - auto invMassB0 = isSelKPi ? invMassB0KPi : invMassB0PiK; - auto invMassK0Star = isSelKPi ? invMassK0StarKPi : invMassK0StarPiK; + auto ctXY = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); + auto ctXYBar = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); + auto mlScoreSig = TESTBIT(isSelKPi, SelectionStep::RecoPID) ? mlScoreSigKPi : mlScoreSigPiK; hfRedCandB0Lite( // B0 - meson features - invMassB0, + invMassB0KPi, + invMassB0PiK, ptCandB0, candidate.eta(), candidate.phi(), HfHelper::yB0(candidate), candidate.cpa(), candidate.cpaXY(), + candidate.cpaJpsi(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), ctXY, + ctXYBar, candidate.impactParameterProduct(), candidate.impactParameterProductJpsi(), candidate.impactParameterProductK0Star(), candidate.maxNormalisedDeltaIP(), mlScoreSig, - isSelKPi ? statusB0KPi : -1, - isSelKPi ? -1 : statusB0PiK, + statusB0KPi, + statusB0PiK, // J/Psi features invMassJpsi, ptJpsi, - invMassK0Star, + invMassK0StarKPi, + invMassK0StarPiK, candidate.impactParameter0(), candidate.impactParameter1(), candidate.impactParameter2(), diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index 8207b3dc36a..bdb9a91b64f 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -134,6 +134,7 @@ DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with som hf_cand_bplustojpsik_lite::Y, hf_cand_bplustojpsik_lite::Cpa, hf_cand_bplustojpsik_lite::CpaXY, + hf_cand_bplustojpsik_lite::CpaJpsi, hf_cand::Chi2PCA, hf_cand_bplustojpsik_lite::DecayLength, hf_cand_bplustojpsik_lite::DecayLengthXY, @@ -450,6 +451,7 @@ struct HfTaskBplusToJpsiKReduced { HfHelper::yBplus(candidate), candidate.cpa(), candidate.cpaXY(), + candidate.cpaJpsi(), candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index 9a374a53e47..8cc3054105c 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -146,6 +146,7 @@ DECLARE_SOA_TABLE(HfRedCandBsLites, "AOD", "HFREDCANDBSLITE", //! Table with som hf_cand_bstojpsiphi_lite::Y, hf_cand_bstojpsiphi_lite::Cpa, hf_cand_bstojpsiphi_lite::CpaXY, + hf_cand_bstojpsiphi_lite::CpaJpsi, hf_cand::Chi2PCA, hf_cand_bstojpsiphi_lite::DecayLength, hf_cand_bstojpsiphi_lite::DecayLengthXY, @@ -487,6 +488,7 @@ struct HfTaskBsToJpsiPhiReduced { candidate.cpa(), candidate.cpaXY(), candidate.chi2PCA(), + candidate.cpaJpsi(), candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 37147a62937..04ebc8e5996 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -589,6 +589,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProduct, impactParameterProduct, // Im [](float px0, float py0, float pz0, float px1, float py1, float pz1, float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float impParK) -> float { return impParK * RecoDecay::impParXY(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, RecoDecay::pVec(std::array{px0, py0, pz0}, std::array{px1, py1, pz1})); }); DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, // J/Psi impact parameter for B+ -> J/Psi K [](float dcaDauPos, float dcaDauNeg) -> float { return dcaDauPos * dcaDauNeg; }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsi, cpaJpsi, //! + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0+px1, py0+py1, pz0+pz1}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsiXY, cpaJpsiXY, //! + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0+px1, py0+py1}); }); enum DecayTypeMc : uint8_t { BplusToD0PiToKPiPi = 0, BplusToD0KToKPiK, @@ -900,6 +904,8 @@ DECLARE_SOA_TABLE(HfCandBpJPBase, "AOD", "HFCANDBPJPBASE", hf_cand::PVector, hf_cand::Cpa, hf_cand::CpaXY, + hf_cand_bplus::CpaJpsi, + hf_cand_bplus::CpaJpsiXY, hf_cand::Ct, hf_cand::ImpactParameterXY, hf_cand_3prong::MaxNormalisedDeltaIP, @@ -1944,6 +1950,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, //! [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float errDlxy, float pxM, float pyM, float ip0, float errIp0, float ip1, float errIp1, float ip2, float errIp2, float ip3, float errIp3, float px0, float py0, float px1, float py1, float px2, float py2, float px3, float py3) -> float { return RecoDecay::maxNormalisedDeltaIP(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, errDlxy, std::array{pxM, pyM}, std::array{ip0, ip1, ip2, ip3}, std::array{errIp0, errIp1, errIp2, errIp3}, std::array{std::array{px0, py0}, std::array{px1, py1}, std::array{px2, py2}, std::array{px3, py3}}); }); DECLARE_SOA_DYNAMIC_COLUMN(CtXY, ctXY, //! [](float px0, float py0, float pz0, float px1, float py1, float pz1, float px2, float py2, float pz2, float px3, float py3, float pz3, float xVtxP, float yVtxP, float xVtxS, float yVtxS, const std::array& m) -> float { return RecoDecay::ctXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{std::array{px0, py0, pz0}, std::array{px1, py1, pz1}, std::array{px2, py2, pz2}, std::array{px3, py3, pz3}}, m); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsi, cpaJpsi, //! + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0+px1, py0+py1, pz0+pz1}); }); +DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsiXY, cpaJpsiXY, //! + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0+px1, py0+py1}); }); } // namespace hf_cand_4prong // declare dedicated B0 -> J/Psi K*0 decay candidate table @@ -1982,6 +1992,8 @@ DECLARE_SOA_TABLE(HfCandB0JPBase, "AOD", "HFCANDB0JPBASE", hf_cand::PVector, hf_cand::Cpa, hf_cand::CpaXY, + hf_cand_4prong::CpaJpsi, + hf_cand_4prong::CpaJpsiXY, hf_cand::Ct, hf_cand::ImpactParameterXY, hf_cand_4prong::MaxNormalisedDeltaIP, @@ -2037,6 +2049,8 @@ DECLARE_SOA_TABLE(HfCandBsJPBase, "AOD", "HFCANDBSJPBASE", hf_cand::PVector, hf_cand::Cpa, hf_cand::CpaXY, + hf_cand_4prong::CpaJpsi, + hf_cand_4prong::CpaJpsiXY, hf_cand::Ct, hf_cand::ImpactParameterXY, hf_cand_4prong::MaxNormalisedDeltaIP, From 2912b2132cfa28089acffb57d1b26ec7485901f5 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 20 Sep 2026 20:36:16 +0000 Subject: [PATCH 2/8] Please consider the following formatting changes --- PWGHF/DataModel/CandidateReconstructionTables.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 04ebc8e5996..c5c3eea19f1 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -590,9 +590,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProduct, impactParameterProduct, // Im DECLARE_SOA_DYNAMIC_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, // J/Psi impact parameter for B+ -> J/Psi K [](float dcaDauPos, float dcaDauNeg) -> float { return dcaDauPos * dcaDauNeg; }); DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsi, cpaJpsi, //! - [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0+px1, py0+py1, pz0+pz1}); }); + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0 + px1, py0 + py1, pz0 + pz1}); }); DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsiXY, cpaJpsiXY, //! - [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0+px1, py0+py1}); }); + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0 + px1, py0 + py1}); }); enum DecayTypeMc : uint8_t { BplusToD0PiToKPiPi = 0, BplusToD0KToKPiK, @@ -1951,9 +1951,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, //! DECLARE_SOA_DYNAMIC_COLUMN(CtXY, ctXY, //! [](float px0, float py0, float pz0, float px1, float py1, float pz1, float px2, float py2, float pz2, float px3, float py3, float pz3, float xVtxP, float yVtxP, float xVtxS, float yVtxS, const std::array& m) -> float { return RecoDecay::ctXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{std::array{px0, py0, pz0}, std::array{px1, py1, pz1}, std::array{px2, py2, pz2}, std::array{px3, py3, pz3}}, m); }); DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsi, cpaJpsi, //! - [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0+px1, py0+py1, pz0+pz1}); }); + [](float xVtxP, float yVtxP, float zVtxP, float xVtxS, float yVtxS, float zVtxS, float px0, float py0, float pz0, float px1, float py1, float pz1) -> float { return RecoDecay::cpa(std::array{xVtxP, yVtxP, zVtxP}, std::array{xVtxS, yVtxS, zVtxS}, std::array{px0 + px1, py0 + py1, pz0 + pz1}); }); DECLARE_SOA_DYNAMIC_COLUMN(CpaJpsiXY, cpaJpsiXY, //! - [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0+px1, py0+py1}); }); + [](float xVtxP, float yVtxP, float xVtxS, float yVtxS, float px0, float py0, float px1, float py1) -> float { return RecoDecay::cpaXY(std::array{xVtxP, yVtxP}, std::array{xVtxS, yVtxS}, std::array{px0 + px1, py0 + py1}); }); } // namespace hf_cand_4prong // declare dedicated B0 -> J/Psi K*0 decay candidate table From ffbec986904c505eff60824050c5dfe41424c08c Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Mon, 21 Sep 2026 08:44:07 +0200 Subject: [PATCH 3/8] Implement checker suggestions --- PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx | 2 ++ PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx index 4386f9b2813..25430a1ce18 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ #include #include #include +#include // std::move using namespace o2; using namespace o2::aod; diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index b857ea91d2f..b77ed91239b 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -60,7 +60,6 @@ #include #include #include -#include #include #include @@ -106,13 +105,13 @@ enum WrongCollisionType : uint8_t { SplitCollision, }; -std::map partlyRecoDecayMapMuMu = { +std::map const partlyRecoDecayMapMuMu = { {Pdg::kB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::B0ToJpsiXToMuMuX}, {Pdg::kBPlus, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BplusToJpsiXToMuMuX}, {Pdg::kBS, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BsToJpsiXToMuMuX}, {Pdg::kLambdaB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::LbToJpsiXToMuMuX}}; -std::map partlyRecoDecayMapEE = { +std::map const partlyRecoDecayMapEE = { {Pdg::kB0, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::B0ToJpsiXToEEX}, {Pdg::kBPlus, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BplusToJpsiXToEEX}, {Pdg::kBS, hf_decay::hf_cand_beauty::DecayChannelToJpsiMain::BsToJpsiXToEEX}, From c329608f2cc74ff65038a0dba8c681776f70c2bc Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Mon, 21 Sep 2026 08:56:18 +0200 Subject: [PATCH 4/8] Fix typo --- PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index 8cc3054105c..4853f6c6035 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -487,8 +487,8 @@ struct HfTaskBsToJpsiPhiReduced { HfHelper::yBs(candidate), candidate.cpa(), candidate.cpaXY(), - candidate.chi2PCA(), candidate.cpaJpsi(), + candidate.chi2PCA(), candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), From 749f2710888ae0b1e6af311ed0c838239f60449b Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Mon, 21 Sep 2026 10:49:37 +0200 Subject: [PATCH 5/8] Fix bugs introduced by the checker --- PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx index b77ed91239b..0bdc38965c7 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx @@ -594,7 +594,7 @@ struct HfDataCreatorJpsiHadReduced { // check that the other prongs come from the same b-hadron int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true); if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index2Mother == indexRecB) { - flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)]; + flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo)); break; } } @@ -694,7 +694,7 @@ struct HfDataCreatorJpsiHadReduced { int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true); int const index3Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[3].mcParticle(), bHadronMotherHypo, true); if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index3Mother > -1 && index2Mother == indexRecB && index3Mother == indexRecB) { - flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)]; + flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo)); break; } } @@ -795,7 +795,7 @@ struct HfDataCreatorJpsiHadReduced { int const index2Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[2].mcParticle(), bHadronMotherHypo, true); int const index3Mother = RecoDecay::getMother(particlesMc, vecDaughtersB[3].mcParticle(), bHadronMotherHypo, true); if (indexRecB > -1 && indexRecJPsi > -1 && index2Mother > -1 && index3Mother > -1 && index2Mother == indexRecB && index3Mother == indexRecB) { - flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu[std::abs(bHadronMotherHypo)] : signB * partlyRecoDecayMapEE[std::abs(bHadronMotherHypo)]; + flag = jpsiDau == kMuonMinus ? signB * partlyRecoDecayMapMuMu.at(std::abs(bHadronMotherHypo)) : signB * partlyRecoDecayMapEE.at(std::abs(bHadronMotherHypo)); break; } } From 0540f0631188157851efebc906343b2688d282c6 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Mon, 21 Sep 2026 11:40:21 +0200 Subject: [PATCH 6/8] Revert wrong changes to B02JPsi to handle correctly reflections --- PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index 6b89392472c..5060706bfbe 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -91,9 +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(MK0StarBar, mK0StarBar, float); //! Invariant mass of K*0bar daughter candidates (GeV/c) DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate particle (GeV/c2) -DECLARE_SOA_COLUMN(MBar, mBar, float); //! Invariant mass of candidate antiparticle (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) DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) @@ -151,7 +149,6 @@ DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with some B0 properties hf_cand_b0tojpsik0star_lite::M, - hf_cand_b0tojpsik0star_lite::MBar, hf_cand_b0tojpsik0star_lite::Pt, hf_cand_b0tojpsik0star_lite::Eta, hf_cand_b0tojpsik0star_lite::Phi, @@ -177,7 +174,6 @@ 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::MK0StarBar, hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauPos, hf_cand_b0tojpsik0star_lite::ImpactParameterJpsiDauNeg, hf_cand_b0tojpsik0star_lite::ImpactParameterLfTrack0, @@ -574,11 +570,9 @@ struct HfTaskB0ToJpsiK0StarReduced { auto fillTable = [&](bool isSelKPi) { auto ctXY = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); auto ctXYBar = candidate.ctXY(std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon, o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); - auto mlScoreSig = TESTBIT(isSelKPi, SelectionStep::RecoPID) ? mlScoreSigKPi : mlScoreSigPiK; hfRedCandB0Lite( // B0 - meson features - invMassB0KPi, - invMassB0PiK, + isSelKPi ? invMassB0KPi : invMassB0PiK, ptCandB0, candidate.eta(), candidate.phi(), @@ -597,14 +591,13 @@ struct HfTaskB0ToJpsiK0StarReduced { candidate.impactParameterProductJpsi(), candidate.impactParameterProductK0Star(), candidate.maxNormalisedDeltaIP(), - mlScoreSig, - statusB0KPi, - statusB0PiK, + isSelKPi ? mlScoreSigKPi : mlScoreSigPiK, + isSelKPi ? statusB0KPi : -1, + isSelKPi? -1 : statusB0PiK, // J/Psi features invMassJpsi, ptJpsi, - invMassK0StarKPi, - invMassK0StarPiK, + isSelKPi ? invMassK0StarKPi : invMassK0StarPiK, candidate.impactParameter0(), candidate.impactParameter1(), candidate.impactParameter2(), From 768bff805b62b6332ccef6d203992bda541781ab Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Mon, 21 Sep 2026 11:41:31 +0200 Subject: [PATCH 7/8] Remove leftover --- PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index 5060706bfbe..09c39baba9b 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -128,7 +128,6 @@ DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate DECLARE_SOA_COLUMN(CtXY, ctXY, float); //! Pseudo-proper decay length of candidate particle -DECLARE_SOA_COLUMN(CtXYBar, ctXYBar, float); //! Pseudo-proper decay length of candidate antiparticle DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of B daughters DECLARE_SOA_COLUMN(ImpactParameterProductJpsi, impactParameterProductJpsi, float); //! Impact parameter product of Jpsi daughters DECLARE_SOA_COLUMN(ImpactParameterProductK0Star, impactParameterProductK0Star, float); //! Impact parameter product of K*0 daughters @@ -162,7 +161,6 @@ DECLARE_SOA_TABLE(HfRedCandB0Lites, "AOD", "HFREDCANDB0LITE", //! Table with som hf_cand_b0tojpsik0star_lite::DecayLengthNormalised, hf_cand_b0tojpsik0star_lite::DecayLengthXYNormalised, hf_cand_b0tojpsik0star_lite::CtXY, - hf_cand_b0tojpsik0star_lite::CtXYBar, hf_cand_b0tojpsik0star_lite::ImpactParameterProduct, hf_cand_b0tojpsik0star_lite::ImpactParameterProductJpsi, hf_cand_b0tojpsik0star_lite::ImpactParameterProductK0Star, @@ -585,8 +583,7 @@ struct HfTaskB0ToJpsiK0StarReduced { candidate.decayLengthXY(), candidate.decayLengthNormalised(), candidate.decayLengthXYNormalised(), - ctXY, - ctXYBar, + isSelKPi ? ctXY : ctXYBar, candidate.impactParameterProduct(), candidate.impactParameterProductJpsi(), candidate.impactParameterProductK0Star(), From 671b599e40caccbc1a309b528e291ac5c6bac4fb Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 21 Sep 2026 09:42:12 +0000 Subject: [PATCH 8/8] Please consider the following formatting changes --- 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 09c39baba9b..fdcf6be8b80 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -590,7 +590,7 @@ struct HfTaskB0ToJpsiK0StarReduced { candidate.maxNormalisedDeltaIP(), isSelKPi ? mlScoreSigKPi : mlScoreSigPiK, isSelKPi ? statusB0KPi : -1, - isSelKPi? -1 : statusB0PiK, + isSelKPi ? -1 : statusB0PiK, // J/Psi features invMassJpsi, ptJpsi,