Skip to content

Commit cc441dd

Browse files
author
Mattia Faggin
committed
Add helper function for KPi pair mass.
1 parent 3f6d62c commit cc441dd

4 files changed

Lines changed: 30 additions & 8 deletions

File tree

PWGHF/Core/HfHelper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,18 @@ class HfHelper
358358
return candidate.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassProton});
359359
}
360360

361+
template <typename T>
362+
auto invMassKPiPairLcToPKPi(const T& candidate)
363+
{
364+
return RecoDecay::m(std::array{candidate.pVectorProng1(), candidate.pVectorProng2()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus});
365+
}
366+
367+
template <typename T>
368+
auto invMassKPiPairLcToPiKP(const T& candidate)
369+
{
370+
return RecoDecay::m(std::array{candidate.pVectorProng1(), candidate.pVectorProng0()}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus});
371+
}
372+
361373
// Ξc± → p± K∓ π±
362374

363375
template <typename T>

PWGHF/D2H/Tasks/taskCharmPolarisation.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ struct TaskPolarisationCharmHadrons {
815815
}
816816
}
817817
// invariant mass of the KPi pair
818-
invMassKPiLc = RecoDecay::m(std::array{candidate.pVectorProng1(), candidate.pVectorProng2()}, std::array{massKaon, massPi});
818+
invMassKPiLc = hfHelper.invMassKPiPairLcToPKPi(candidate);
819819
} else if (iMass == charm_polarisation::MassHyposLcToPKPi::PiKP && candidate.isSelLcToPiKP() >= selectionFlagLcToPKPi) {
820820
// reconstructed as piKp
821821
pxDau = candidate.pxProng2();
@@ -841,7 +841,7 @@ struct TaskPolarisationCharmHadrons {
841841
}
842842
}
843843
// invariant mass of the KPi pair
844-
invMassKPiLc = RecoDecay::m(std::array{candidate.pVectorProng1(), candidate.pVectorProng0()}, std::array{massKaon, massPi});
844+
invMassKPiLc = hfHelper.invMassKPiPairLcToPiKP(candidate);
845845
} else {
846846
// NB: no need to check cases in which candidate.isSelLcToPKPi() and candidate.isSelLcToPiKP() are both false, because they are rejected already by the Filter
847847
// ... but we need to put this protections here!

PWGHF/TableProducer/candidateSelectorLc.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,18 @@ struct HfCandidateSelectorLc {
241241
/// cut on the Kpi pair invariant mass, to study Lc->pK*(->Kpi)
242242
const double cutMassKPi = cuts->get(pTBin, "mass (Kpi)");
243243
if (cutMassKPi > 0) {
244-
if (std::abs(RecoDecay::m(std::array{trackKaon.pVector(), trackPion.pVector()}, std::array{o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPiPlus}) - massK0Star892) > cutMassKPi) {
245-
return false;
244+
if (trackProton.globalIndex() == candidate.prong0Id()) {
245+
// inspecting the pKpi hypothesis
246+
// K: prong1, pi: prong 2
247+
if (std::abs(hfHelper.invMassKPiPairLcToPKPi(candidate) - massK0Star892) > cutMassKPi) {
248+
return false;
249+
}
250+
} else {
251+
// inspecting the piKp hypothesis
252+
// K: prong1, pi: prong 0
253+
if (std::abs(hfHelper.invMassKPiPairLcToPiKP(candidate) - massK0Star892) > cutMassKPi) {
254+
return false;
255+
}
246256
}
247257
}
248258

PWGHF/TableProducer/treeCreatorLcToPKPi.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ struct HfTreeCreatorLcToPKPi {
493493
}
494494
};
495495

496-
fillTable(0, candidate.isSelLcToPKPi(), hfHelper.invMassLcToPKPi(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), RecoDecay::m(std::array{trackNeg.pVector(), trackPos2.pVector()}, std::array{o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPiPlus}));
497-
fillTable(1, candidate.isSelLcToPiKP(), hfHelper.invMassLcToPiKP(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), RecoDecay::m(std::array{trackNeg.pVector(), trackPos1.pVector()}, std::array{o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPiPlus}));
496+
fillTable(0, candidate.isSelLcToPKPi(), hfHelper.invMassLcToPKPi(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), hfHelper.invMassKPiPairLcToPKPi(candidate));
497+
fillTable(1, candidate.isSelLcToPiKP(), hfHelper.invMassLcToPiKP(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), hfHelper.invMassKPiPairLcToPiKP(candidate));
498498
}
499499

500500
// Filling particle properties
@@ -752,8 +752,8 @@ struct HfTreeCreatorLcToPKPi {
752752
}
753753
};
754754

755-
fillTable(0, candidate.isSelLcToPKPi(), hfHelper.invMassLcToPKPi(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), RecoDecay::m(std::array{trackNeg.pVector(), trackPos2.pVector()}, std::array{o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPiPlus}));
756-
fillTable(1, candidate.isSelLcToPiKP(), hfHelper.invMassLcToPiKP(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), RecoDecay::m(std::array{trackNeg.pVector(), trackPos1.pVector()}, std::array{o2::constants::physics::MassKaonCharged, o2::constants::physics::MassPiPlus}));
755+
fillTable(0, candidate.isSelLcToPKPi(), hfHelper.invMassLcToPKPi(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), hfHelper.invMassKPiPairLcToPKPi(candidate));
756+
fillTable(1, candidate.isSelLcToPiKP(), hfHelper.invMassLcToPiKP(candidate), hfHelper.ctLc(candidate), hfHelper.yLc(candidate), hfHelper.eLc(candidate), hfHelper.invMassKPiPairLcToPiKP(candidate));
757757
}
758758
}
759759

0 commit comments

Comments
 (0)