From fe13f1df603d1df74ba6147cec1f3f96847db039 Mon Sep 17 00:00:00 2001 From: Ka Wa Ho Date: Mon, 18 May 2026 13:56:21 -0500 Subject: [PATCH 1/4] update spec file for EvtGen v3 --- evtgen.spec | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/evtgen.spec b/evtgen.spec index a00f67e41b7..3f490bee30c 100644 --- a/evtgen.spec +++ b/evtgen.spec @@ -1,10 +1,5 @@ -### RPM external evtgen 2.0.0 - -%define tag bcb7af4d35bf66a01c08fa4f8fffb623b7e24c59 -%define branch cms/%realversion -%define github_user cms-externals - -Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz +### RPM external evtgen 03.00.00-beta1 +Source: http://www.hepforge.org/archive/evtgen/EvtGen-%{realversion}.tar.gz BuildRequires: cmake @@ -14,23 +9,17 @@ Requires: pythia8 Requires: tauolapp Requires: photospp -# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40267 -# libgfortranbegin.a is finally removed and was obsolete since GCC 4.5 -#Patch0: evtgen-1.6.0-configure-new-gcc -Patch0: evtgen-2.0.0 - %define keep_archives true %prep -%setup -q -n %{n}-%{realversion} -%patch0 -p1 +%setup -q -n EvtGen %build rm -rf ../build mkdir ../build cd ../build -cmake -DCMAKE_INSTALL_PREFIX:PATH=%{i} ../%{n}-%{realversion} \ +cmake -DCMAKE_INSTALL_PREFIX:PATH=%{i} ../EvtGen/R03-00-00-beta1\ -DEVTGEN_HEPMC3:BOOL=OFF -DHEPMC2_ROOT_DIR:PATH=$HEPMC_ROOT \ -DEVTGEN_PYTHIA:BOOL=ON -DPYTHIA8_ROOT_DIR:PATH=$PYTHIA8_ROOT \ -DEVTGEN_PHOTOS:BOOL=ON -DPHOTOSPP_ROOT_DIR:PATH=$PHOTOSPP_ROOT \ From ae4090fb4319bc4a4ec33e2a40788865713c3fc7 Mon Sep 17 00:00:00 2001 From: Ka Wa Ho Date: Mon, 18 May 2026 15:37:26 -0500 Subject: [PATCH 2/4] patch for pythia8 with the EvtGenv3 --- pythia8-evtgen3.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ pythia8.spec | 3 +++ 2 files changed, 45 insertions(+) create mode 100644 pythia8-evtgen3.patch diff --git a/pythia8-evtgen3.patch b/pythia8-evtgen3.patch new file mode 100644 index 00000000000..ac8fe689b4a --- /dev/null +++ b/pythia8-evtgen3.patch @@ -0,0 +1,42 @@ +--- a/include/Pythia8Plugins/EvtGen.h.orig 2026-01-20 15:52:30.000000000 -0600 ++++ b/include/Pythia8Plugins/EvtGen.h 2026-05-18 14:10:47.647205823 -0500 +@@ -36,9 +36,15 @@ + // Return a random number. + double random() {if (rndmPtr) return rndmPtr->flat(); else return -1.0;} + ++ void setSeed(unsigned long int seed) override {lastSeedVal = seed;} ++ unsigned long int lastSeed() const override {return lastSeedVal;} ++ + // The random number pointer. + Rndm *rndmPtr; + ++private: ++ unsigned long int lastSeedVal{0}; ++ + }; + + //========================================================================== +@@ -434,12 +440,11 @@ + + // Loop over the EvtGen entries. + if (!pythiaPtr) return; +- EvtDecayTable *egTable = EvtDecayTable::getInstance(); +- if (!egTable) return; ++ EvtDecayTable &egTable = EvtDecayTable::getInstance(); + for (int iEntry = 0; iEntry < (int)EvtPDL::entries(); ++iEntry) { + EvtId egId = EvtPDL::getEntry(iEntry); + int pyId = EvtPDL::getStdHep(egId); +- if (egTable->getNModes(egId) == 0) continue; ++ if (egTable.getNModes(egId) == 0) continue; + if (excIds.find(pyId) != excIds.end()) continue; + + // Stop Pythia from decaying the particle and include in decay set. +@@ -462,7 +467,7 @@ + if (!final) continue; + + // Get the signal and background decay modes. +- vector egList = egTable->getDecayTable(); ++ vector egList = egTable.getDecayTable(); + int sigIdx = egId.getAlias(); + int bkgIdx = EvtPDL::evtIdFromStdHep(pyId).getAlias(); + if (sigIdx > (int)egList.size() || bkgIdx > (int)egList.size()) continue; diff --git a/pythia8.spec b/pythia8.spec index 570f9a6402b..0dea1dd9331 100644 --- a/pythia8.spec +++ b/pythia8.spec @@ -4,8 +4,11 @@ Source: https://pythia.org/download/pythia83/%{n}%{realversion}.tgz Requires: hepmc hepmc3 lhapdf +Patch0: pythia8-evtgen3 + %prep %setup -q -n %{n}%{realversion} +%patch0 -p1 ./configure --prefix=%i --enable-shared --with-hepmc2=${HEPMC_ROOT} --with-hepmc3=${HEPMC3_ROOT} --with-lhapdf6=${LHAPDF_ROOT} --with-mg5mes From d8459612752b20870ad15e0dffb55ebb4dbc0cf3 Mon Sep 17 00:00:00 2001 From: Ka Wa Ho Date: Fri, 22 May 2026 16:53:48 -0500 Subject: [PATCH 3/4] bump evtgen to 3.0.0; disable sherpa mpi --- evtgen-3.0.0.patch | 20 ++++++++++++++++++++ evtgen.spec | 9 +++++++-- sherpa.spec | 5 ----- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 evtgen-3.0.0.patch diff --git a/evtgen-3.0.0.patch b/evtgen-3.0.0.patch new file mode 100644 index 00000000000..fbbc5c9373f --- /dev/null +++ b/evtgen-3.0.0.patch @@ -0,0 +1,20 @@ ++++ a/R03-00-00/src/EvtGenExternal/EvtSherpaPhotons.cpp.orig 2026-05-22 11:42:50.932434652 -0500 ++++ b/R03-00-00/src/EvtGenExternal/EvtSherpaPhotons.cpp 2026-05-22 11:42:23.583029106 -0500 +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + using std::endl; + ++++ a/R03-00-00/EvtGenExternal/EvtSherpaPhotons.hh.orig 2026-05-22 11:42:50.932434652 -0500 ++++ b/R03-00-00/EvtGenExternal/EvtSherpaPhotons.hh 2026-05-22 11:42:23.583029106 -0500 +@@ -32,6 +32,7 @@ + #include "SHERPA/Main/Sherpa.H" + + #include ++#include + + class EvtParticle; + class EvtAbsExternalGen; diff --git a/evtgen.spec b/evtgen.spec index 3f490bee30c..fe5eb742b8d 100644 --- a/evtgen.spec +++ b/evtgen.spec @@ -1,4 +1,4 @@ -### RPM external evtgen 03.00.00-beta1 +### RPM external evtgen 03.00.00 Source: http://www.hepforge.org/archive/evtgen/EvtGen-%{realversion}.tar.gz BuildRequires: cmake @@ -6,22 +6,27 @@ BuildRequires: cmake Requires: cmake Requires: hepmc Requires: pythia8 +Requires: sherpa Requires: tauolapp Requires: photospp +Patch0: evtgen-3.0.0 + %define keep_archives true %prep %setup -q -n EvtGen +%patch0 -p1 %build rm -rf ../build mkdir ../build cd ../build -cmake -DCMAKE_INSTALL_PREFIX:PATH=%{i} ../EvtGen/R03-00-00-beta1\ +cmake -DCMAKE_INSTALL_PREFIX:PATH=%{i} ../EvtGen/R03-00-00\ -DEVTGEN_HEPMC3:BOOL=OFF -DHEPMC2_ROOT_DIR:PATH=$HEPMC_ROOT \ -DEVTGEN_PYTHIA:BOOL=ON -DPYTHIA8_ROOT_DIR:PATH=$PYTHIA8_ROOT \ + -DEVTGEN_SHERPA3:BOOL=OFF -DEVTGEN_SHERPA:BOOL=ON -DSHERPA_ROOT_DIR:PATH=$SHERPA_ROOT \ -DEVTGEN_PHOTOS:BOOL=ON -DPHOTOSPP_ROOT_DIR:PATH=$PHOTOSPP_ROOT \ -DEVTGEN_TAUOLA:BOOL=ON -DTAUOLAPP_ROOT_DIR:PATH=$TAUOLAPP_ROOT diff --git a/sherpa.spec b/sherpa.spec index 293f2d15b3b..d87d8db3f25 100644 --- a/sherpa.spec +++ b/sherpa.spec @@ -34,13 +34,8 @@ export PYTHON=$(which python3) --enable-pyext \ --enable-ufo \ ${OPENLOOPS_ROOT+--enable-openloops=$OPENLOOPS_ROOT} \ - --enable-mpi \ --with-sqlite3=$SQLITE_ROOT \ --enable-analysis \ - CC="mpicc" \ - CXX="mpicxx" \ - MPICXX="mpicxx" \ - FC="mpifort" \ CXXFLAGS="-fuse-cxa-atexit $ARCH_CMSPLATF -O2 -std=c++0x -I$LHAPDF_ROOT/include -I$BLACKHAT_ROOT/include -I$RIVET_ROOT/include" \ LDFLAGS="-ldl -L$BLACKHAT_ROOT/lib/blackhat -L$QD_ROOT/lib" From 8089a4f91fc2ce2f46bc7231f3228f8368e1b6d5 Mon Sep 17 00:00:00 2001 From: Ka Wa Ho Date: Sat, 23 May 2026 12:23:29 -0500 Subject: [PATCH 4/4] add back mpi to sherpa --- sherpa.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sherpa.spec b/sherpa.spec index d87d8db3f25..293f2d15b3b 100644 --- a/sherpa.spec +++ b/sherpa.spec @@ -34,8 +34,13 @@ export PYTHON=$(which python3) --enable-pyext \ --enable-ufo \ ${OPENLOOPS_ROOT+--enable-openloops=$OPENLOOPS_ROOT} \ + --enable-mpi \ --with-sqlite3=$SQLITE_ROOT \ --enable-analysis \ + CC="mpicc" \ + CXX="mpicxx" \ + MPICXX="mpicxx" \ + FC="mpifort" \ CXXFLAGS="-fuse-cxa-atexit $ARCH_CMSPLATF -O2 -std=c++0x -I$LHAPDF_ROOT/include -I$BLACKHAT_ROOT/include -I$RIVET_ROOT/include" \ LDFLAGS="-ldl -L$BLACKHAT_ROOT/lib/blackhat -L$QD_ROOT/lib"