From 6533bee4c1915c65d650d2c5faa3cd211cac2f96 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:46:43 +0000 Subject: [PATCH 1/2] Initial plan From 0d2acd4ce45bbb95d12e12cac48aee1f20488e5f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 11:50:29 +0000 Subject: [PATCH 2/2] Fix cfgRequireTrueAssociation missing in TTCA weight calculation for DileptonMC.h, SingleTrackQCMC.h, and checkMCPairTemplate.cxx Agent-Logs-Url: https://github.com/feisenhu/O2Physics/sessions/1d6d35c8-a846-4be0-b49e-97d5dba066f8 Co-authored-by: feisenhu <53603353+feisenhu@users.noreply.github.com> --- PWGEM/Dilepton/Core/DileptonMC.h | 9 +++++++++ PWGEM/Dilepton/Core/SingleTrackQCMC.h | 6 ++++++ PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 83a56821628..6194716c508 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -2222,6 +2222,9 @@ struct DileptonMC { if (cfgEventGeneratorType >= 0 && mccollision_from_neg.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos.emmceventId() != collision.emmceventId() || mcneg.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); @@ -2238,6 +2241,9 @@ struct DileptonMC { if (cfgEventGeneratorType >= 0 && mccollision_from_pos2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos1.emmceventId() != collision.emmceventId() || mcpos2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); @@ -2254,6 +2260,9 @@ struct DileptonMC { if (cfgEventGeneratorType >= 0 && mccollision_from_neg2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcneg1.emmceventId() != collision.emmceventId() || mcneg2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index bde658f6c28..97191e4fe98 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -1055,6 +1055,9 @@ struct SingleTrackQCMC { if (cfgEventGeneratorType >= 0 && mccollision_from_track.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mctrack.emmceventId() != collision.emmceventId())) { + continue; + } if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { if (!cut.template IsSelectedTrack(track)) { @@ -1074,6 +1077,9 @@ struct SingleTrackQCMC { if (cfgEventGeneratorType >= 0 && mccollision_from_track.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mctrack.emmceventId() != collision.emmceventId())) { + continue; + } if (!cut.template IsSelectedTrack(track)) { continue; } diff --git a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx index 91ec19cdacd..b6e0118bd15 100644 --- a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx @@ -2804,6 +2804,9 @@ struct checkMCPairTemplate { if (cfgEventGeneratorType >= 0 && mccollision_from_neg.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos.emmceventId() != collision.emmceventId() || mcneg.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); @@ -2820,6 +2823,9 @@ struct checkMCPairTemplate { if (cfgEventGeneratorType >= 0 && mccollision_from_pos2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcpos1.emmceventId() != collision.emmceventId() || mcpos2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); @@ -2836,6 +2842,9 @@ struct checkMCPairTemplate { if (cfgEventGeneratorType >= 0 && mccollision_from_neg2.getSubGeneratorId() != cfgEventGeneratorType) { continue; } + if (cfgRequireTrueAssociation && (mcneg1.emmceventId() != collision.emmceventId() || mcneg2.emmceventId() != collision.emmceventId())) { + continue; + } if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); }