Skip to content

refactor: use edm4eic::momenta() in vm_mass.cxx#96

Open
wdconinc wants to merge 1 commit intomasterfrom
use-edm4eic-momenta
Open

refactor: use edm4eic::momenta() in vm_mass.cxx#96
wdconinc wants to merge 1 commit intomasterfrom
use-edm4eic-momenta

Conversation

@wdconinc
Copy link
Copy Markdown
Contributor

Summary

Replace common_bench::momenta_RC and common_bench::momenta_from_simulation with the canonical edm4eic::momenta() overloads now available in edm4eic/analysis_utils.h.

Since momenta() is overloaded (for RC and MC particle types), explicit lambdas are used in the RDataFrame .Define() calls to select the correct overload.

Also removes the #include "common_bench/mt.h" (already removed in #95) and replaces ROOT::EnableImplicitMT(kNumThreads) with the no-arg form (consistent with all other benchmark scripts).

Depends on: eic/EDM4eic#... — requires the new edm4eic::momenta() overloads to be available in the container.

…ch helpers

Replace common_bench::momenta_RC and common_bench::momenta_from_simulation
with the canonical edm4eic::momenta() overloads now available in
edm4eic/analysis_utils.h. These are type-dispatched overloads taking
ReconstructedParticleData or MCParticleData vectors respectively.

Since momenta() is overloaded, use explicit lambdas in RDataFrame Define
calls to select the correct overload.

Also remove the now-unused #include "common_bench/mt.h" and the
ROOT::EnableImplicitMT(kNumThreads) call is replaced with no-arg form
(consistent with all other benchmark scripts).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 updates the DVMP vm_mass analysis to use the canonical edm4eic::momenta() helpers (for both reconstructed and MC particles), aligning this script with the newer EDM4eic analysis utilities and removing reliance on common_bench momenta helpers and thread-count configuration.

Changes:

  • Replace common_bench::momenta_RC / common_bench::momenta_from_simulation with explicit-lambda calls to the appropriate edm4eic::momenta() overloads in the RDataFrame flow.
  • Remove common_bench/mt.h usage by switching ROOT::EnableImplicitMT(kNumThreads) to ROOT::EnableImplicitMT().
  • Add required EDM4eic/EDM4hep includes for the new momenta helpers and MC particle types.

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


#include "edm4eic/ReconstructedParticleCollection.h"
#include "edm4eic/ReconstructedParticleData.h"
#include "edm4hep/MCParticleCollection.h"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

edm4hep/MCParticleCollection.h is included but this file only uses edm4hep::MCParticleData in the lambda. Consider including the corresponding Data header (or relying on an existing include) instead of the Collection header to reduce dependencies/compile time.

Suggested change
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/MCParticleData.h"

Copilot uses AI. Check for mistakes.
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.

2 participants