Conversation
…et corrections in the same way '
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| CodeStyle | 1 minor |
🟢 Metrics 6 complexity · 0 duplication
Metric Results Complexity 6 Duplication 0
TIP This summary will be updated as you push new changes. Give us feedback
There was a problem hiding this comment.
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 explicitis_data,is_dyjets, andis_wjetsboolean flags; made_remove_empty_configkeys()safe against mutation during iteration. - Added
.codexto.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.
| #include "../include/utility/Logger.hxx" | ||
| #include "ROOT/RDataFrame.hxx" | ||
| #include "TRandom3.h" | ||
| #include <cmath> |
| 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: |
| 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 |
There was a problem hiding this comment.
Why is this needed? This is already done by the if else above.
| None | ||
| """ | ||
| for key in config: | ||
| for key in list(config.keys()): |
There was a problem hiding this comment.
Was this breaking anything?
| return static_cast<int>(reco_q == static_cast<int>(emb_q_1) || | ||
| reco_q == static_cast<int>(emb_q_2)); |
| 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) { |
There was a problem hiding this comment.
Why are here the charges integer but in the other functions floats?
No description provided.