@@ -565,11 +565,17 @@ 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 <typename CandType>
568+ template <int reconstructionType, typename CandType>
569569 std::pair<float , float > evaluateInvariantMasses (CandType const & candidate, int candFlag)
570570 {
571- const float invMass = candFlag == 0 ? hfHelper.invMassLcToPKPi (candidate) : hfHelper.invMassLcToPiKP (candidate);
572- const float invMassKPi = candFlag == 0 ? hfHelper.invMassKPiPairLcToPKPi (candidate) : hfHelper.invMassKPiPairLcToPiKP (candidate);
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+ }
573579
574580 return std::make_pair (invMass, invMassKPi);
575581 }
@@ -606,10 +612,10 @@ struct HfTreeCreatorLcToPKPi {
606612 // / \param candidate candidate instance
607613 // / \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate
608614 // / \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
609- template <bool isMc, typename CandType>
615+ template <bool isMc, int reconstructionType, typename CandType>
610616 void fillLiteTable (CandType const & candidate, aod::HfMlLcToPKPi::iterator const & candidateMlScore, int candFlag)
611617 {
612- auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses (candidate, candFlag);
618+ auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses<reconstructionType> (candidate, candFlag);
613619 const float functionCt = hfHelper.ctLc (candidate);
614620 const float functionY = hfHelper.yLc (candidate);
615621
@@ -691,10 +697,10 @@ struct HfTreeCreatorLcToPKPi {
691697 // / \param candidate candidate instance
692698 // / \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate
693699 // / \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used
694- template <bool isMc, typename CandType>
700+ template <bool isMc, int reconstructionType, typename CandType>
695701 void fillFullTable (CandType const & candidate, aod::HfMlLcToPKPi::iterator const & candidateMlScore, int candFlag)
696702 {
697- auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses (candidate, candFlag);
703+ auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMasses<reconstructionType> (candidate, candFlag);
698704 const float functionCt = hfHelper.ctLc (candidate);
699705 const float functionY = hfHelper.yLc (candidate);
700706 const float functionE = hfHelper.eLc (candidate);
@@ -942,9 +948,9 @@ struct HfTreeCreatorLcToPKPi {
942948 const bool notSkippedBkg = isMcCandidateSignal || candidate.pt () > downSampleBkgPtMax || pseudoRndm < downSampleBkgFactor;
943949 if (passSelection && notSkippedBkg && (keepAll || (keepOnlySignalMc && isMcCandidateSignal) || (keepOnlyBkg && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) {
944950 if (fillCandidateLiteTable) {
945- fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
951+ fillLiteTable<IsMc, reconstructionType >(candidate, candidateMlScore, candFlag);
946952 } else {
947- fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
953+ fillFullTable<IsMc, reconstructionType >(candidate, candidateMlScore, candFlag);
948954 }
949955
950956 if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) {
@@ -1124,9 +1130,9 @@ struct HfTreeCreatorLcToPKPi {
11241130 const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi () : candidate.isSelLcToPiKP ();
11251131 if (functionSelection >= selectionFlagLc && (candidate.pt () > downSampleBkgPtMax || (pseudoRndm < downSampleBkgFactor && candidate.pt () < downSampleBkgPtMax))) {
11261132 if (fillCandidateLiteTable) {
1127- fillLiteTable<IsMc>(candidate, candidateMlScore, candFlag);
1133+ fillLiteTable<IsMc, reconstructionType >(candidate, candidateMlScore, candFlag);
11281134 } else {
1129- fillFullTable<IsMc>(candidate, candidateMlScore, candFlag);
1135+ fillFullTable<IsMc, reconstructionType >(candidate, candidateMlScore, candFlag);
11301136 }
11311137
11321138 if constexpr (reconstructionType == aod::hf_cand::VertexerType::KfParticle) {
0 commit comments