Skip to content

Add HepMC3 input source - #51842

Merged
cmsbuild merged 1 commit into
cms-sw:masterfrom
tvami:hepmc3-input-source
Sep 15, 2026
Merged

cmsbuild merged 1 commit into
cms-sw:masterfrom
tvami:hepmc3-input-source

Conversation

@tvami

@tvami tvami commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

PR description:

Adds MCFileSource3, an input source reading HepMC3 event files, the HepMC3 counterpart of MCFileSource. CMSSW already has edm::HepMC3Product and GenEventInfoProduct3 as event records, and BaseEvtVtxGenerator, GeneratorSmearedProducer, GenParticleProducer and RunManagerMTWorker already consume them, but there was no way to get an externally produced HepMC3 file into the framework.

New HepMC3FileReader wraps HepMC3::deduce_reader, so ASCII HepMC3, ASCII HepMC2, LHEF and HEPEVT files (and their compressed flavours) are all accepted, a list of files is read as a single event stream, and units are forced to GeV/mm. The source puts HepMC3Product and GenEventInfoProduct3 with instance label generator, has fillDescriptions, and takes an untracked printEvent flag to dump the event content.

No change to any existing output: the new source is only used if a configuration asks for it.

PR validation:

New test configuration IOMC/Input/test/testReader3_cfg.py. Validated on a 100 event HepMC3 file with displaced dimuon decays:

  • all 100 events read, products written, EOF ends the job cleanly; read-back reproduces particles, vertices, units and weights exactly;
  • source -> VtxSmeared -> generatorSmeared runs, giving HepMC3Product at each step;
  • the same events converted to ASCII HepMC2 and read with MCFileSource give bit-identical reco::GenParticle collections: 700 particles, zero difference in pdgId, status, four-momentum, mass, production vertex and mother/daughter structure, and identical event weights;
  • an ASCII HepMC2 file read directly with MCFileSource3 works, confirming the format deduction;

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

Not a backport, no backport foreseen.

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

A new Pull Request was created by @tvami for master.

It involves the following packages:

  • IOMC/Input (core)

@Dr15Jones, @cmsbuild, @makortel, @smuzaffar can you please review it and eventually sign? Thanks.
@fabiocos this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@tvami

tvami commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild please test

@tvami

tvami commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

FYI @cms-sw/generators-l2
(this is part of a bigger project supporting HEPMC3)

@cmsbuild

cmsbuild commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-156d9c/55761/summary.html
COMMIT: 765439e
CMSSW: CMSSW_20_1_X_2026-09-08-2300/el9_amd64_gcc14
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/51842/55761/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 2 lines to the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3592269
  • DQMHistoTests: Total failures: 20
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3592231
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

@tvami

tvami commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

hi @makortel I have a few things waiting on the top of this, could you please review and sign?

@makortel makortel left a comment

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.

Thanks for the ping

Comment thread IOMC/Input/interface/HepMC3FileReader.h
Comment thread IOMC/Input/interface/MCFileSource3.h Outdated
Comment thread IOMC/Input/src/SealModule.cc Outdated
Comment thread IOMC/Input/test/testReader3_cfg.py
@makortel

makortel commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

I wonder though why IOMC/Input package is under core review instead of @cms-sw/generators-l2 or @cms-sw/simulation-l2

@tvami

tvami commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

I wonder though why IOMC/Input package is under core review instead of @cms-sw/generators-l2 or @cms-sw/simulation-l2

I guess IO was meant to for core? haha not sure. But for the record GEN L2s have already agreed and are happy about this change, tagging @lviliani directly

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #51842 was updated. @Dr15Jones, @cmsbuild, @makortel, @smuzaffar can you please check and sign again.

@tvami

tvami commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@makortel thanks for your review, I've changed things according to your comments

@tvami

tvami commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild please test

Comment thread IOMC/Input/test/testReader3_cfg.py
@tvami

tvami commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 20KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-156d9c/55865/summary.html
COMMIT: 26ef5dd
CMSSW: CMSSW_20_1_X_2026-09-14-1100/el9_amd64_gcc14
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/51842/55865/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 1 lines to the logs
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 45
  • DQMHistoTests: Total histograms compared: 3593067
  • DQMHistoTests: Total failures: 28
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3593021
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 44 files compared)
  • Checked 195 log files, 163 edm output root files, 45 DQM output files
  • TriggerResults: no differences found

@tvami

tvami commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

hi @makortel do you have any further comments, or is this ready for your approval?

@makortel

Copy link
Copy Markdown
Contributor

Comparison differences are related to #47071

@makortel

Copy link
Copy Markdown
Contributor

+core

@cmsbuild

Copy link
Copy Markdown
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @ftenchini, @mandrenguyen, @sextonkennedy (and backports should be raised in the release meeting by the corresponding L2)

@ftenchini

Copy link
Copy Markdown
Contributor

+1

@cmsbuild
cmsbuild merged commit 0e6d2cc into cms-sw:master Sep 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants