From 2a8dcd2bd76fe62da08746f6250cf6b20e0e20ae Mon Sep 17 00:00:00 2001 From: marcellocosti Date: Thu, 24 Sep 2026 15:28:23 +0200 Subject: [PATCH 1/5] Correlated bkgs in derived data creators --- PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx | 11 ++++++----- .../TableProducer/derivedDataCreatorDplusToPiKPi.cxx | 7 ++++--- PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx | 7 ++++--- PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx | 7 ++++--- PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 7 ++++--- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 603316670a1..6d6c7fb4412 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -83,6 +83,7 @@ struct HfDerivedDataCreatorD0ToKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -106,7 +107,7 @@ struct HfDerivedDataCreatorD0ToKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesKfPerCollision = aod::hf_cand::collisionId; @@ -128,13 +129,13 @@ struct HfDerivedDataCreatorD0ToKPi { Partition candidatesMcMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; Partition candidatesMcKfMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition candidatesMcKfSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcKfSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcKfBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition candidatesMcMlSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition candidatesMcKfMlSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcKfMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcKfMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index 74da79ae04c..6459639d4c7 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -84,6 +84,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -103,7 +104,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -117,9 +118,9 @@ struct HfDerivedDataCreatorDplusToPiKPi { Partition candidatesMlAll = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); - Partition candidatesMcMlSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx index 165dcadd758..1a112c59e98 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx @@ -82,6 +82,7 @@ struct HfDerivedDataCreatorDsToKKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -101,7 +102,7 @@ struct HfDerivedDataCreatorDsToKKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -115,9 +116,9 @@ struct HfDerivedDataCreatorDsToKKPi { Partition candidatesMlAll = aod::hf_sel_candidate_ds::isSelDsToKKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_ds::isSelDsToKKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); - Partition candidatesMcMlSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index a69bdea3f2c..8b9cd1fd136 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -80,6 +80,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -99,7 +100,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -113,9 +114,9 @@ struct HfDerivedDataCreatorDstarToD0Pi { Partition candidatesMlAll = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; Partition candidatesMcMlAll = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); - Partition candidatesMcMlSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 7b37995e3a3..0f07f55a2e4 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -82,6 +82,7 @@ struct HfDerivedDataCreatorLcToPKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; + Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -101,7 +102,7 @@ struct HfDerivedDataCreatorLcToPKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1 || aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -115,9 +116,9 @@ struct HfDerivedDataCreatorLcToPKPi { Partition candidatesMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); - Partition candidatesMcMlSig = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); void init(InitContext const&) From df773a08b888d060b4219de90b5b92b0ec3cd8f0 Mon Sep 17 00:00:00 2001 From: marcellocosti Date: Thu, 24 Sep 2026 16:36:16 +0200 Subject: [PATCH 2/5] Remove matching for generated particles --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 4 ++++ PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx | 4 +++- PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 1091c00a0a2..d93ce6a0dbe 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -1053,6 +1053,7 @@ struct HfCandidateCreator3ProngExpressions { McCollisions const& mcCollisions, BCsInfo const&) { + LOG(info) << "Running MC matching for 3-prong candidates"; rowCandidateProng3->bindExternalIndices(&tracks); int indexRec = -1; @@ -1102,6 +1103,7 @@ struct HfCandidateCreator3ProngExpressions { } if (matchCorrelatedBackground) { + LOG(info) << "Matching correlated background candidates"; indexRec = -1; // Index of the matched reconstructed candidate constexpr int DepthMainMax = 2; // Depth for final state matching constexpr int DepthResoMax = 1; // Depth for resonant decay matching @@ -1357,11 +1359,13 @@ struct HfCandidateCreator3ProngExpressions { } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); + LOG(info) << "flagChannelMain: " << static_cast(flagChannelMain) << ", origin: " << static_cast(origin) << ", swapping: " << static_cast(swapping) << ", resonant channel: " << static_cast(flagChannelResonant); rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial); } else { if (std::abs(flagChannelMain) == DecayChannelMain::CDeuteronToDeKPi) { origin = RecoDecay::OriginType::Prompt; } + LOG(info) << "flagChannelMain: " << static_cast(flagChannelMain) << ", origin: " << static_cast(origin) << ", swapping: " << static_cast(swapping) << ", resonant channel: " << static_cast(flagChannelResonant); rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); } } diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 6d6c7fb4412..22e548095e1 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -107,7 +107,7 @@ struct HfDerivedDataCreatorD0ToKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; - Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); + Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesKfPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index 6459639d4c7..455b1123ed0 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -104,7 +104,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); + Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; @@ -243,6 +243,8 @@ struct HfDerivedDataCreatorDplusToPiKPi { TracksWPid const&, aod::BCs const&) { + LOG(info) << "IsMc:" << IsMc; + LOG(info) << "Processing candidates for collisions with size: " << collisions.size() << " and candidates with size: " << candidates.size(); // Fill collision properties if constexpr (IsMc) { if (confDerData.fillMcRCollId) { diff --git a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx index 1a112c59e98..2df7c6a2f3c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx @@ -102,7 +102,7 @@ struct HfDerivedDataCreatorDsToKKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); + Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index 8b9cd1fd136..062aa683387 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -100,7 +100,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; - Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); + Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 0f07f55a2e4..f632314c8d3 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -102,7 +102,7 @@ struct HfDerivedDataCreatorLcToPKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1 || aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1; - Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); + Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; From 28caba26578dab76e4a92d6a8e3989832d746dfc Mon Sep 17 00:00:00 2001 From: marcellocosti Date: Thu, 24 Sep 2026 16:37:43 +0200 Subject: [PATCH 3/5] Remove logs --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 4 ---- PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx | 2 -- 2 files changed, 6 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index d93ce6a0dbe..1091c00a0a2 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -1053,7 +1053,6 @@ struct HfCandidateCreator3ProngExpressions { McCollisions const& mcCollisions, BCsInfo const&) { - LOG(info) << "Running MC matching for 3-prong candidates"; rowCandidateProng3->bindExternalIndices(&tracks); int indexRec = -1; @@ -1103,7 +1102,6 @@ struct HfCandidateCreator3ProngExpressions { } if (matchCorrelatedBackground) { - LOG(info) << "Matching correlated background candidates"; indexRec = -1; // Index of the matched reconstructed candidate constexpr int DepthMainMax = 2; // Depth for final state matching constexpr int DepthResoMax = 1; // Depth for resonant decay matching @@ -1359,13 +1357,11 @@ struct HfCandidateCreator3ProngExpressions { } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); - LOG(info) << "flagChannelMain: " << static_cast(flagChannelMain) << ", origin: " << static_cast(origin) << ", swapping: " << static_cast(swapping) << ", resonant channel: " << static_cast(flagChannelResonant); rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial); } else { if (std::abs(flagChannelMain) == DecayChannelMain::CDeuteronToDeKPi) { origin = RecoDecay::OriginType::Prompt; } - LOG(info) << "flagChannelMain: " << static_cast(flagChannelMain) << ", origin: " << static_cast(origin) << ", swapping: " << static_cast(swapping) << ", resonant channel: " << static_cast(flagChannelResonant); rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); } } diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index 455b1123ed0..8c66199e876 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -243,8 +243,6 @@ struct HfDerivedDataCreatorDplusToPiKPi { TracksWPid const&, aod::BCs const&) { - LOG(info) << "IsMc:" << IsMc; - LOG(info) << "Processing candidates for collisions with size: " << collisions.size() << " and candidates with size: " << candidates.size(); // Fill collision properties if constexpr (IsMc) { if (confDerData.fillMcRCollId) { From 765a752a2013384a23ec595afeca4138cf9b7529 Mon Sep 17 00:00:00 2001 From: marcellocosti Date: Thu, 24 Sep 2026 16:39:02 +0200 Subject: [PATCH 4/5] Rename configurable --- PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx | 10 +++++----- PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx | 6 +++--- PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx | 6 +++--- PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx | 6 +++--- PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 22e548095e1..5dae5481a28 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -83,7 +83,7 @@ struct HfDerivedDataCreatorD0ToKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; + Configurable acceptCorrelatedBkgs{"acceptCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -129,13 +129,13 @@ struct HfDerivedDataCreatorD0ToKPi { Partition candidatesMcMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; Partition candidatesMcKfMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; // partitions for signal and background - Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition candidatesMcKfSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcKfSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcKfBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition candidatesMcKfMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcKfMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcKfMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index 8c66199e876..32241f02270 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -84,7 +84,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; + Configurable acceptCorrelatedBkgs{"acceptCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -118,9 +118,9 @@ struct HfDerivedDataCreatorDplusToPiKPi { Partition candidatesMlAll = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); - Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx index 2df7c6a2f3c..797bccf1861 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx @@ -82,7 +82,7 @@ struct HfDerivedDataCreatorDsToKKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; + Configurable acceptCorrelatedBkgs{"acceptCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -116,9 +116,9 @@ struct HfDerivedDataCreatorDsToKKPi { Partition candidatesMlAll = aod::hf_sel_candidate_ds::isSelDsToKKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_ds::isSelDsToKKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); - Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index 062aa683387..6be696a0d27 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -80,7 +80,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; + Configurable acceptCorrelatedBkgs{"acceptCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -114,9 +114,9 @@ struct HfDerivedDataCreatorDstarToD0Pi { Partition candidatesMlAll = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; Partition candidatesMcMlAll = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; // partitions for signal and background - Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); - Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); void init(InitContext const&) diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index f632314c8d3..30a066edc12 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -82,7 +82,7 @@ struct HfDerivedDataCreatorLcToPKPi { Configurable fillCandidateMl{"fillCandidateMl", true, "Fill candidate selection ML scores"}; Configurable fillCandidateId{"fillCandidateId", true, "Fill original indices from the candidate table"}; Configurable fillCandidateMc{"fillCandidateMc", true, "Fill candidate MC info"}; - Configurable fillCorrelatedBkgs{"fillCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; + Configurable acceptCorrelatedBkgs{"acceptCorrelatedBkgs", false, "Accept correlated background candidates in MC processing"}; // Parameters for production of training samples Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; @@ -116,9 +116,9 @@ struct HfDerivedDataCreatorLcToPKPi { Partition candidatesMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; Partition candidatesMcMlAll = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 0; // partitions for signal and background - Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); - Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (fillCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); + Partition candidatesMcMlSig = (nabs(aod::hf_cand_mc_flag::flagMcMatchRec)) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchRec != 0); Partition candidatesMcMlBkg = nabs(aod::hf_cand_mc_flag::flagMcMatchRec) != static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); void init(InitContext const&) From 5f593380a731abf492334cda47f9b30d1b5f7f80 Mon Sep 17 00:00:00 2001 From: marcellocosti Date: Fri, 25 Sep 2026 16:52:25 +0200 Subject: [PATCH 5/5] Add matching for generated --- PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx | 2 +- PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 5dae5481a28..6c8dd98f3c9 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -107,7 +107,7 @@ struct HfDerivedDataCreatorD0ToKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesKfPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index 32241f02270..b1cad301ba6 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -104,7 +104,7 @@ struct HfDerivedDataCreatorDplusToPiKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx index 797bccf1861..7ed944efb1c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDsToKKPi.cxx @@ -102,7 +102,7 @@ struct HfDerivedDataCreatorDsToKKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi & static_cast(BIT(aod::SelectionStep::RecoMl - 1))) != 0; // select candidates which passed all cuts at least up to RecoMl - 1 - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx index 6be696a0d27..5f20c81e4a5 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx @@ -100,7 +100,7 @@ struct HfDerivedDataCreatorDstarToD0Pi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_dstar::isSelDstarToD0Pi == true; - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId; diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx index 30a066edc12..d543b4605f0 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx @@ -102,7 +102,7 @@ struct HfDerivedDataCreatorLcToPKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1 || aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi); + Filter filterMcGenMatching = (nabs(aod::hf_cand_mc_flag::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi)) || (acceptCorrelatedBkgs && aod::hf_cand_mc_flag::flagMcMatchGen != 0); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesMcPerCollision = aod::hf_cand::collisionId;