From 69fd9c635f3d74a9cd9bf8d5f1959dfe980df0bc Mon Sep 17 00:00:00 2001 From: aimeric-landou Date: Wed, 23 Apr 2025 12:06:49 +0200 Subject: [PATCH 1/2] [PWGJE] eventWeight fix for fake collisions --- PWGJE/TableProducer/jetEventWeightMCD.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PWGJE/TableProducer/jetEventWeightMCD.cxx b/PWGJE/TableProducer/jetEventWeightMCD.cxx index 0709a362d7f..7dba3ae345d 100644 --- a/PWGJE/TableProducer/jetEventWeightMCD.cxx +++ b/PWGJE/TableProducer/jetEventWeightMCD.cxx @@ -39,15 +39,23 @@ struct JetEventWeightMCDTask { void processMCDetectorLevelEventWeight(MCDetectorLevelJetTable const& jet, soa::Join const&, aod::JetMcCollisions const&) { - auto collision = jet.template collision_as>(); - mcDetectorLevelWeightsTable(jet.globalIndex(), collision.mcCollision().weight()); + auto collision = jet.template collision_as>(); + if (collision.has_mcCollision()) { + mcDetectorLevelWeightsTable(jet.globalIndex(), collision.mcCollision().weight()); + } else { + mcDetectorLevelWeightsTable(jet.globalIndex(), 0.0); + } } PROCESS_SWITCH(JetEventWeightMCDTask, processMCDetectorLevelEventWeight, "Fill event weight tables for detector level MC jets", false); void processMCDetectorLevelEventWiseSubtractedEventWeight(MCDetectorLevelEventWiseSubtractedJetTable const& jet, soa::Join const&, aod::JetMcCollisions const&) { - auto collision = jet.template collision_as>(); - mcDetectorLevelEventWiseSubtractedWeightsTable(jet.globalIndex(), collision.mcCollision().weight()); + auto collision = jet.template collision_as>(); + if (collision.has_mcCollision()) { + mcDetectorLevelEventWiseSubtractedWeightsTable(jet.globalIndex(), collision.mcCollision().weight()); + } else { + mcDetectorLevelEventWiseSubtractedWeightsTable(jet.globalIndex(), 0.0); + } } PROCESS_SWITCH(JetEventWeightMCDTask, processMCDetectorLevelEventWiseSubtractedEventWeight, "Fill event weight tables for detector level MC jets", false); }; From 8681a0da8bdac6f7e143e368d86a0108af46b07a Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 23 Apr 2025 12:30:28 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGJE/TableProducer/jetEventWeightMCD.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGJE/TableProducer/jetEventWeightMCD.cxx b/PWGJE/TableProducer/jetEventWeightMCD.cxx index 7dba3ae345d..0fb8d8161e6 100644 --- a/PWGJE/TableProducer/jetEventWeightMCD.cxx +++ b/PWGJE/TableProducer/jetEventWeightMCD.cxx @@ -39,7 +39,7 @@ struct JetEventWeightMCDTask { void processMCDetectorLevelEventWeight(MCDetectorLevelJetTable const& jet, soa::Join const&, aod::JetMcCollisions const&) { - auto collision = jet.template collision_as>(); + auto collision = jet.template collision_as>(); if (collision.has_mcCollision()) { mcDetectorLevelWeightsTable(jet.globalIndex(), collision.mcCollision().weight()); } else { @@ -50,7 +50,7 @@ struct JetEventWeightMCDTask { void processMCDetectorLevelEventWiseSubtractedEventWeight(MCDetectorLevelEventWiseSubtractedJetTable const& jet, soa::Join const&, aod::JetMcCollisions const&) { - auto collision = jet.template collision_as>(); + auto collision = jet.template collision_as>(); if (collision.has_mcCollision()) { mcDetectorLevelEventWiseSubtractedWeightsTable(jet.globalIndex(), collision.mcCollision().weight()); } else {