From 3975ab0ce4cea5d5afa991c03c39e5a18d400ac8 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Tue, 9 Jun 2026 14:02:53 +0200 Subject: [PATCH] [PWGEM] PhotonMeson: Fix pcm-qc-mc processGen crash Fixes a crash in processGen of pcm-qc-mc, where a check for the size of the daughter particles was missing --- PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index b8824222deb..2b87eb2cfee 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -774,6 +774,9 @@ struct PCMQCMC { if (cfgResolDetailPlots) { fRegistry.fill(HIST("Generated/hPtEtaPhi"), mctrack.pt(), mctrack.eta(), mctrack.phi()); // fill for all generated photons before any kinematic cut } + if (mctrack.daughtersIds().size() == 0) { + continue; + } auto daughter = mcparticles.iteratorAt(mctrack.daughtersIds()[0]); // choose ele or pos. float rxy_gen_e = std::sqrt(std::pow(daughter.vx(), 2) + std::pow(daughter.vy(), 2)); float phi_cp = std::atan2(daughter.vy(), daughter.vx());