Skip to content

Commit 848e879

Browse files
authored
[PWGHF] dataCreatorJpsiHadReduced.cxx: fix segfault (#18753)
1 parent 08826b2 commit 848e879

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,8 @@ struct HfDataCreatorJpsiHadReduced {
843843
const auto mcParticlesPerMcColl = particlesMc.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex());
844844

845845
// Match generated particles.
846-
for (const auto& particle : mcParticlesPerMcColl) {
846+
for (int iPart{0}; iPart < mcParticlesPerMcColl.size(); ++iPart) {
847+
const auto particle = mcParticlesPerMcColl.iteratorAt(iPart);
847848
int8_t sign = particle.pdgCode() > 0 ? 1 : -1;
848849
int8_t flag{0}, channel{0};
849850
if constexpr (DecChannel == DecayChannel::BplusToJpsiK) {
@@ -946,7 +947,7 @@ struct HfDataCreatorJpsiHadReduced {
946947
}
947948
const auto& phiPart = particlesMc.rawIteratorAt(particle.daughtersIds().back());
948949
// Check phi -> K+K-
949-
if (RecoDecay::isMatchedMCGen(particlesMc, phiPart, static_cast<int>(Pdg::kPhi), std::array{-kKPlus, +kKPlus}, true)) {
950+
if (RecoDecay::isMatchedMCGen(particlesMc, phiPart, static_cast<int>(Pdg::kPhi), std::array{-kKPlus, +kKPlus}, false)) {
950951
channel = o2::hf_decay::hf_cand_beauty::BsToJpsiPhi;
951952
}
952953
}

0 commit comments

Comments
 (0)