From b5d8204c46fa9a0636f0004aee9ed2c7df660185 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Mon, 13 Apr 2026 11:47:53 +0200 Subject: [PATCH 1/4] Add filter for Xic0 MC candidates --- PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index e1e8a27e38e..564be0d1b62 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -38,6 +38,7 @@ using namespace o2; using namespace o2::framework; +using namespace o2::framework::expressions; namespace o2::aod { @@ -134,7 +135,7 @@ DECLARE_SOA_TABLE(HfKfXicFulls, "AOD", "HFKFXICFULL", } // namespace o2::aod /// Writes the full information in an output TTree -struct HfTreeCreatorXic0ToXiPiKf { +struct TreeCreatorXic0ToXiPiKf { Produces rowKfCandidate; @@ -145,6 +146,9 @@ struct HfTreeCreatorXic0ToXiPiKf { using MyEventTableWithFT0C = soa::Join; using MyEventTableWithFT0M = soa::Join; using MyEventTableWithNTracksPV = soa::Join; + using MyMcCandidates = soa::Filtered>; + + Filter mcFilter = aod::hf_cand_mc_flag::originMcRec == 1; HistogramRegistry registry{"registry"}; // for QA of selections @@ -276,7 +280,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); void processKfMcXic0(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -286,7 +290,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); void processKfMCWithFT0C(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -296,7 +300,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); void processKfMCWithFT0M(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { @@ -306,7 +310,7 @@ struct HfTreeCreatorXic0ToXiPiKf { PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); void processMCLiteWithNTracksPV(MyTrackTable const&, - soa::Join const& candidates) + MyMcCandidates const& candidates) { rowKfCandidate.reserve(candidates.size()); for (const auto& candidate : candidates) { From 3f2e86a719eefcb3210423c8a7eddd247d7d88e9 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Mon, 13 Apr 2026 14:38:59 +0200 Subject: [PATCH 2/4] fix bugs --- .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index 564be0d1b62..389d13d03e6 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -148,7 +148,7 @@ struct TreeCreatorXic0ToXiPiKf { using MyEventTableWithNTracksPV = soa::Join; using MyMcCandidates = soa::Filtered>; - Filter mcFilter = aod::hf_cand_mc_flag::originMcRec == 1; + Filter mcFilter = aod::hf_cand_mc_flag::originMcRec == RecoDecay::OriginType::NonPrompt || aod::hf_cand_mc_flag::originMcRec == RecoDecay::OriginType::Prompt; HistogramRegistry registry{"registry"}; // for QA of selections @@ -247,7 +247,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfData, "Process KF data", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfData, "Process KF data", false); void processKfDataWithFT0C(MyTrackTable const&, MyEventTableWithFT0C const&, soa::Join const& candidates) @@ -257,7 +257,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfDataWithFT0C, "Process KF data with FT0C", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfDataWithFT0C, "Process KF data with FT0C", false); void processKfDataWithFT0M(MyTrackTable const&, MyEventTableWithFT0M const&, soa::Join const& candidates) @@ -267,7 +267,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfDataWithFT0M, "Process KF data with FT0M", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfDataWithFT0M, "Process KF data with FT0M", false); void processDataLiteWithNTracksPV(MyTrackTable const&, soa::Join const& candidates) @@ -277,7 +277,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); void processKfMcXic0(MyTrackTable const&, MyMcCandidates const& candidates) @@ -287,7 +287,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); void processKfMCWithFT0C(MyTrackTable const&, MyMcCandidates const& candidates) @@ -297,7 +297,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); void processKfMCWithFT0M(MyTrackTable const&, MyMcCandidates const& candidates) @@ -307,7 +307,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); void processMCLiteWithNTracksPV(MyTrackTable const&, MyMcCandidates const& candidates) @@ -317,11 +317,11 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processMCLiteWithNTracksPV, "Process MC with information for xic0 at Ntrack", false); + PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processMCLiteWithNTracksPV, "Process MC with information for xic0 at Ntrack", false); }; // end of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From 91cb6de9df8c547e51a2cea899c44824b4f3c3c5 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Mon, 13 Apr 2026 16:44:03 +0200 Subject: [PATCH 3/4] fix bugs --- PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index 389d13d03e6..0078f9cdeaa 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -148,8 +148,7 @@ struct TreeCreatorXic0ToXiPiKf { using MyEventTableWithNTracksPV = soa::Join; using MyMcCandidates = soa::Filtered>; - Filter mcFilter = aod::hf_cand_mc_flag::originMcRec == RecoDecay::OriginType::NonPrompt || aod::hf_cand_mc_flag::originMcRec == RecoDecay::OriginType::Prompt; - + Filter mcFilter = (aod::hf_cand_mc_flag::originMcRec == static_cast(RecoDecay::OriginType::NonPrompt)) || (aod::hf_cand_mc_flag::originMcRec == static_cast(RecoDecay::OriginType::Prompt)); HistogramRegistry registry{"registry"}; // for QA of selections void init(InitContext const&) From 9dee4a184234c1d131816874fd6f1df28de71b40 Mon Sep 17 00:00:00 2001 From: Ran Tu Date: Mon, 13 Apr 2026 16:52:51 +0200 Subject: [PATCH 4/4] fix bugs --- .../TableProducer/treeCreatorXic0ToXiPiKf.cxx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx index 0078f9cdeaa..d4ab4225cdb 100644 --- a/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx +++ b/PWGHF/TableProducer/treeCreatorXic0ToXiPiKf.cxx @@ -135,7 +135,7 @@ DECLARE_SOA_TABLE(HfKfXicFulls, "AOD", "HFKFXICFULL", } // namespace o2::aod /// Writes the full information in an output TTree -struct TreeCreatorXic0ToXiPiKf { +struct HfTreeCreatorXic0ToXiPiKf { Produces rowKfCandidate; @@ -246,7 +246,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfData, "Process KF data", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfData, "Process KF data", false); void processKfDataWithFT0C(MyTrackTable const&, MyEventTableWithFT0C const&, soa::Join const& candidates) @@ -256,7 +256,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfDataWithFT0C, "Process KF data with FT0C", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfDataWithFT0C, "Process KF data with FT0C", false); void processKfDataWithFT0M(MyTrackTable const&, MyEventTableWithFT0M const&, soa::Join const& candidates) @@ -266,7 +266,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfDataWithFT0M, "Process KF data with FT0M", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfDataWithFT0M, "Process KF data with FT0M", false); void processDataLiteWithNTracksPV(MyTrackTable const&, soa::Join const& candidates) @@ -276,7 +276,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, -7, -7, RecoDecay::OriginType::None, false); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processDataLiteWithNTracksPV, "Process KF data with Ntracks", false); void processKfMcXic0(MyTrackTable const&, MyMcCandidates const& candidates) @@ -286,7 +286,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMcXic0, "Process MC with information for xic0", false); void processKfMCWithFT0C(MyTrackTable const&, MyMcCandidates const& candidates) @@ -296,7 +296,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0C, "Process MC with information for xic0 at FT0C", false); void processKfMCWithFT0M(MyTrackTable const&, MyMcCandidates const& candidates) @@ -306,7 +306,7 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processKfMCWithFT0M, "Process MC with information for xic0 at FT0M", false); void processMCLiteWithNTracksPV(MyTrackTable const&, MyMcCandidates const& candidates) @@ -316,11 +316,11 @@ struct TreeCreatorXic0ToXiPiKf { fillKfCandidate(candidate, candidate.flagMcMatchRec(), candidate.debugMcRec(), candidate.originMcRec(), candidate.collisionMatched()); } } - PROCESS_SWITCH(TreeCreatorXic0ToXiPiKf, processMCLiteWithNTracksPV, "Process MC with information for xic0 at Ntrack", false); + PROCESS_SWITCH(HfTreeCreatorXic0ToXiPiKf, processMCLiteWithNTracksPV, "Process MC with information for xic0 at Ntrack", false); }; // end of struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; }