From ca6687172ede14e0e28d3a616bee0c300b0f586b Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Sun, 20 Sep 2026 12:16:46 +0200 Subject: [PATCH 1/2] Templetise Jpsi format in HF helper functions for B2JPsi --- PWGHF/Core/HfHelper.h | 12 ++++++------ PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx | 4 ++-- PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx | 6 +++--- PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index c128598522d..e6299b483f8 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -975,7 +975,7 @@ struct HfHelper { /// \param useJpsiPdgMass Use PDG mass for J/psi when calculating B0 candidate mass /// \param useK0StarPdgMass Use PDG mass for K*0 when calculating B0 candidate mass /// \return true if candidate passes all selections - template + template static bool selectionB0ToJpsiK0StarTopol(const T1& candB0, const T2& cuts, const T3& binsPt, const bool useJpsiPdgMass, const bool useK0StarPdgMass, const bool k0StarToKPi = true) { auto ptCandB0 = candB0.pt(); @@ -990,7 +990,7 @@ struct HfHelper { : RecoDecay::m(std::array{pVecLfDau0, pVecLfDau1}, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus}); auto ptJpsi = RecoDecay::pt(pVecMu0, pVecMu1); auto ptK0Star = RecoDecay::pt(pVecLfDau0, pVecLfDau1); - auto candJpsi = candB0.jpsi(); + auto candJpsi = candB0.template jpsi_as(); float pseudoPropDecLen = candB0.decayLengthXY() * mCandB0 / ptCandB0; int binPt = o2::analysis::findBin(binsPt, ptCandB0); @@ -1106,7 +1106,7 @@ struct HfHelper { /// \param binsPt pT bin limits /// \param useJpsiPdgMass Use PDG mass for J/psi when calculating B+ candidate mass /// \return true if candidate passes all selections - template + template static bool selectionBplusToJpsiKTopol(const T1& candBp, const T2& cuts, const T3& binsPt, const bool useJpsiPdgMass) { auto ptCandBp = candBp.pt(); @@ -1116,7 +1116,7 @@ struct HfHelper { auto const pVecKa = candBp.pVectorProng2(); auto ptJpsi = RecoDecay::pt(pVecMu0, pVecMu1); auto ptKa = RecoDecay::pt(pVecKa); - auto candJpsi = candBp.jpsi(); + auto candJpsi = candBp.template jpsi_as(); float pseudoPropDecLen = candBp.decayLengthXY() * mCandBp / ptCandBp; int binPt = o2::analysis::findBin(binsPt, ptCandBp); @@ -1297,7 +1297,7 @@ struct HfHelper { /// \param useJpsiPdgMass Use PDG mass for J/psi when calculating Bs candidate mass /// \param usePhiPdgMass Use PDG mass for phi when calculating Bs candidate mass /// \return true if candidate passes all selections - template + template static bool selectionBsToJpsiPhiTopol(const T1& candBs, const T2& cuts, const T3& binsPt, const bool useJpsiPdgMass, const bool usePhiPdgMass) { auto ptCandBs = candBs.pt(); @@ -1309,7 +1309,7 @@ struct HfHelper { auto mCandPhi = RecoDecay::m(std::array{pVecKa0, pVecKa1}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus}); auto ptJpsi = RecoDecay::pt(pVecMu0, pVecMu1); auto ptPhi = RecoDecay::pt(pVecKa0, pVecKa1); - auto candJpsi = candBs.jpsi(); + auto candJpsi = candBs.template jpsi_as(); float pseudoPropDecLen = candBs.decayLengthXY() * mCandBs / ptCandBs; int binPt = o2::analysis::findBin(binsPt, ptCandBs); diff --git a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx index 3870a9387c7..d4d5ccf7d1c 100644 --- a/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx +++ b/PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx @@ -437,8 +437,8 @@ struct HfTaskB0ToJpsiK0StarReduced { SETBIT(statusB0PiK, SelectionStep::RecoSkims); // topological selection for the two K*0 mass hypotheses - bool selKPi = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, true); - bool selPiK = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, false); + bool selKPi = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, true); + bool selPiK = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, false); if (!selKPi && !selPiK && selectionFlagB0 >= BIT(SelectionStep::RecoTopol) * 2 - 1) { return; diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index d685a6decc9..ee019be180f 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -65,8 +65,8 @@ namespace o2::aod namespace hf_cand_bplustojpsik_lite { DECLARE_SOA_COLUMN(PtJpsi, ptJpsi, float); //! Transverse momentum of Jpsi daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of bachelor kaon (GeV/c) DECLARE_SOA_COLUMN(ItsNClsJpsiDauPos, itsNClsJpsiDauPos, int); //! Number of clusters in ITS DECLARE_SOA_COLUMN(TpcNClsCrossedRowsJpsiDauPos, tpcNClsCrossedRowsJpsiDauPos, int); //! Number of TPC crossed rows @@ -385,7 +385,7 @@ struct HfTaskBplusToJpsiKReduced { } SETBIT(statusBplus, SelectionStep::RecoSkims); - if (HfHelper::selectionBplusToJpsiKTopol(candidate, cuts, binsPt, useJpsiPdgMass)) { + if (HfHelper::selectionBplusToJpsiKTopol(candidate, cuts, binsPt, useJpsiPdgMass)) { SETBIT(statusBplus, SelectionStep::RecoTopol); } else if (selectionFlagBplus >= BIT(SelectionStep::RecoTopol) * 2 - 1) { return; diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index 51016464d08..624412ca98d 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -65,8 +65,8 @@ namespace o2::aod namespace hf_cand_bstojpsiphi_lite { DECLARE_SOA_COLUMN(PtJpsi, ptJpsi, float); //! Transverse momentum of Jpsi daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) DECLARE_SOA_COLUMN(PtBach0, ptBach0, float); //! Transverse momentum of bachelor kaon(<- phi) (GeV/c) DECLARE_SOA_COLUMN(PtBach1, ptBach1, float); //! Transverse momentum of bachelor kaon(<- phi) (GeV/c) DECLARE_SOA_COLUMN(ItsNClsJpsiDauPos, itsNClsJpsiDauPos, int); //! Number of clusters in ITS @@ -419,7 +419,7 @@ struct HfTaskBsToJpsiPhiReduced { } SETBIT(statusBs, SelectionStep::RecoSkims); - if (HfHelper::selectionBsToJpsiPhiTopol(candidate, cuts, binsPt, useJpsiPdgMass, usePhiPdgMass)) { + if (HfHelper::selectionBsToJpsiPhiTopol(candidate, cuts, binsPt, useJpsiPdgMass, usePhiPdgMass)) { SETBIT(statusBs, SelectionStep::RecoTopol); } else if (selectionFlagBs >= BIT(SelectionStep::RecoTopol) * 2 - 1) { return; From 1c4b822e9cd708023eb9b7a1cb699e4b1f59dee5 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Sun, 20 Sep 2026 12:18:16 +0200 Subject: [PATCH 2/2] Remove extra spaces --- PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx | 4 ++-- PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx index ee019be180f..8207b3dc36a 100644 --- a/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx @@ -65,8 +65,8 @@ namespace o2::aod namespace hf_cand_bplustojpsik_lite { DECLARE_SOA_COLUMN(PtJpsi, ptJpsi, float); //! Transverse momentum of Jpsi daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of bachelor kaon (GeV/c) DECLARE_SOA_COLUMN(ItsNClsJpsiDauPos, itsNClsJpsiDauPos, int); //! Number of clusters in ITS DECLARE_SOA_COLUMN(TpcNClsCrossedRowsJpsiDauPos, tpcNClsCrossedRowsJpsiDauPos, int); //! Number of TPC crossed rows diff --git a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx index 624412ca98d..9a374a53e47 100644 --- a/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx +++ b/PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx @@ -65,8 +65,8 @@ namespace o2::aod namespace hf_cand_bstojpsiphi_lite { DECLARE_SOA_COLUMN(PtJpsi, ptJpsi, float); //! Transverse momentum of Jpsi daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauPos, ptJpsiDauPos, float); //! Transverse momentum of Jpsi positive daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtJpsiDauNeg, ptJpsiDauNeg, float); //! Transverse momentum of Jpsi negative daughter candidate (GeV/c) DECLARE_SOA_COLUMN(PtBach0, ptBach0, float); //! Transverse momentum of bachelor kaon(<- phi) (GeV/c) DECLARE_SOA_COLUMN(PtBach1, ptBach1, float); //! Transverse momentum of bachelor kaon(<- phi) (GeV/c) DECLARE_SOA_COLUMN(ItsNClsJpsiDauPos, itsNClsJpsiDauPos, int); //! Number of clusters in ITS