From b51d58c58970667e44c1fcfd49c0f7e4366cfb3d Mon Sep 17 00:00:00 2001 From: Zhihe Han Date: Thu, 29 Oct 2026 11:40:38 +0800 Subject: [PATCH 1/2] [PWGHF] Store K0s DCA to PV and V0 MC origin in FDHfV0 --- PWGCF/DataModel/FemtoDerived.h | 7 ++- .../Tasks/taskCharmHadronsV0FemtoDream.cxx | 53 +++++++++++++------ 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/PWGCF/DataModel/FemtoDerived.h b/PWGCF/DataModel/FemtoDerived.h index cac62250bbe..e4187d8abd4 100644 --- a/PWGCF/DataModel/FemtoDerived.h +++ b/PWGCF/DataModel/FemtoDerived.h @@ -324,6 +324,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, RecoDecayPtEtaPhi::pVector(pt1, eta1, phi1), RecoDecayPtEtaPhi::pVector(pt2, eta2, phi2))); }); //! Eta distribution of charm hadron +DECLARE_SOA_COLUMN(K0sDcaToPv, k0sDcaToPv, float); //! DCA of the K0s candidate to the primary vertex (cm) +DECLARE_SOA_COLUMN(OriginMcV0, originMcV0, int); //! MC truth origin of the V0 candidate, see ParticleOriginMCTruth + } // namespace fdhf namespace fdhf_2prong @@ -633,7 +636,9 @@ DECLARE_SOA_TABLE(FDHfV0, "AOD", "FDHFV0", //! table to store results for HF fem track::TPCNClsFindable, femtodreamparticle::TPCNClsCrossedRows, femtodreamparticle::TPCNSigmaPr, - femtodreamparticle::TOFNSigmaPr); + femtodreamparticle::TOFNSigmaPr, + fdhf::K0sDcaToPv, + fdhf::OriginMcV0); DECLARE_SOA_TABLE(FDHfColl, "AOD", "FDHFCOLL", //! table to store results for HF femtoscopy fdhf::GIndexCol, diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx index 29538febfce..fb6dfd6ceab 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx @@ -22,6 +22,7 @@ #include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" #include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" #include "PWGHF/Core/DecayChannels.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" #include #include @@ -617,7 +618,8 @@ struct HfTaskCharmHadronsV0FemtoDream { void fillTables(const CollType& col, const V0Type& sliceV01, const CandType& sliceCharmHad, - const FDParticles& femtoParts) + const FDParticles& femtoParts, + o2::aod::V0Datas const& fullV0s) { int64_t timeStamp = -999; @@ -707,8 +709,17 @@ struct HfTaskCharmHadronsV0FemtoDream { } std::vector childIds = {part.childrenIds()[0], part.childrenIds()[1]}; timeStamp = part.timeStamp(); + + int originMcV0 = -1; // MC truth origin of the V0 candidate + if constexpr (IsMc) { + if (part.has_fdMCParticle()) { + originMcV0 = static_cast(part.fdMCParticle().partOriginMCTruth()); + } + } + float tpcNSigma = 999.f; float tofNSigma = 999.f; + float k0sDcaToPv = -999.f; // DCA of the K0s candidate to the primary vertex switch (v0Sel.pdgCodeV0.value) { case kLambda0: tpcNSigma = posChild.tpcNSigmaPr(); // todo: add neg case @@ -717,6 +728,7 @@ struct HfTaskCharmHadronsV0FemtoDream { case kK0Short: tpcNSigma = posChild.tpcNSigmaPi(); // todo: add neg case tofNSigma = posChild.tofNSigmaPi(); // todo: add neg case + k0sDcaToPv = fullV0s.iteratorAt(part.trackId()).dcav0topv(); break; default: LOG(fatal) << "Unhandled PDG code in PID switch: " @@ -738,7 +750,9 @@ struct HfTaskCharmHadronsV0FemtoDream { posChild.tpcNClsFindable(), posChild.tpcNClsCrossedRows(), tpcNSigma, - tofNSigma); + tofNSigma, + k0sDcaToPv, + originMcV0); } // ---- Fill Collision Table ---- @@ -806,7 +820,8 @@ struct HfTaskCharmHadronsV0FemtoDream { void processDataLcV0(FilteredCollisions const& cols, FDV0Particles const& parts, - FilteredCharmCand3Prongs const& candidates) + FilteredCharmCand3Prongs const& candidates, + o2::aod::V0Datas const& fullV0s) { rowFemtoResultCharm3Prong.reserve(candidates.size() + 1); @@ -819,14 +834,14 @@ struct HfTaskCharmHadronsV0FemtoDream { } if (v0Sel.pdgCodeV0 == kLambda0) { auto sliceV0 = partitionLambda->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); } } else if (v0Sel.pdgCodeV0 == kK0Short) { auto sliceV0 = partitionK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); @@ -841,7 +856,8 @@ struct HfTaskCharmHadronsV0FemtoDream { void processDataDplusV0(FilteredCollisions const& cols, FDV0Particles const& parts, - FilteredCharmCand3Prongs const& candidates) + FilteredCharmCand3Prongs const& candidates, + o2::aod::V0Datas const& fullV0s) { rowFemtoResultCharm3Prong.reserve(candidates.size() + 1); @@ -853,14 +869,14 @@ struct HfTaskCharmHadronsV0FemtoDream { } if (v0Sel.pdgCodeV0 == kLambda0) { auto sliceV0 = partitionLambda->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); } } else if (v0Sel.pdgCodeV0 == kK0Short) { auto sliceV0 = partitionK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); @@ -875,7 +891,8 @@ struct HfTaskCharmHadronsV0FemtoDream { void processDataD0V0(FilteredCollisions const& cols, FDV0Particles const& parts, - FilteredCharmCand2Prongs const& candidates) + FilteredCharmCand2Prongs const& candidates, + o2::aod::V0Datas const& fullV0s) { rowFemtoResultCharm2Prong.reserve(candidates.size() + 1); @@ -887,14 +904,14 @@ struct HfTaskCharmHadronsV0FemtoDream { } if (v0Sel.pdgCodeV0 == kLambda0) { auto sliceV0 = partitionLambda->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); } } else if (v0Sel.pdgCodeV0 == kK0Short) { auto sliceV0 = partitionK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); @@ -909,7 +926,8 @@ struct HfTaskCharmHadronsV0FemtoDream { void processDataDstarV0(FilteredCollisions const& cols, FDV0Particles const& parts, - FilteredCharmCandDstars const& candidates) + FilteredCharmCandDstars const& candidates, + o2::aod::V0Datas const& fullV0s) { rowFemtoResultCharmDstar.reserve(candidates.size() + 1); @@ -922,14 +940,14 @@ struct HfTaskCharmHadronsV0FemtoDream { } if (v0Sel.pdgCodeV0 == kLambda0) { auto sliceV0 = partitionLambda->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); } } else if (v0Sel.pdgCodeV0 == kK0Short) { auto sliceV0 = partitionK0Short->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceV0, sliceCharmHad, parts); + fillTables(col, sliceV0, sliceCharmHad, parts, fullV0s); if (sliceCharmHad.size() > 0 && sliceV0.size() > 0) { doSameEvent(sliceCharmHad, sliceV0, parts, col); @@ -946,7 +964,8 @@ struct HfTaskCharmHadronsV0FemtoDream { FDMcV0Particles const& parts, o2::aod::FDMCParticles const&, o2::aod::FDExtMCParticles const&, - FilteredCharmMcCand3Prongs const&) + FilteredCharmMcCand3Prongs const&, + o2::aod::V0Datas const& fullV0s) { for (const auto& col : cols) { eventHisto.fillQA(col); @@ -956,14 +975,14 @@ struct HfTaskCharmHadronsV0FemtoDream { } if (v0Sel.pdgCodeV0 == kLambda0) { auto sliceMcV0 = partitionMcLambda->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - fillTables(col, sliceMcV0, sliceMcCharmHad, parts); + 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); + fillTables(col, sliceMcV0, sliceMcCharmHad, parts, fullV0s); if (sliceMcCharmHad.size() > 0 && sliceMcV0.size() > 0) { doSameEvent(sliceMcCharmHad, sliceMcV0, parts, col); From 557a34d09be2cb50bca961fdd265b63061de4dae Mon Sep 17 00:00:00 2001 From: Zhihe Han Date: Mon, 2 Nov 2026 13:27:35 +0800 Subject: [PATCH 2/2] [PWGHF] Fill the V0 MC origin with HF, LF and phi secondary classes - reuse RecoDecay::getParticleOrigin (as done in #18481) instead of an ad-hoc first-digit PDG scan, so the V0 origin is filled with kPrimary, kMaterial, kSecondaryFromHF, kSecondaryFromLF and kSecondaryFromPhi - add kSecondaryFromPhi: the phi chain (phi -> K0/K0bar -> K0s) is light-flavour feed-down, but it is kept as a separate class because the relatively long phi lifetime makes it a distinct source - RecoDecay::getParticleOrigin now stops the mother walk (break) in the hadron-level mode as soon as a parton or a diquark is reached: no heavy-flavour hadron can be found above the partonic level, and diquark PDG codes (4101, 4201, 5101, ...) satisfy pdg / 1000 == 4 or 5 and were otherwise misidentified as charm/beauty baryons; in the parton-level mode (searchUpToQuark) the walk still goes through diquarks, since a charm or beauty quark can be found above them - add RecoDecay::isDiquark() and PdgDiquarkSpin0Code/PdgDiquarkSpin1Code, built from the existing PDG constants and divisors (no literal PDG codes) - use o2::constants::physics::Pdg::kPhi and kK0 instead of literal PDG codes --- Common/Core/RecoDecay.h | 34 ++++++ PWGCF/DataModel/FemtoDerived.h | 4 +- .../producerCharmHadronsV0FemtoDream.cxx | 101 ++++++++++++++---- 3 files changed, 117 insertions(+), 22 deletions(-) diff --git a/Common/Core/RecoDecay.h b/Common/Core/RecoDecay.h index b8e8bedefdd..3d48da149db 100644 --- a/Common/Core/RecoDecay.h +++ b/Common/Core/RecoDecay.h @@ -59,6 +59,8 @@ struct RecoDecay { static constexpr int PdgBosonMax{37}; // largest boson (gauge or H) PDG code; o2-linter: disable=pdg/explicit-code (H+ does not have a named constant.) static constexpr int PdgDivisorMeson{100}; // order of magnitude of the meson PDG codes static constexpr int PdgDivisorBaryon{1000}; // order of magnitude of the baryon PDG codes + static constexpr int PdgDiquarkSpin0Code{1}; // last digits of a spin-0 diquark PDG code + static constexpr int PdgDiquarkSpin1Code{3}; // last digits of a spin-1 diquark PDG code // Auxiliary functions @@ -1179,6 +1181,27 @@ struct RecoDecay { return OriginType::None; } + /// Check whether the PDG code corresponds to a diquark state (e.g. 4101, 4201, 5101). + /// Diquarks are constituents used by the generators during the hadronisation and are not + /// hadrons, but their PDG codes satisfy the pdg / 1000 == 4 or 5 condition that is used + /// to identify charm and beauty baryons in getParticleOrigin. + /// \param pdgCode PDG code of the particle + /// \return true if the PDG code belongs to a diquark state + static bool isDiquark(const int pdgCode) + { + // a diquark PDG code is composed as quark1 * PdgDivisorBaryon + quark2 * PdgDivisorMeson + + // spinCode, with quark1 >= quark2 the quark flavours and spinCode either PdgDiquarkSpin0Code + // or PdgDiquarkSpin1Code + const int absPdgCode = std::abs(pdgCode); + const int spinCode = absPdgCode % PdgDivisorMeson; + if (spinCode != PdgDiquarkSpin0Code && spinCode != PdgDiquarkSpin1Code) { + return false; + } + const int quark1 = absPdgCode / PdgDivisorBaryon; + const int quark2 = (absPdgCode % PdgDivisorBaryon) / PdgDivisorMeson; + return quark1 >= PDG_t::kDown && quark1 <= PDG_t::kTop && quark2 >= PDG_t::kDown && quark1 >= quark2; + } + /// based on getCharmHardronOrigin in order to extend general particle /// Finding the origin (from charm hadronisation or beauty-hadron decay) of paritcle (b, c and others) /// \param particlesMC table with MC particles @@ -1221,6 +1244,17 @@ struct RecoDecay { // Check status code // auto motherStatusCode = std::abs(mother.getGenStatusCode()); auto pdgParticleIMother = std::abs(mother.pdgCode()); // PDG code of the mother + // in the hadron-level mode, stop the walk when a parton or a diquark is reached: no + // heavy-flavour hadron can be found above the partonic level, and a diquark is not a + // hadron although its PDG code (e.g. 4101, 4201, 5101) satisfies pdg / 1000 == 4 or 5 + // and would be misidentified as a charm/beauty baryon below. In the parton-level mode + // the walk has to continue through diquarks, since a charm or beauty quark can still be + // found above them. + if (!searchUpToQuark && + (isDiquark(pdgParticleIMother) || pdgParticleIMother <= PdgQuarkMax || + (pdgParticleIMother >= PdgBosonMin && pdgParticleIMother <= PdgBosonMax))) { + break; + } // Check mother's PDG code. // printf("getMother: "); // for (int i = stage; i < 0; i++) // Indent to make the tree look nice. diff --git a/PWGCF/DataModel/FemtoDerived.h b/PWGCF/DataModel/FemtoDerived.h index e4187d8abd4..62fc38faccf 100644 --- a/PWGCF/DataModel/FemtoDerived.h +++ b/PWGCF/DataModel/FemtoDerived.h @@ -750,6 +750,7 @@ enum ParticleOriginMCTruth { kElse, //! none of the above; (NOTE: used to catch bugs. will be removed once MC usage is properly validated) kSecondaryFromHF, //! Kaon from a charm- or beauty-hadron decay chain kSecondaryFromLF, //! Kaon from a light-flavour decay without a heavy-flavour ancestor + kSecondaryFromPhi, //! Kaon from a phi decay chain (phi -> K0/K0bar -> K0S) kNOriginMCTruthTypes }; @@ -771,7 +772,8 @@ static constexpr std::string_view ParticleOriginMCTruthName[kNOriginMCTruthTypes "_SecondaryDaughterXistarMinus", "_Else", "_SecondaryFromHF", - "_SecondaryFromLF"}; + "_SecondaryFromLF", + "_SecondaryFromPhi"}; /// Distinguished between reconstructed and truth enum MCType { diff --git a/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx b/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx index 4b8594f8833..e8ef55e8e6e 100644 --- a/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx +++ b/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx @@ -32,6 +32,7 @@ #include "PWGHF/Utils/utilsEvSelHf.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -59,6 +60,7 @@ #include #include +#include #include #include @@ -494,8 +496,47 @@ struct HfProducerCharmHadronsV0FemtoDream { } } + /// Classify the MC origin of a V0 candidate. + /// The heavy-flavour feed-down is identified with RecoDecay::getParticleOrigin, which also + /// covers charm- and beauty-hadron decays flagged as physical primaries. The feed-down from + /// a phi decay is light-flavour and kept as a separate class, since the relatively long phi + /// lifetime makes it a distinct source. + /// \param mcParticles table of the MC particles + /// \param particleMc MC particle matched to the V0 candidate + /// \param isFromPhi true if the K0S comes from a phi decay chain + /// \return the origin according to ParticleOriginMCTruth (kPrimary, kMaterial, + /// kSecondaryFromHF, kSecondaryFromLF or kSecondaryFromPhi) + template + static int getK0sOrigin(T const& mcParticles, typename T::iterator const& particleMc, const bool isFromPhi) + { + using namespace o2::aod::femtodreamMCparticle; + constexpr int GenFromTransport = -1; + const auto process = particleMc.getProcess(); + // hadronic interaction in the detector material + if (process == TMCProcess::kPHInhelastic && particleMc.getGenStatusCode() == GenFromTransport) { + return kMaterial; + } + // charm- or beauty-hadron anywhere in the mother chain (feed-down can be a physical primary) + if (RecoDecay::getParticleOrigin(mcParticles, particleMc, false) != RecoDecay::OriginType::None) { + return kSecondaryFromHF; + } + // phi -> K0/K0bar -> K0S is light-flavour feed-down, but kept as a separate class because + // the relatively long phi lifetime makes it a distinct source (also flagged as a physical primary) + if (isFromPhi) { + return kSecondaryFromPhi; + } + if (particleMc.isPhysicalPrimary()) { + return kPrimary; + } + // weak decay of a light-flavour hadron during the transport + if (process == TMCProcess::kPDecay && particleMc.getGenStatusCode() == GenFromTransport && particleMc.has_mothers()) { + return kSecondaryFromLF; + } + return kElse; + } + template - void fillMcParticle(CollisionType const& col, ParticleType const& particle, o2::aod::femtodreamparticle::ParticleType fdparttype) + void fillMcParticle(CollisionType const& col, ParticleType const& particle, o2::aod::femtodreamparticle::ParticleType fdparttype, aod::McParticles const& mcParticles) { if (particle.has_mcParticle()) { // get corresponding MC particle and its info @@ -510,6 +551,19 @@ struct HfProducerCharmHadronsV0FemtoDream { float etaPos{-1.f}, etaNeg{-1.f}; float phiPos{-1.f}, phiNeg{-1.f}; int pdgCodePos{0}, pdgCodeNeg{0}; + // phi -> K0/K0bar -> K0s (or phi -> K0s directly); the heavy-flavour feed-down is + // handled in getK0sOrigin through RecoDecay::getParticleOrigin + bool isFromPhi = false; + if (fdparttype == o2::aod::femtodreamparticle::ParticleType::kV0 && !motherparticlesMc.empty()) { + const auto absPdgMother = std::abs(motherparticlesMc.front().pdgCode()); + if (absPdgMother == o2::constants::physics::Pdg::kPhi) { + isFromPhi = true; + } else if (absPdgMother == kK0) { + const auto& grandMothersMc = motherparticlesMc.front().template mothers_as(); + isFromPhi = !grandMothersMc.empty() && std::abs(grandMothersMc.front().pdgCode()) == o2::constants::physics::Pdg::kPhi; + } + } + // check pdg code // if this fails, the particle is a fake if (std::abs(pdgCode) == std::abs(v0PDGCode.value)) { @@ -518,6 +572,11 @@ struct HfProducerCharmHadronsV0FemtoDream { if ((col.has_mcCollision() && (particleMc.mcCollisionId() != col.mcCollisionId())) || !col.has_mcCollision()) { particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kWrongCollision; // check if particle is primary + } else if (fdparttype == o2::aod::femtodreamparticle::ParticleType::kV0) { + particleOrigin = getK0sOrigin(mcParticles, particleMc, isFromPhi); + if (!motherparticlesMc.empty()) { + pdgCodeMother = motherparticlesMc.front().pdgCode(); + } } else if (particleMc.isPhysicalPrimary()) { particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kPrimary; // check if particle is secondary @@ -612,7 +671,7 @@ struct HfProducerCharmHadronsV0FemtoDream { } template - bool fillV0sForCharmHadron(CollisionType const& col, V0Type const& fullV0s, TrackType const& /*tracks*/) + bool fillV0sForCharmHadron(CollisionType const& col, V0Type const& fullV0s, TrackType const& /*tracks*/, aod::McParticles const* mcParticles = nullptr) { const bool isK0S = (selectionFlagV0 == V0Channel::K0S); const bool isLambda = (selectionFlagV0 == V0Channel::Lambda); @@ -724,7 +783,7 @@ struct HfProducerCharmHadronsV0FemtoDream { } if constexpr (IsMc) { - fillMcParticle(col, v0, o2::aod::femtodreamparticle::ParticleType::kV0); + fillMcParticle(col, v0, o2::aod::femtodreamparticle::ParticleType::kV0, *mcParticles); } fIsV0Filled = true; } @@ -732,7 +791,7 @@ struct HfProducerCharmHadronsV0FemtoDream { } template - void fillCharmHadronTable(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s, CandType const& candidates) + void fillCharmHadronTable(CollisionType const& col, TrackType const& tracks, V0Type const& fullV0s, CandType const& candidates, aod::McParticles const* mcParticles = nullptr) { const auto vtxZ = col.posZ(); const auto sizeCand = candidates.size(); @@ -1019,7 +1078,7 @@ struct HfProducerCharmHadronsV0FemtoDream { fillTable(2, candidate.isSelDstarToD0Pi(), outputMlDstar.at(0), outputMlDstar.at(1), outputMlDstar.at(2)); } } - isV0Filled = fillV0sForCharmHadron(col, fullV0s, tracks); + isV0Filled = fillV0sForCharmHadron(col, fullV0s, tracks, mcParticles); aod::femtodreamcollision::BitMaskType bitV0 = 0; if (isV0Filled) { bitV0 |= 1 << 0; @@ -1248,12 +1307,12 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, CandidateD0Mc const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcD0ToPiK, "Provide Mc for D0ToPiK", false); @@ -1261,13 +1320,13 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, soa::Join const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcD0ToPiKWithML, "Provide Mc for D0ToPiK with ml", false); @@ -1307,12 +1366,12 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, CandidateDstarMc const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcDstarToD0Pi, "Provide Mc for DstarToD0Pi", false); @@ -1320,13 +1379,13 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, soa::Join const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcDstarToD0PiWithML, "Provide Mc for DstarToD0Pi with ml", false); @@ -1368,12 +1427,12 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, CandidateDplusMc const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcDplusToPiKPi, "Provide Mc for DplusToPiKPi", false); @@ -1381,13 +1440,13 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, soa::Join const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcDplusToPiKPiWithML, "Provide Mc for DplusToPiKPi with ml", false); @@ -1429,12 +1488,12 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, CandidateLcMc const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcLcToPKPi, "Provide Mc for lctopkpi", false); @@ -1442,13 +1501,13 @@ struct HfProducerCharmHadronsV0FemtoDream { aod::BCsWithTimestamps const&, FemtoHFMcTracks const& tracks, soa::Join const& fullV0s, - aod::McParticles const&, + aod::McParticles const& mcParticles, soa::Join const& candidates) { // get magnetic field for run getMagneticFieldTesla(col.bc_as()); - fillCharmHadronTable(col, tracks, fullV0s, candidates); + fillCharmHadronTable(col, tracks, fullV0s, candidates, &mcParticles); } PROCESS_SWITCH(HfProducerCharmHadronsV0FemtoDream, processMcLcToPKPiWithML, "Provide Mc for lctopkpi with ml", false);