From e1f4a7df285e2de5abf516b504d10bf373d129af Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Wed, 17 Jun 2026 15:51:19 +0200 Subject: [PATCH 1/4] Implement workaround to for check in MlResponse not compatible with fixed features --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index db69cb40b07..c39c3692659 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1693,6 +1693,15 @@ struct HfTrackIndexSkimCreator { const std::vector ptBinsMl{0., 1.e10}; const std::vector cutDirMl{o2::cuts_ml::CutDirection::CutGreater, o2::cuts_ml::CutDirection::CutSmaller, o2::cuts_ml::CutDirection::CutSmaller}; const std::array, kN3ProngDecaysUsedMlForHfFilters> thresholdMlScore3Prongs{config.thresholdMlScoreDplusToPiKPi, config.thresholdMlScoreLcToPiKP, config.thresholdMlScoreDsToPiKK, config.thresholdMlScoreXicToPiKP}; + const std::vector inputFeatures2Prongs = {"ptProng0", "dcaXyProng0", "dcaZProng0", "ptProng1", "dcaXyProng1", "dcaZProng1"}; + std::vector inputFeatures3Prongs = {"ptProng0", "dcaXyProng0", "dcaZProng0", "ptProng1", "dcaXyProng1", "dcaZProng1", "ptProng2", "dcaXyProng2", "dcaZProng2"}; + if (doprocess2And3ProngsWithPvRefitWithPidForHfFiltersBdt || doprocess2And3ProngsNoPvRefitWithPidForHfFiltersBdt) { + inputFeatures3Prongs.push_back("tpcNSigmaPrProng0"); + inputFeatures3Prongs.push_back("tpcNSigmaPrProng2"); + inputFeatures3Prongs.push_back("tpcNSigmaPiProng0"); + inputFeatures3Prongs.push_back("tpcNSigmaPiProng2"); + inputFeatures3Prongs.push_back("tpcNSigmaKaProng1"); + } // initialise 2-prong ML response hfMlResponse2Prongs.configure(ptBinsMl, config.thresholdMlScoreD0ToKPi, cutDirMl, 3); @@ -1702,6 +1711,7 @@ struct HfTrackIndexSkimCreator { } else { hfMlResponse2Prongs.setModelPathsLocal(onnxFileNames2Prongs); } + hfMlResponse2Prongs.cacheInputFeaturesIndices(inputFeatures2Prongs); hfMlResponse2Prongs.init(); // initialise 3-prong ML responses @@ -1717,6 +1727,7 @@ struct HfTrackIndexSkimCreator { } else { hfMlResponse3Prongs[iDecay3P].setModelPathsLocal(onnxFileNames3Prongs[iDecay3P]); } + hfMlResponse3Prongs.cacheInputFeaturesIndices(inputFeatures2Prongs); hfMlResponse3Prongs[iDecay3P].init(); } } From 03a61999d2dc2b798eb803a6e2f81b1e7872551b Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Wed, 17 Jun 2026 15:51:53 +0200 Subject: [PATCH 2/4] FIx typo --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index c39c3692659..74483b757a4 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1727,7 +1727,7 @@ struct HfTrackIndexSkimCreator { } else { hfMlResponse3Prongs[iDecay3P].setModelPathsLocal(onnxFileNames3Prongs[iDecay3P]); } - hfMlResponse3Prongs.cacheInputFeaturesIndices(inputFeatures2Prongs); + hfMlResponse3Prongs.cacheInputFeaturesIndices(inputFeatures3Prongs); hfMlResponse3Prongs[iDecay3P].init(); } } From 7cb0208a3a1e89d6844323e7858283520df253cc Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Wed, 17 Jun 2026 15:56:54 +0200 Subject: [PATCH 3/4] Fix typo --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 74483b757a4..116821f9bb3 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1727,7 +1727,7 @@ struct HfTrackIndexSkimCreator { } else { hfMlResponse3Prongs[iDecay3P].setModelPathsLocal(onnxFileNames3Prongs[iDecay3P]); } - hfMlResponse3Prongs.cacheInputFeaturesIndices(inputFeatures3Prongs); + hfMlResponse3Prongs[iDecay3P].cacheInputFeaturesIndices(inputFeatures3Prongs); hfMlResponse3Prongs[iDecay3P].init(); } } From d152b69675dd6147332844cc0b8e099c3c9dc7c8 Mon Sep 17 00:00:00 2001 From: Fabrizio Grosa Date: Wed, 17 Jun 2026 16:19:39 +0200 Subject: [PATCH 4/4] Fix caching for different 3-prong species --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 116821f9bb3..0e93c3e1337 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1694,14 +1694,8 @@ struct HfTrackIndexSkimCreator { const std::vector cutDirMl{o2::cuts_ml::CutDirection::CutGreater, o2::cuts_ml::CutDirection::CutSmaller, o2::cuts_ml::CutDirection::CutSmaller}; const std::array, kN3ProngDecaysUsedMlForHfFilters> thresholdMlScore3Prongs{config.thresholdMlScoreDplusToPiKPi, config.thresholdMlScoreLcToPiKP, config.thresholdMlScoreDsToPiKK, config.thresholdMlScoreXicToPiKP}; const std::vector inputFeatures2Prongs = {"ptProng0", "dcaXyProng0", "dcaZProng0", "ptProng1", "dcaXyProng1", "dcaZProng1"}; - std::vector inputFeatures3Prongs = {"ptProng0", "dcaXyProng0", "dcaZProng0", "ptProng1", "dcaXyProng1", "dcaZProng1", "ptProng2", "dcaXyProng2", "dcaZProng2"}; - if (doprocess2And3ProngsWithPvRefitWithPidForHfFiltersBdt || doprocess2And3ProngsNoPvRefitWithPidForHfFiltersBdt) { - inputFeatures3Prongs.push_back("tpcNSigmaPrProng0"); - inputFeatures3Prongs.push_back("tpcNSigmaPrProng2"); - inputFeatures3Prongs.push_back("tpcNSigmaPiProng0"); - inputFeatures3Prongs.push_back("tpcNSigmaPiProng2"); - inputFeatures3Prongs.push_back("tpcNSigmaKaProng1"); - } + const std::vector inputFeatures3Prongs = {"ptProng0", "dcaXyProng0", "dcaZProng0", "ptProng1", "dcaXyProng1", "dcaZProng1", "ptProng2", "dcaXyProng2", "dcaZProng2"}; + const std::vector inputFeatures3ProngsWithPid = {"ptProng0", "dcaXyProng0", "dcaZProng0", "ptProng1", "dcaXyProng1", "dcaZProng1", "ptProng2", "dcaXyProng2", "dcaZProng2", "tpcNSigmaPrProng0", "tpcNSigmaPrProng2", "tpcNSigmaPiProng0", "tpcNSigmaPiProng2", "tpcNSigmaKaProng1"}; // initialise 2-prong ML response hfMlResponse2Prongs.configure(ptBinsMl, config.thresholdMlScoreD0ToKPi, cutDirMl, 3); @@ -1727,7 +1721,11 @@ struct HfTrackIndexSkimCreator { } else { hfMlResponse3Prongs[iDecay3P].setModelPathsLocal(onnxFileNames3Prongs[iDecay3P]); } - hfMlResponse3Prongs[iDecay3P].cacheInputFeaturesIndices(inputFeatures3Prongs); + if ((doprocess2And3ProngsWithPvRefitWithPidForHfFiltersBdt || doprocess2And3ProngsNoPvRefitWithPidForHfFiltersBdt) && iDecay3P == aod::hf_cand_3prong::DecayType::LcToPKPi) { + hfMlResponse3Prongs[iDecay3P].cacheInputFeaturesIndices(inputFeatures3ProngsWithPid); + } else { + hfMlResponse3Prongs[iDecay3P].cacheInputFeaturesIndices(inputFeatures3Prongs); + } hfMlResponse3Prongs[iDecay3P].init(); } }