Skip to content

Commit 77c6226

Browse files
fgrosaalibuild
andauthored
[PWGHF] Add MC matching for c-deuteron (#16655)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 3f114dc commit 77c6226

4 files changed

Lines changed: 70 additions & 4 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,26 @@ 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+
// particular treatment for c-deuteron resonant decay channels, as resonances are not stored in the stack
1347+
flagChannelResonant = hf_decay::getResonantDecayCDeuteron(particle);
1348+
}
1349+
}
13301350
}
13311351

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

PWGHF/Utils/utilsMcGen.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void fillMcMatchGen3Prong(TMcParticles const& mcParticles,
202202
if (std::abs(pdgMother) == Pdg::kDStar) {
203203
std::vector<int> arrResoDaughIndexDStar = {};
204204
RecoDecay::getDaughters(particle, &arrResoDaughIndexDStar, std::array{0}, DepthResoMax);
205-
for (const int iDaug : arrResoDaughIndexDStar) {
205+
for (const int iDaug : arrResoDaughIndexDStar) { // o2-linter: disable=const-ref-in-for-loop (not necessary for int type)
206206
auto daughDstar = mcParticles.rawIteratorAt(iDaug);
207207
if (std::abs(daughDstar.pdgCode()) == Pdg::kD0 || std::abs(daughDstar.pdgCode()) == Pdg::kDPlus) {
208208
RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, DepthResoMax);
@@ -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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ 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+
/// resonances in c-deuteron decay are not stored in the particle stack for c-deuteron, but tagged with specific status codes
163+
static constexpr int StatusCodeCDeuteronToDeKstar0{95};
164+
static constexpr int StatusCodeCDeuteronToNeDeltaplusK{96};
165+
static constexpr int StatusCodeCDeuteronToNeL1520Pi{97};
166+
157167
/// Returns a map of the possible final states for a specific 3-prong particle specie
158168
/// \param pdgMother PDG code of the mother particle
159169
/// \return a map of final states with their corresponding PDG codes
@@ -170,6 +180,8 @@ inline std::unordered_map<DecayChannelMain, const std::vector<int>> getDecayChan
170180
return daughtersLcMain;
171181
case o2::constants::physics::Pdg::kXiCPlus:
172182
return daughtersXicMain;
183+
case o2::constants::physics::Pdg::kCDeuteron:
184+
return daughtersCDeuteronMain;
173185
default:
174186
LOG(fatal) << "Unknown PDG code for 3-prong final states: " << pdgMother;
175187
return {};
@@ -317,6 +329,27 @@ inline void flipPdgSign(const int pdgMother, const int pdgToFlip, std::array<int
317329
}
318330
}
319331
}
332+
/// Get resonant channel for c-deuteron
333+
/// resonances are not stored in the particle stack for c-deuteron, but tagged with specific status codes
334+
/// \tparam particle is the c-deuteron
335+
/// \param pdgMother PDG code of the mother particle
336+
/// \param pdgToFlip PDG code to be flipped
337+
/// \param arrPdg array of PDG codes to be modified
338+
template <typename Part>
339+
inline int getResonantDecayCDeuteron(Part const& particle)
340+
{
341+
auto statusCode = std::abs(particle.getGenStatusCode());
342+
if (statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToDeKstar0) {
343+
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToDeKstar0;
344+
}
345+
if (statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToNeDeltaplusK) {
346+
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToNeDeltaplusK;
347+
}
348+
if (statusCode == o2::hf_decay::hf_cand_3prong::StatusCodeCDeuteronToNeL1520Pi) {
349+
return o2::hf_decay::hf_cand_3prong::DecayChannelResonant::CDeuteronToNeL1520Pi;
350+
}
351+
return 0;
352+
}
320353
} // namespace o2::hf_decay
321354

322355
#endif // PWGHF_UTILS_UTILSMCMATCHING_H_

0 commit comments

Comments
 (0)