Skip to content

Commit 5699df7

Browse files
authored
[PWGHF] Bugfix: do not write KF minv into non-KF tree (#12906)
1 parent 58fab41 commit 5699df7

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

PWGHF/TableProducer/treeCreatorLcToPKPi.cxx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -565,17 +565,11 @@ struct HfTreeCreatorLcToPKPi {
565565
/// \brief function to evaluate invariant mass of the Lc candidate and KPi pair
566566
/// \param candidate candidate instance
567567
/// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
568-
template <int reconstructionType, typename CandType>
569-
std::pair<float, float> evaluateInvariantMasses(CandType const& candidate, int candFlag)
568+
template <typename CandType>
569+
std::pair<float, float> evaluateInvariantMassesDCAFitter(CandType const& candidate, int candFlag)
570570
{
571-
float invMass, invMassKPi;
572-
if constexpr (reconstructionType == aod::hf_cand::VertexerType::DCAFitter) {
573-
invMass = candFlag == 0 ? hfHelper.invMassLcToPKPi(candidate) : hfHelper.invMassLcToPiKP(candidate);
574-
invMassKPi = candFlag == 0 ? hfHelper.invMassKPiPairLcToPKPi(candidate) : hfHelper.invMassKPiPairLcToPiKP(candidate);
575-
} else {
576-
invMass = candFlag == 0 ? candidate.kfMassPKPi() : candidate.kfMassPiKP();
577-
invMassKPi = candFlag == 0 ? candidate.kfMassKPi() : candidate.kfMassPiK();
578-
}
571+
const float invMass = candFlag == 0 ? hfHelper.invMassLcToPKPi(candidate) : hfHelper.invMassLcToPiKP(candidate);
572+
const float invMassKPi = candFlag == 0 ? hfHelper.invMassKPiPairLcToPKPi(candidate) : hfHelper.invMassKPiPairLcToPiKP(candidate);
579573

580574
return std::make_pair(invMass, invMassKPi);
581575
}
@@ -612,10 +606,10 @@ struct HfTreeCreatorLcToPKPi {
612606
/// \param candidate candidate instance
613607
/// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate
614608
/// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
615-
template <bool isMc, int reconstructionType, typename CandType>
609+
template <bool isMc, typename CandType>
616610
void fillLiteTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
617611
{
618-
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses<reconstructionType>(candidate, candFlag);
612+
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag);
619613
const float functionCt = hfHelper.ctLc(candidate);
620614
const float functionY = hfHelper.yLc(candidate);
621615

@@ -697,10 +691,10 @@ struct HfTreeCreatorLcToPKPi {
697691
/// \param candidate candidate instance
698692
/// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate
699693
/// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
700-
template <bool isMc, int reconstructionType, typename CandType>
694+
template <bool isMc, typename CandType>
701695
void fillFullTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag)
702696
{
703-
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses<reconstructionType>(candidate, candFlag);
697+
auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag);
704698
const float functionCt = hfHelper.ctLc(candidate);
705699
const float functionY = hfHelper.yLc(candidate);
706700
const float functionE = hfHelper.eLc(candidate);
@@ -948,9 +942,9 @@ struct HfTreeCreatorLcToPKPi {
948942
const bool notSkippedBkg = isMcCandidateSignal || candidate.pt() > downSampleBkgPtMax || pseudoRndm < downSampleBkgFactor;
949943
if (passSelection && notSkippedBkg && (keepAll || (keepOnlySignalMc && isMcCandidateSignal) || (keepOnlyBkg && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) {
950944
if (fillCandidateLiteTable) {
951-
fillLiteTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
945+
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
952946
} else {
953-
fillFullTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
947+
fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
954948
}
955949

956950
if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) {
@@ -1130,9 +1124,9 @@ struct HfTreeCreatorLcToPKPi {
11301124
const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP();
11311125
if (functionSelection >= selectionFlagLc && (candidate.pt() > downSampleBkgPtMax || (pseudoRndm < downSampleBkgFactor && candidate.pt() < downSampleBkgPtMax))) {
11321126
if (fillCandidateLiteTable) {
1133-
fillLiteTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
1127+
fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
11341128
} else {
1135-
fillFullTable<IsMc, reconstructionType>(candidate, candidateMlScore, candFlag);
1129+
fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
11361130
}
11371131

11381132
if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) {

0 commit comments

Comments
 (0)