Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions evtgen-3.0.0.patch
Original file line number Diff line number Diff line change
@@ -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 <cstring>
#include <iostream>
#include <vector>
+#include <mutex>

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 <string>
+#include <mutex>

class EvtParticle;
class EvtAbsExternalGen;
20 changes: 7 additions & 13 deletions evtgen.spec
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
### 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
Source: http://www.hepforge.org/archive/evtgen/EvtGen-%{realversion}.tar.gz

BuildRequires: cmake

Requires: cmake
Requires: hepmc
Requires: pythia8
Requires: sherpa
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
Patch0: evtgen-3.0.0

%define keep_archives true

%prep
%setup -q -n %{n}-%{realversion}
%setup -q -n EvtGen
%patch0 -p1

%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\
-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

Expand Down
42 changes: 42 additions & 0 deletions pythia8-evtgen3.patch
Original file line number Diff line number Diff line change
@@ -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<EvtParticleDecayList> egList = egTable->getDecayTable();
+ vector<EvtParticleDecayList> egList = egTable.getDecayTable();
int sigIdx = egId.getAlias();
int bkgIdx = EvtPDL::evtIdFromStdHep(pyId).getAlias();
if (sigIdx > (int)egList.size() || bkgIdx > (int)egList.size()) continue;
3 changes: 3 additions & 0 deletions pythia8.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down