Skip to content

Commit 14e13ef

Browse files
committed
Add MC matching for c-deuteron
1 parent d0ce0a1 commit 14e13ef

4 files changed

Lines changed: 69 additions & 3 deletions

File tree

PWGHF/Core/DecayChannels.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@ enum DecayChannelMain : HfDecayChannel {
9292
XicToPKPi = 21, // p K− π+
9393
XicToPKK = 22, // p K− K+
9494
XicToSPiPi = 23, // Σ+ π− π+
95+
// cd+
96+
CDeuteronToDeKPi = 24, // de K− π+
9597
//
96-
NChannelsMain = XicToSPiPi // last channel
98+
NChannelsMain = CDeuteronToDeKPi // last channel
9799
};
98100
/// @brief 3-prong candidates: resonant channels
99101
enum DecayChannelResonant : HfDecayChannel {
@@ -131,8 +133,11 @@ enum DecayChannelResonant : HfDecayChannel {
131133
// Ξc+
132134
XicToPKstar0 = 27, // p anti-K*0(892)
133135
XicToPPhi = 28, // p φ
134-
//
135-
NChannelsResonant = XicToPPhi // last channel
136+
// cd+
137+
CDeuteronToDeKstar0 = 30,
138+
CDeuteronToNeDeltaplusK = 31,
139+
CDeuteronToNeL1520Pi = 32,
140+
NChannelsResonant = CDeuteronToNeL1520Pi // last channel
136141
};
137142
} // namespace hf_cand_3prong
138143

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,25 @@ struct HfCandidateCreator3ProngExpressions {
13271327
}
13281328
}
13291329
}
1330+
1331+
// cd± → de± K∓ π±
1332+
if (flagChannelMain == 0) {
1333+
auto arrPdgDaughtersCDeuteronToDeKPi{std::array{+Pdg::kDeuteron, -kKPlus, +kPiPlus}};
1334+
if (matchKinkedDecayTopology && matchInteractionsWithMaterial) {
1335+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(mcParticles, arrayDaughters, Pdg::kCDeuteron, arrPdgDaughtersCDeuteronToDeKPi, true, &sign, 1, &nKinkedTracks, &nInteractionsWithMaterial);
1336+
} else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) {
1337+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, false>(mcParticles, arrayDaughters, Pdg::kCDeuteron, arrPdgDaughtersCDeuteronToDeKPi, true, &sign, 1, &nKinkedTracks);
1338+
} else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) {
1339+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, false, true>(mcParticles, arrayDaughters, Pdg::kCDeuteron, arrPdgDaughtersCDeuteronToDeKPi, true, &sign, 1, nullptr, &nInteractionsWithMaterial);
1340+
} else {
1341+
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kCDeuteron, arrPdgDaughtersCDeuteronToDeKPi, true, &sign, 1);
1342+
}
1343+
if (indexRec > -1) {
1344+
flagChannelMain = static_cast<int8_t>(sign * DecayChannelMain::CDeuteronToDeKPi);
1345+
auto particle = mcParticles.rawIteratorAt(indexRec);
1346+
flagChannelResonant = hf_decay::getResonantDecayCDeuteron(particle);
1347+
}
1348+
}
13301349
}
13311350

13321351
// Check whether the particle is non-prompt (from a b quark).

PWGHF/Utils/utilsMcGen.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ void fillMcMatchGen3Prong(TMcParticles const& mcParticles,
301301
flagChannelMain = sign * DecayChannelMain::XicToPKPi;
302302
}
303303
}
304+
305+
// cd± → de± K∓ π±
306+
if (flagChannelMain == 0) {
307+
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kCDeuteron, std::array{+Pdg::kDeuteron, -kKPlus, +kPiPlus}, true, &sign, 1)) {
308+
flagChannelMain = sign * DecayChannelMain::CDeuteronToDeKPi;
309+
flagChannelResonant = o2::hf_decay::getResonantDecayCDeuteron(particle);
310+
}
311+
}
304312
}
305313

306314
// Check whether the particle is non-prompt (from a b quark).

PWGHF/Utils/utilsMcMatching.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ static const std::unordered_map<DecayChannelResonant, const std::array<int, 2>>
154154
{DecayChannelResonant::XicToPPhi, {+PDG_t::kProton, +o2::constants::physics::Pdg::kPhi}},
155155
};
156156

157+
// cd+
158+
159+
static const std::unordered_map<DecayChannelMain, const std::vector<int>> daughtersCDeuteronMain{
160+
{DecayChannelMain::CDeuteronToDeKPi, {+o2::constants::physics::Pdg::kDeuteron, +PDG_t::kKMinus, +PDG_t::kPiPlus}}
161+
};
162+
163+
/// resonances in c-deuteron decay are not stored in the particle stack for c-deuteron, but tagged with specific status codes
164+
static constexpr int statusCodeCDeuteronToDeKstar0{95};
165+
static constexpr int statusCodeCDeuteronToNeDeltaplusK{96};
166+
static constexpr int statusCodeCDeuteronToNeL1520Pi{97};
167+
157168
/// Returns a map of the possible final states for a specific 3-prong particle specie
158169
/// \param pdgMother PDG code of the mother particle
159170
/// \return a map of final states with their corresponding PDG codes
@@ -170,6 +181,8 @@ inline std::unordered_map<DecayChannelMain, const std::vector<int>> getDecayChan
170181
return daughtersLcMain;
171182
case o2::constants::physics::Pdg::kXiCPlus:
172183
return daughtersXicMain;
184+
case o2::constants::physics::Pdg::kCDeuteron:
185+
return daughtersCDeuteronMain;
173186
default:
174187
LOG(fatal) << "Unknown PDG code for 3-prong final states: " << pdgMother;
175188
return {};
@@ -317,6 +330,27 @@ inline void flipPdgSign(const int pdgMother, const int pdgToFlip, std::array<int
317330
}
318331
}
319332
}
333+
/// Get resonant channel for c-deuteron
334+
/// resonances are not stored in the particle stack for c-deuteron, but tagged with specific status codes
335+
/// \tparam particle is the c-deuteron
336+
/// \param pdgMother PDG code of the mother particle
337+
/// \param pdgToFlip PDG code to be flipped
338+
/// \param arrPdg array of PDG codes to be modified
339+
template <typename Part>
340+
inline int getResonantDecayCDeuteron(Part const& particle)
341+
{
342+
auto statusCode = std::abs(particle.getGenStatusCode());
343+
if (statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToDeKstar0) {
344+
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToDeKstar0;
345+
}
346+
if (statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToNeDeltaplusK) {
347+
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToNeDeltaplusK;
348+
}
349+
if (statusCode == o2::hf_decay::hf_cand_3prong::statusCodeCDeuteronToNeL1520Pi) {
350+
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToNeL1520Pi;
351+
}
352+
return 0;
353+
}
320354
} // namespace o2::hf_decay
321355

322356
#endif // PWGHF_UTILS_UTILSMCMATCHING_H_

0 commit comments

Comments
 (0)