From 99dfc88492ac5171de9e3521e2889adb04091f19 Mon Sep 17 00:00:00 2001 From: Zhihe Han Date: Fri, 20 Nov 2026 21:18:34 +0800 Subject: [PATCH] [PWGHF] Add the D* - V0 Monte Carlo process to the charm-hadron femto task The charm-hadron - V0 femtoscopy task provides data-level process functions for the Lc, D+, D0 and D* channels, but only the D+ channel has a Monte Carlo counterpart. As a consequence the D* - K0S / D* - Lambda correlation cannot be analysed on MC at reconstruction level, which is needed for the corresponding efficiency and feed-down studies. Add processMcDstarV0, mirroring the existing processMcDplusV0 and the data-level processDataDstarV0: it uses the MC collision and particle tables, the MC D* candidate partition and the MC versions of the fillTables / doSameEvent / runMixing helpers, all of which were already in place. The MC process is disabled by default, so no existing workflow changes behaviour. --- .../Tasks/taskCharmHadronsV0FemtoDream.cxx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx index fb6dfd6ceab..9e6dfb64f99 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx @@ -994,6 +994,43 @@ struct HfTaskCharmHadronsV0FemtoDream { runMixing(cols, parts, partitionMcCharmHadron3Prong); } PROCESS_SWITCH(HfTaskCharmHadronsV0FemtoDream, processMcDplusV0, "Enable processing DplusToPiKPi and V0 correlation for Monte Carlo", false); + + void processMcDstarV0(FilteredMcCollisions const& cols, + FDMcV0Particles const& parts, + o2::aod::FDMCParticles const&, + o2::aod::FDExtMCParticles const&, + FilteredCharmMcCandDstars const& candidates, + o2::aod::V0Datas const& fullV0s) + { + rowFemtoResultCharmDstar.reserve(candidates.size() + 1); + + for (const auto& col : cols) { + eventHisto.fillQA(col); + auto sliceMcCharmHad = partitionMcCharmHadronDstar->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + if (fillTableWithCharm.value && sliceMcCharmHad.size() == 0) { + continue; + } + if (v0Sel.pdgCodeV0 == kLambda0) { + auto sliceMcV0 = partitionMcLambda->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + fillTables(col, sliceMcV0, sliceMcCharmHad, parts, fullV0s); + if (sliceMcCharmHad.size() > 0 && sliceMcV0.size() > 0) { + doSameEvent(sliceMcCharmHad, sliceMcV0, parts, col); + } + + } else if (v0Sel.pdgCodeV0 == kK0Short) { + auto sliceMcV0 = partitionMcK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + fillTables(col, sliceMcV0, sliceMcCharmHad, parts, fullV0s); + + if (sliceMcCharmHad.size() > 0 && sliceMcV0.size() > 0) { + doSameEvent(sliceMcCharmHad, sliceMcV0, parts, col); + } + } else { + LOG(fatal) << "Unsupported V0 PDG: " << v0Sel.pdgCodeV0 << " (allowed: 3122, 310)"; + } + } + runMixing(cols, parts, partitionMcCharmHadronDstar); + } + PROCESS_SWITCH(HfTaskCharmHadronsV0FemtoDream, processMcDstarV0, "Enable processing DstarToD0Pi and V0 correlation for Monte Carlo", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)