From d8ef586a36908db6a696f225565110fa456e2662 Mon Sep 17 00:00:00 2001 From: GiuliaRusso02 Date: Thu, 21 May 2026 19:13:05 +0200 Subject: [PATCH 1/2] [PWGHF] Add centrality branch to Lc candidate tree --- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 38 ++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 51112ffe161..7d53bd71418 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); @@ -633,6 +635,11 @@ struct HfTreeCreatorLcToPKPi { if (applyMl) { assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag); } + + float centFT0C = -1.f; + if constexpr (UseCentrality) { + centFT0C = collision.centFT0C(); + } rowCandidateLite( candidate.posX(), @@ -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); @@ -720,6 +728,11 @@ struct HfTreeCreatorLcToPKPi { if (applyMl) { assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag); } + + float centFT0C = -1.f; + if constexpr (UseCentrality) { + centFT0C = collision.centFT0C(); + } rowCandidateFull( candidate.collisionId(), @@ -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) { From 4c29c81baf0f332becebe41844e766bb14fb3e01 Mon Sep 17 00:00:00 2001 From: GiuliaRusso02 Date: Thu, 21 May 2026 19:30:06 +0200 Subject: [PATCH 2/2] [PWGHF] Fix clang-format and whitespace --- PWGHF/TableProducer/treeCreatorLcToPKPi.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx index 7d53bd71418..48aa83d6e6b 100644 --- a/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorLcToPKPi.cxx @@ -263,7 +263,7 @@ DECLARE_SOA_TABLE(HfCandLcLites, "AOD", "HFCANDLCLITE", full::MlScoreFirstClass, full::MlScoreSecondClass, full::MlScoreThirdClass, - full::CentFT0C); + full::CentFT0C); DECLARE_SOA_TABLE(HfCollIdLCLite, "AOD", "HFCOLLIDLCLITE", full::CollisionId); @@ -635,7 +635,7 @@ struct HfTreeCreatorLcToPKPi { if (applyMl) { assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag); } - + float centFT0C = -1.f; if constexpr (UseCentrality) { centFT0C = collision.centFT0C(); @@ -728,7 +728,7 @@ struct HfTreeCreatorLcToPKPi { if (applyMl) { assignMlScores(candidateMlScore, mlScoreFirstClass, mlScoreSecondClass, mlScoreThirdClass, candFlag); } - + float centFT0C = -1.f; if constexpr (UseCentrality) { centFT0C = collision.centFT0C();