Skip to content

CROWN Changes for mumu to ee embedding #372

Open
FFA76 wants to merge 24 commits intomainfrom
mumu_ee_embedding_SK
Open

CROWN Changes for mumu to ee embedding #372
FFA76 wants to merge 24 commits intomainfrom
mumu_ee_embedding_SK

Conversation

@FFA76
Copy link
Copy Markdown

@FFA76 FFA76 commented Apr 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 20, 2026 14:19
@codacy-production
Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 minor

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
CodeStyle 1 minor

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

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

This PR adds new event-level helpers to support embedding workflows (muμ → ee), and extends code generation configuration with additional sample-type flags plus a safer config cleanup loop.

Changes:

  • Added embedding-muon charge matching utilities (MatchEmbeddingMuonP4ByCharge, HasEmbeddingMuonChargeMatch) and an opposite-charge helper (HasOppositeCharge).
  • Extended Configuration._set_sample_parameters() with explicit is_data, is_dyjets, and is_wjets boolean flags; made _remove_empty_configkeys() safe against mutation during iteration.
  • Added .codex to .gitignore.

Reviewed changes

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

File Description
src/event.cxx Implements new charge-based embedding-muon matching helpers and opposite-charge flag helper.
include/event.hxx Exposes declarations for the new event::quantity helpers.
code_generation/configuration.py Adds extra sample flags and fixes dict-key iteration during deletion.
.gitignore Ignores .codex artifacts.

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

Comment thread src/event.cxx
#include "../include/utility/Logger.hxx"
#include "ROOT/RDataFrame.hxx"
#include "TRandom3.h"
#include <cmath>
Comment thread src/event.cxx
Comment on lines +145 to +150
auto has_match = [](const int &reco_q,
const float &emb_q_1,
const float &emb_q_2) {
return static_cast<int>(reco_q == static_cast<int>(emb_q_1) ||
reco_q == static_cast<int>(emb_q_2));
};
sample_parameters["is_data"] = False
if "dyjets" in self.sample:
sample_parameters["is_dyjets"] = True
else:
Comment on lines +162 to +173
if "data" in self.sample:
sample_parameters["is_data"] = True
else:
sample_parameters["is_data"] = False
if "dyjets" in self.sample:
sample_parameters["is_dyjets"] = True
else:
sample_parameters["is_dyjets"] = False
if "wjets" in self.sample:
sample_parameters["is_wjets"] = True
else:
sample_parameters["is_wjets"] = False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this needed? This is already done by the if else above.

None
"""
for key in config:
for key in list(config.keys()):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this breaking anything?

Comment thread src/event.cxx
Comment on lines +148 to +149
return static_cast<int>(reco_q == static_cast<int>(emb_q_1) ||
reco_q == static_cast<int>(emb_q_2));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this ever false?

Comment thread src/event.cxx
const std::string &outputname,
const std::string &q_1,
const std::string &q_2) {
auto has_opposite_charge = [](const int &q_1, const int &q_2) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are here the charges integer but in the other functions floats?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants