Skip to content

Commit f86101a

Browse files
authored
[PWGHF] Fix MC flagging for c-deuteron (#16953)
1 parent b39849c commit f86101a

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,9 @@ struct HfCandidateCreator3ProngExpressions {
13581358
auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]);
13591359
rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial);
13601360
} else {
1361+
if (std::abs(flagChannelMain) == DecayChannelMain::CDeuteronToDeKPi) {
1362+
origin = RecoDecay::OriginType::Prompt;
1363+
}
13611364
rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial);
13621365
}
13631366
}

PWGHF/Utils/utilsMcMatching.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ static const std::unordered_map<DecayChannelMain, const std::vector<int>> daught
160160
{DecayChannelMain::CDeuteronToDeKPi, {+o2::constants::physics::Pdg::kDeuteron, +PDG_t::kKMinus, +PDG_t::kPiPlus}}};
161161

162162
/// resonances in c-deuteron decay are not stored in the particle stack for c-deuteron, but tagged with specific status codes
163-
static const std::array<int, 2> StatusCodeCDeuteronToDeKstar0{-85, -95};
164-
static const std::array<int, 2> StatusCodeCDeuteronToNeDeltaplusK{-86, -96};
165-
static const std::array<int, 2> StatusCodeCDeuteronToNeL1520Pi{-87, -97};
163+
static constexpr std::array<int, 2> statusCodeCDeuteronToDeKstar0{-85, -95};
164+
static constexpr std::array<int, 2> statusCodeCDeuteronToNeDeltaplusK{-86, -96};
165+
static constexpr std::array<int, 2> statusCodeCDeuteronToNeL1520Pi{-87, -97};
166166

167167
/// Returns a map of the possible final states for a specific 3-prong particle specie
168168
/// \param pdgMother PDG code of the mother particle
@@ -338,14 +338,14 @@ inline void flipPdgSign(const int pdgMother, const int pdgToFlip, std::array<int
338338
template <typename Part>
339339
inline int getResonantDecayCDeuteron(Part const& particle)
340340
{
341-
auto statusCode = std::abs(particle.getGenStatusCode());
342-
if (statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToDeKstar0[0] || statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToDeKstar0[1]) {
341+
auto statusCode = particle.getGenStatusCode();
342+
if (statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToDeKstar0[0] || statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToDeKstar0[1]) {
343343
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToDeKstar0;
344344
}
345-
if (statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToNeDeltaplusK[0] || statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToNeDeltaplusK[1]) {
345+
if (statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToNeDeltaplusK[0] || statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToNeDeltaplusK[1]) {
346346
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToNeDeltaplusK;
347347
}
348-
if (statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToNeL1520Pi[0] || statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToNeL1520Pi[1]) {
348+
if (statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToNeL1520Pi[0] || statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToNeL1520Pi[1]) {
349349
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToNeL1520Pi;
350350
}
351351
return 0;

0 commit comments

Comments
 (0)