diff --git a/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C b/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C index 559bc558e..462ae589b 100644 --- a/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C +++ b/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C @@ -96,7 +96,7 @@ protected: // Alternate hadrons if enabled (with the same ratio) if (mHadronPdgList.size() >= 1) { - int iHadron = (nInjectedEvents / std::max(mHadronPdgList.size(), 1ul)) % mHadronPdgList.size(); + int iHadron = (nInjectedEvents / std::max(mQuarkPdgList.size(), 1ul)) % mHadronPdgList.size(); mHadronPdg = mHadronPdgList[iHadron]; LOG(debug)<<"SELECTED hadron: "<