Skip to content

Commit 6a34853

Browse files
committed
Set proper size in reserve
1 parent 0bf1e4f commit 6a34853

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,11 @@ struct HfProducerCharmHadronsTrackFemtoDream {
622622
bool isSelectedMlDstarToD0Pi = true;
623623

624624
if constexpr (Channel == DecayChannel::DplusToPiKPi || Channel == DecayChannel::LcToPKPi) {
625-
rowCandCharm3Prong.reserve(candidates.size());
625+
rowCandCharm3Prong.reserve(rowCandCharm3Prong.lastIndex() + sizeCand + 1);
626626
} else if constexpr (Channel == DecayChannel::D0ToPiK) {
627-
rowCandCharm2Prong.reserve(candidates.size());
627+
rowCandCharm2Prong.reserve(rowCandCharm2Prong.lastIndex() + sizeCand + 1);
628628
} else if constexpr (Channel == DecayChannel::DstarToD0Pi) {
629-
rowCandCharmDstar.reserve(candidates.size());
629+
rowCandCharmDstar.reserve(rowCandCharmDstar.lastIndex() + sizeCand + 1);
630630
}
631631

632632
for (const auto& candidate : candidates) {

PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ struct HfProducerCharmHadronsV0FemtoDream {
11241124
void fillCharmHadMcGen(ParticleType particles)
11251125
{
11261126
// Filling particle properties
1127-
rowCandCharmHadGen.reserve(particles.size());
1127+
rowCandCharmHadGen.reserve(rowCandCharmHadGen.lastIndex() + particles.size() + 1);
11281128
if constexpr (Channel == DecayChannel::DplusToPiKPi) {
11291129
for (const auto& particle : particles) {
11301130
if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) {

0 commit comments

Comments
 (0)