diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 51112ffe161..48aa83d6e6b 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -262,7 +262,8 @@ DECLARE_SOA_TABLE(HfCandLcLites, "AOD", "HFCANDLCLITE", full::MassKPi, full::MlScoreFirstClass, full::MlScoreSecondClass, - full::MlScoreThirdClass); + full::MlScoreThirdClass, + full::CentFT0C); DECLARE_SOA_TABLE(HfCollIdLCLite, "AOD", "HFCOLLIDLCLITE", full::CollisionId); @@ -343,7 +344,8 @@ DECLARE_SOA_TABLE(HfCandLcFulls, "AOD", "HFCANDLCFULL", full::MassKPi, full::MlScoreFirstClass, full::MlScoreSecondClass, - full::MlScoreThirdClass); + full::MlScoreThirdClass, + full::CentFT0C); DECLARE_SOA_TABLE(HfCandLcFullEvs, "AOD", "HFCANDLCFULLEV", full::CollisionId, @@ -607,8 +609,8 @@ struct HfTreeCreatorLcToPKPi { /// \param candidate candidate instance /// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate /// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used - template - void fillLiteTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag) + template + void fillLiteTable(CandType const& candidate, CollType const& collision, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag) { auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag); const float functionCt = HfHelper::ctLc(candidate); @@ -634,6 +636,11 @@ struct HfTreeCreatorLcToPKPi { assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag); } + float centFT0C = -1.f; + if constexpr (UseCentrality) { + centFT0C = collision.centFT0C(); + } + rowCandidateLite( candidate.posX(), candidate.posY(), @@ -681,7 +688,8 @@ struct HfTreeCreatorLcToPKPi { functionInvMassKPi, mlScoreFirstClass, mlScoreSecondClass, - mlScoreThirdClass); + mlScoreThirdClass, + centFT0C); if (fillCollIdTable) { /// save also candidate collision indices @@ -693,8 +701,8 @@ struct HfTreeCreatorLcToPKPi { /// \param candidate candidate instance /// \param candidateMlScore instance of handler of vectors with ML scores associated with the current candidate /// \param candFlag flag indicating if PKPi (0) or PiKP (1) hypothesis is used - template - void fillFullTable(CandType const& candidate, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag) + template + void fillFullTable(CandType const& candidate, CollType const& collision, aod::HfMlLcToPKPi::iterator const& candidateMlScore, int candFlag) { auto [functionInvMass, functionInvMassKPi] = evaluateInvariantMassesDCAFitter(candidate, candFlag); const float functionCt = HfHelper::ctLc(candidate); @@ -721,6 +729,11 @@ struct HfTreeCreatorLcToPKPi { assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag); } + float centFT0C = -1.f; + if constexpr (UseCentrality) { + centFT0C = collision.centFT0C(); + } + rowCandidateFull( candidate.collisionId(), candidate.posX(), @@ -797,7 +810,8 @@ struct HfTreeCreatorLcToPKPi { functionInvMassKPi, mlScoreFirstClass, mlScoreSecondClass, - mlScoreThirdClass); + mlScoreThirdClass, + centFT0C); } /// \brief function to fill lite table @@ -944,9 +958,9 @@ struct HfTreeCreatorLcToPKPi { const bool notSkippedBkg = isMcCandidateSignal || candidate.pt() > downSampleBkgPtMax || pseudoRndm < downSampleBkgFactor; if (passSelection && notSkippedBkg && (keepAll || (keepSignalMc && isMcCandidateSignal) || (keepBkgMc && !isMcCandidateSignal) || (keepCorrBkgMC && isCorrBkg))) { if (fillCandidateLiteTable) { - fillLiteTable(candidate, candidateMlScore, candFlag); + fillLiteTable(candidate, collision, candidateMlScore, candFlag); } else { - fillFullTable(candidate, candidateMlScore, candFlag); + fillFullTable(candidate, collision, candidateMlScore, candFlag); } if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) { @@ -1126,9 +1140,9 @@ struct HfTreeCreatorLcToPKPi { const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP(); if (functionSelection >= selectionFlagLc && (candidate.pt() > downSampleBkgPtMax || (pseudoRndm < downSampleBkgFactor && candidate.pt() < downSampleBkgPtMax))) { if (fillCandidateLiteTable) { - fillLiteTable(candidate, candidateMlScore, candFlag); + fillLiteTable(candidate, collision, candidateMlScore, candFlag); } else { - fillFullTable(candidate, candidateMlScore, candFlag); + fillFullTable(candidate, collision, candidateMlScore, candFlag); } if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {