Skip to content

Remove explicit ROOT library loads no longer needed with ROOT 6.42 - #769

Open
bendavid wants to merge 3 commits into
WMass:mainfrom
bendavid:root-6.42-remove-explicit-loads
Open

bendavid wants to merge 3 commits into
WMass:mainfrom
bendavid:root-6.42-remove-explicit-loads

Conversation

@bendavid

@bendavid bendavid commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

With ROOT 6.42 (the v69 image), the explicit narf.clingutils.Load calls for libPhysics, libROOTVecOps, libROOTDataFrame and libHist aren't needed: ROOT loads these libraries automatically. They're removed from:

  • wremnants/production/lowpu.py, along with their comments. The comment about lowpu_efficiencies.h needing libPhysics was out of date anyway: the low-PU headers no longer use any libPhysics classes.

  • scripts/histmakers/mz_5TeV.py, for both --muonCorr rochester and --muonCorr scarekit.

  • wremnants/production/__init__.py (libHist). It was added in 2024 for TF1 in EtaPtCorrelatedEfficiency.hpp, when that version of ROOT needed it. libHist isn't loaded yet at this point, but ROOT 6.42 now loads it on demand when compiled code first uses it. import narf is kept, marked # noqa: F401, for its side effects (narf's include path and RDataFrame extensions).

Tested on the v69 image with this change:

  • Importing wremnants.production.lowpu, which declares all the low-PU headers, works. All three libraries are in fact already loaded at that point, so the explicit loads weren't doing anything.
  • These all work and give sensible values:
    • wrem::lepSF_HLT_var_mu and wrem::Egamma_undoCorrection, which use RVec, called directly and through an RDataFrame Define;
    • constructing wrem::RoccoR, which uses TRandom3;
    • declaring lowpu_muonscarekit.hpp and constructing wrem::MuonScarekitMCHelper, as in mz_5TeV.py --muonCorr scarekit.
  • With the libHist load removed, libHist is still not loaded after import narf and import wremnants.production. Declaring EtaPtCorrelatedEfficiency.hpp and constructing wrem::EtaPtCorrelatedEfficiency (which creates three TF1s) then works, with the library loaded on demand.
  • black, isort and flake8 with the CI settings pass on all three files.

The narf submodule is also updated to the head of WMass/narf#3 (bendavid/narf@bb90c05), which removes cppyy workarounds in narf that are no longer needed with ROOT 6.42 (tensor_traits::get_sizes() and the explicit return type of make_hist_shift_helper). WRemnants doesn't use either directly, so CI here also tests narf#3. The narf pointer should be moved to the merge commit once WMass/narf#3 is merged.

🤖 Generated with Claude Code

bendavid and others added 3 commits November 10, 2026 11:29
libPhysics, libROOTVecOps and libROOTDataFrame are loaded automatically when the low-PU headers are
declared (they are in fact already loaded by then), so the explicit narf.clingutils.Load calls in
wremnants/production/lowpu.py and scripts/histmakers/mz_5TeV.py are not needed. The low-PU headers no
longer use any libPhysics classes either.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ROOT 6.42 loads libHist automatically when JIT-compiled code first uses it (e.g. TF1 in
EtaPtCorrelatedEfficiency.hpp, the reason it was added in 2024). The narf import is kept, marked as
intentional, for its side effects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant