diff --git a/PWGHF/D2H/Tasks/taskDplus.cxx b/PWGHF/D2H/Tasks/taskDplus.cxx index fd90c19d4af..18e2e59b26d 100644 --- a/PWGHF/D2H/Tasks/taskDplus.cxx +++ b/PWGHF/D2H/Tasks/taskDplus.cxx @@ -636,7 +636,7 @@ struct HfTaskDplus { flagGenB = getBHadMotherFlag(bHadMother.pdgCode()); ptGenB = bHadMother.pt(); } - for (const auto& recCol : mcRecoCollisions) { + for (const auto& recCol : recoCollsPerGenMcColl) { numPvContr = std::max(numPvContr, recCol.numContrib()); } fillHistoMCGen(particle);