Skip to content

[PWGEM] Fix TTCA weights when using cfgRequireTrueAssociation in PWGEM/Dilepton tasks#15764

Merged
dsekihat merged 2 commits intoAliceO2Group:masterfrom
feisenhu:master
Apr 14, 2026
Merged

[PWGEM] Fix TTCA weights when using cfgRequireTrueAssociation in PWGEM/Dilepton tasks#15764
dsekihat merged 2 commits intoAliceO2Group:masterfrom
feisenhu:master

Conversation

@feisenhu
Copy link
Copy Markdown
Collaborator

When cfgRequireTrueAssociation = true, tracks/pairs failing the MC collision association check were correctly rejected during histogram filling, but still counted in the TTCA weight denominator — causing weights of 1/N instead of 1/1 and under-filled histograms.

Affected files

  • PWGEM/Dilepton/Core/SingleTrackQCMC.hfillTrackWeightMap(): missing check for both electron and muon loops
  • PWGEM/Dilepton/Core/DileptonMC.hfillPairWeightMap(): missing check for ULS, LS++, and LS-- combination loops
  • PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxxfillPairWeightMap(): same as above

Fix

Added cfgRequireTrueAssociation guard in each weight-building loop to mirror the filter already applied at fill time:

// fillPairWeightMap — now consistent with fillPairInfo
if (cfgRequireTrueAssociation &&
    (mcpos.emmceventId() != collision.emmceventId() ||
     mcneg.emmceventId() != collision.emmceventId())) {
  continue;  // skip pairs that would be rejected at fill time
}

This ensures only tracks/pairs that actually enter histograms are counted in N, keeping weight = 1/N correct under all configurations.

Copilot AI and others added 2 commits April 14, 2026 14:03
…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>
Copilot AI review requested due to automatic review settings April 14, 2026 12:26
@github-actions github-actions bot added the pwgem label Apr 14, 2026
@github-actions
Copy link
Copy Markdown

O2 linter results: ❌ 631 errors, ⚠️ 611 warnings, 🔕 0 disabled

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes TTCA (1/N) weight normalization when cfgRequireTrueAssociation=true by ensuring tracks/pairs that would be rejected during histogram filling are also excluded from the TTCA denominator during weight-map construction.

Changes:

  • Add cfgRequireTrueAssociation event-association guards in single-track TTCA weight map building (dielectron and dimuon paths).
  • Add the same guard in dilepton TTCA pair weight map building for ULS, LS++, and LS-- loops.
  • Mirror the above fix in the checkMCPairTemplate task’s pair weight-map construction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx Skips MC-event-mismatched pairs during TTCA weight-map building when true association is required.
PWGEM/Dilepton/Core/SingleTrackQCMC.h Skips MC-event-mismatched tracks during TTCA weight-map building when true association is required.
PWGEM/Dilepton/Core/DileptonMC.h Skips MC-event-mismatched pairs during TTCA weight-map building (ULS/LS++/LS--) when true association is required.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alibuild
Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 0d2acd4 at 2026-04-14 15:04:

No log files found

Full log here.

@dsekihat dsekihat merged commit 04cf5be into AliceO2Group:master Apr 14, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

5 participants