diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index 73667ffe7b8..3ad4779009a 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -1350,7 +1350,8 @@ struct HfCandidateCreatorXicToXiPiPiExpressions { // Check whether the charm baryon is non-prompt (from a b quark). if (flag != 0) { // fill inclusive generated Xic+ - registry.fill(HIST("hYPtGen"), particle.y(), particle.pt()); + if (fillMcHistograms) + registry.fill(HIST("hYPtGen"), particle.y(), particle.pt()); origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); // Calculate the decay length of the generated particle diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index 2732191f859..a2cd6957b92 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -655,7 +655,8 @@ struct HfCandidateSelectorXicToXiPiPi { if constexpr (IsMc) { if (isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); - registry.fill(HIST("hMassPtRecSig"), hfCandXic.invMassXicPlus(), hfCandXic.pt()); + if (fillQAHistograms) + registry.fill(HIST("hMassPtRecSig"), hfCandXic.invMassXicPlus(), hfCandXic.pt()); } else { registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); }