Skip to content

upgrade EvtGen interface for v03.00.00 #51029

Open
kawaho wants to merge 8 commits into
cms-sw:masterfrom
kawaho:EvtGev3
Open

upgrade EvtGen interface for v03.00.00 #51029
kawaho wants to merge 8 commits into
cms-sw:masterfrom
kawaho:EvtGev3

Conversation

@kawaho
Copy link
Copy Markdown

@kawaho kawaho commented May 25, 2026

PR description:

Resolves #50935

This commits upgrade EvtGen interface to v03.00.00 in CMSSW, which

  1. is now thread-safe, allowing multithreading in production
  2. adds new final state photon radiation models in Sherpa/Photon++ and Vincia
  3. includes new physics models and decay table implemented by Belle 2

This commit depends on a new cmssw external build cms-sw/cmsdist#10580

PR validation:

Tested by producing a small TTTo2L2Nu Pythia+EvtGen sample locally with multiple threads, using a similar the same fragment as 1 but with PythiaConcurrentHadronizerFilter.

One remaining issue is that the EvtGen interface now calls ThreadHandoff implemented for GEANT4 to ensure a stream started in a certain thread stays in the same thread. Shall we move ThreadHandoff under FWCore/Concurrency instead, so packages with similar concurrency implementation (one instance per thread/use of thread_local) can use the same module? @makortel @Dr15Jones, please advise.

@cmsbuild
Copy link
Copy Markdown
Contributor

cmsbuild commented May 25, 2026

cms-bot internal usage

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49473

ERROR: Build errors found during clang-tidy run.

src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
Suppressed 441 warnings (441 in non-user code).
--
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:35:40: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   35 |   void setSeed(unsigned long int seed) override;
      |                                        ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:338:29: error: no member named 'getSherpaPhotonsModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  338 |     radCorrEngine = genList.getSherpaPhotonsModel(1e-7, 1, 0);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:340:29: error: no member named 'getVinciaQEDModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  340 |     radCorrEngine = genList.getVinciaQEDModel(1.0e-7);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:534:24: error: non-const lvalue reference to type 'EvtDecayTable' cannot bind to a temporary of type 'EvtDecayTable *' [clang-diagnostic-error]
  534 |         EvtDecayTable& evtDecayTable = EvtDecayTable::getInstance();
      |                        ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1178 warnings (1174 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

<use name="FWCore/Concurrency"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Framework"/>
<use name="SimG4Core/Application"/>
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.

(as I commented already in the earlier issue) I think this dependence on SimG4Core should be avoided. I opened #51041 to move the ThreadHandoff to FWCore/Utilities.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thanks, merged

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49482

ERROR: Build errors found during clang-tidy run.

src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
Suppressed 441 warnings (441 in non-user code).
--
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:35:40: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   35 |   void setSeed(unsigned long int seed) override;
      |                                        ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:338:29: error: no member named 'getSherpaPhotonsModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  338 |     radCorrEngine = genList.getSherpaPhotonsModel(1e-7, 1, 0);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:340:29: error: no member named 'getVinciaQEDModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  340 |     radCorrEngine = genList.getVinciaQEDModel(1.0e-7);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:534:24: error: non-const lvalue reference to type 'EvtDecayTable' cannot bind to a temporary of type 'EvtDecayTable *' [clang-diagnostic-error]
  534 |         EvtDecayTable& evtDecayTable = EvtDecayTable::getInstance();
      |                        ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1178 warnings (1174 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49483

ERROR: Build errors found during clang-tidy run.

src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
Suppressed 441 warnings (441 in non-user code).
--
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:35:40: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   35 |   void setSeed(unsigned long int seed) override;
      |                                        ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:338:29: error: no member named 'getSherpaPhotonsModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  338 |     radCorrEngine = genList.getSherpaPhotonsModel(1e-7, 1, 0);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:340:29: error: no member named 'getVinciaQEDModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  340 |     radCorrEngine = genList.getVinciaQEDModel(1.0e-7);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:534:24: error: non-const lvalue reference to type 'EvtDecayTable' cannot bind to a temporary of type 'EvtDecayTable *' [clang-diagnostic-error]
  534 |         EvtDecayTable& evtDecayTable = EvtDecayTable::getInstance();
      |                        ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1178 warnings (1174 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@kawaho
Copy link
Copy Markdown
Author

kawaho commented May 26, 2026

Please undo the merge. A better workflow is to wait for #51041 to be merged first, and then rebase on top of an IB that contains it.

Right...will do

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49486

ERROR: Build errors found during clang-tidy run.

src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
Suppressed 441 warnings (441 in non-user code).
--
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:35:40: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   35 |   void setSeed(unsigned long int seed) override;
      |                                        ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:338:29: error: no member named 'getSherpaPhotonsModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  338 |     radCorrEngine = genList.getSherpaPhotonsModel(1e-7, 1, 0);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:340:29: error: no member named 'getVinciaQEDModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  340 |     radCorrEngine = genList.getVinciaQEDModel(1.0e-7);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:534:24: error: non-const lvalue reference to type 'EvtDecayTable' cannot bind to a temporary of type 'EvtDecayTable *' [clang-diagnostic-error]
  534 |         EvtDecayTable& evtDecayTable = EvtDecayTable::getInstance();
      |                        ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1178 warnings (1174 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@smuzaffar
Copy link
Copy Markdown
Contributor

@kawaho , please update this PR to avoid SimG4Core/Application in GeneratorInterface/ExternalDecays/BuildFile.xml) file and include FWCore/Utilities/interface/ThreadHandoff.h instead of SimG4Core/Application/interface/ThreadHandoff.h in GeneratorInterface/ExternalDecays/interface/EvtGenThreadOwner.h . Once these changes are done then we can start the PR tests again

@makortel
Copy link
Copy Markdown
Contributor

#51041 is now merged and available in IBs since CMSSW_17_0_X_2026-05-27-2300.

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49555

ERROR: Build errors found during clang-tidy run.

src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
Suppressed 441 warnings (441 in non-user code).
--
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:35:40: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   35 |   void setSeed(unsigned long int seed) override;
      |                                        ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:338:29: error: no member named 'getSherpaPhotonsModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  338 |     radCorrEngine = genList.getSherpaPhotonsModel(1e-7, 1, 0);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:340:29: error: no member named 'getVinciaQEDModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  340 |     radCorrEngine = genList.getVinciaQEDModel(1.0e-7);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:534:24: error: non-const lvalue reference to type 'EvtDecayTable' cannot bind to a temporary of type 'EvtDecayTable *' [clang-diagnostic-error]
  534 |         EvtDecayTable& evtDecayTable = EvtDecayTable::getInstance();
      |                        ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1178 warnings (1174 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49582

ERROR: Build errors found during clang-tidy run.

      |                                      ^~~~~~~~
Suppressed 441 warnings (441 in non-user code).
--
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:35:40: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   35 |   void setSeed(unsigned long int seed) override;
      |                                        ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/interface/myEvtRandomEngine.h:37:38: error: only virtual member functions can be marked 'override' [clang-diagnostic-error]
   37 |   unsigned long int lastSeed() const override;
      |                                      ^~~~~~~~
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:63:14: warning: use nullptr [modernize-use-nullptr]
--
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:348:29: error: no member named 'getSherpaPhotonsModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  348 |     radCorrEngine = genList.getSherpaPhotonsModel(1e-7, 1, 0);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:350:29: error: no member named 'getVinciaQEDModel' in 'EvtExternalGenList' [clang-diagnostic-error]
  350 |     radCorrEngine = genList.getVinciaQEDModel(1.0e-7);
      |                     ~~~~~~~ ^
src/GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc:544:24: error: non-const lvalue reference to type 'EvtDecayTable' cannot bind to a temporary of type 'EvtDecayTable *' [clang-diagnostic-error]
  544 |         EvtDecayTable& evtDecayTable = EvtDecayTable::getInstance();
      |                        ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppressed 1178 warnings (1174 in non-user code, 4 NOLINT).
--
gmake: *** [config/SCRAM/GMake/Makefile.coderules:129: code-checks] Error 2
gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 2

@smuzaffar
Copy link
Copy Markdown
Contributor

code-checks with cms.week1.PR_fc95d40b/100.0-b40a4405c86ba87a5ae00696120942d1

@cmsbuild
Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-51029/49583

  • Found files with invalid states:
    • GeneratorInterface/Pythia8Interface/interface/Pythia8EvtGenPatched.h:

Code check has found code style and quality issues which could be resolved by applying following patch(s)

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.

Testing thread-safe EvtGen v3.0.0-beta1 in CMSSW

4 participants