Skip to content

Commit 94313d8

Browse files
authored
[PWGHF] Templetise Jpsi type in HF helper functions for B2JPsi (#17980)
1 parent 17f4bba commit 94313d8

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

PWGHF/Core/HfHelper.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ struct HfHelper {
975975
/// \param useJpsiPdgMass Use PDG mass for J/psi when calculating B0 candidate mass
976976
/// \param useK0StarPdgMass Use PDG mass for K*0 when calculating B0 candidate mass
977977
/// \return true if candidate passes all selections
978-
template <typename T1, typename T2, typename T3>
978+
template <typename JPsis, typename T1, typename T2, typename T3>
979979
static bool selectionB0ToJpsiK0StarTopol(const T1& candB0, const T2& cuts, const T3& binsPt, const bool useJpsiPdgMass, const bool useK0StarPdgMass, const bool k0StarToKPi = true)
980980
{
981981
auto ptCandB0 = candB0.pt();
@@ -990,7 +990,7 @@ struct HfHelper {
990990
: RecoDecay::m(std::array{pVecLfDau0, pVecLfDau1}, std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus});
991991
auto ptJpsi = RecoDecay::pt(pVecMu0, pVecMu1);
992992
auto ptK0Star = RecoDecay::pt(pVecLfDau0, pVecLfDau1);
993-
auto candJpsi = candB0.jpsi();
993+
auto candJpsi = candB0.template jpsi_as<JPsis>();
994994
float pseudoPropDecLen = candB0.decayLengthXY() * mCandB0 / ptCandB0;
995995

996996
int binPt = o2::analysis::findBin(binsPt, ptCandB0);
@@ -1106,7 +1106,7 @@ struct HfHelper {
11061106
/// \param binsPt pT bin limits
11071107
/// \param useJpsiPdgMass Use PDG mass for J/psi when calculating B+ candidate mass
11081108
/// \return true if candidate passes all selections
1109-
template <typename T1, typename T2, typename T3>
1109+
template <typename JPsis, typename T1, typename T2, typename T3>
11101110
static bool selectionBplusToJpsiKTopol(const T1& candBp, const T2& cuts, const T3& binsPt, const bool useJpsiPdgMass)
11111111
{
11121112
auto ptCandBp = candBp.pt();
@@ -1116,7 +1116,7 @@ struct HfHelper {
11161116
auto const pVecKa = candBp.pVectorProng2();
11171117
auto ptJpsi = RecoDecay::pt(pVecMu0, pVecMu1);
11181118
auto ptKa = RecoDecay::pt(pVecKa);
1119-
auto candJpsi = candBp.jpsi();
1119+
auto candJpsi = candBp.template jpsi_as<JPsis>();
11201120
float pseudoPropDecLen = candBp.decayLengthXY() * mCandBp / ptCandBp;
11211121

11221122
int binPt = o2::analysis::findBin(binsPt, ptCandBp);
@@ -1297,7 +1297,7 @@ struct HfHelper {
12971297
/// \param useJpsiPdgMass Use PDG mass for J/psi when calculating Bs candidate mass
12981298
/// \param usePhiPdgMass Use PDG mass for phi when calculating Bs candidate mass
12991299
/// \return true if candidate passes all selections
1300-
template <typename T1, typename T2, typename T3>
1300+
template <typename JPsis, typename T1, typename T2, typename T3>
13011301
static bool selectionBsToJpsiPhiTopol(const T1& candBs, const T2& cuts, const T3& binsPt, const bool useJpsiPdgMass, const bool usePhiPdgMass)
13021302
{
13031303
auto ptCandBs = candBs.pt();
@@ -1309,7 +1309,7 @@ struct HfHelper {
13091309
auto mCandPhi = RecoDecay::m(std::array{pVecKa0, pVecKa1}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus});
13101310
auto ptJpsi = RecoDecay::pt(pVecMu0, pVecMu1);
13111311
auto ptPhi = RecoDecay::pt(pVecKa0, pVecKa1);
1312-
auto candJpsi = candBs.jpsi();
1312+
auto candJpsi = candBs.template jpsi_as<JPsis>();
13131313
float pseudoPropDecLen = candBs.decayLengthXY() * mCandBs / ptCandBs;
13141314

13151315
int binPt = o2::analysis::findBin(binsPt, ptCandBs);

PWGHF/D2H/Tasks/taskB0ToJpsiK0StarReduced.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ struct HfTaskB0ToJpsiK0StarReduced {
437437
SETBIT(statusB0PiK, SelectionStep::RecoSkims);
438438

439439
// topological selection for the two K*0 mass hypotheses
440-
bool selKPi = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, true);
441-
bool selPiK = HfHelper::selectionB0ToJpsiK0StarTopol(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, false);
440+
bool selKPi = HfHelper::selectionB0ToJpsiK0StarTopol<JPsis>(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, true);
441+
bool selPiK = HfHelper::selectionB0ToJpsiK0StarTopol<JPsis>(candidate, cuts, binsPt, useJpsiPdgMass, useK0StarPdgMass, false);
442442

443443
if (!selKPi && !selPiK && selectionFlagB0 >= BIT(SelectionStep::RecoTopol) * 2 - 1) {
444444
return;

PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ struct HfTaskBplusToJpsiKReduced {
385385
}
386386

387387
SETBIT(statusBplus, SelectionStep::RecoSkims);
388-
if (HfHelper::selectionBplusToJpsiKTopol(candidate, cuts, binsPt, useJpsiPdgMass)) {
388+
if (HfHelper::selectionBplusToJpsiKTopol<JPsis>(candidate, cuts, binsPt, useJpsiPdgMass)) {
389389
SETBIT(statusBplus, SelectionStep::RecoTopol);
390390
} else if (selectionFlagBplus >= BIT(SelectionStep::RecoTopol) * 2 - 1) {
391391
return;

PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ struct HfTaskBsToJpsiPhiReduced {
419419
}
420420

421421
SETBIT(statusBs, SelectionStep::RecoSkims);
422-
if (HfHelper::selectionBsToJpsiPhiTopol(candidate, cuts, binsPt, useJpsiPdgMass, usePhiPdgMass)) {
422+
if (HfHelper::selectionBsToJpsiPhiTopol<JPsis>(candidate, cuts, binsPt, useJpsiPdgMass, usePhiPdgMass)) {
423423
SETBIT(statusBs, SelectionStep::RecoTopol);
424424
} else if (selectionFlagBs >= BIT(SelectionStep::RecoTopol) * 2 - 1) {
425425
return;

0 commit comments

Comments
 (0)