Skip to content

Commit

Permalink
Merge pull request #8938 from mseidel42/pythia8310
Browse files Browse the repository at this point in the history
Pythia 8.311
  • Loading branch information
cmsbuild authored May 1, 2024
2 parents 372626e + 615e250 commit 1d4e791
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
39 changes: 39 additions & 0 deletions evtgen-2.0.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,42 @@

template <class T>
class EvtMatrix {

--- a/EvtGenExternal/EvtPythiaEngine.hh
+++ b/EvtGenExternal/EvtPythiaEngine.hh
@@ -82,7 +82,7 @@

bool _convertPhysCodes, _initialised, _useEvtGenRandom;

- std::unique_ptr<EvtPythiaRandom> _evtgenRandom;
+ std::shared_ptr<EvtPythiaRandom> _evtgenRandom;

std::map<int, int> _addedPDGCodes;
};

--- a/src/EvtGenExternal/EvtPythiaEngine.cpp
+++ b/src/EvtGenExternal/EvtPythiaEngine.cpp
@@ -75,7 +75,7 @@
// from EvtGen for Pythia 8.
_useEvtGenRandom = useEvtGenRandom;

- _evtgenRandom = std::make_unique<EvtPythiaRandom>();
+ _evtgenRandom = std::make_shared<EvtPythiaRandom>();

_initialised = false;
}
@@ -128,8 +128,13 @@

// Set the random number generator
if ( _useEvtGenRandom == true ) {
+#if PYTHIA_VERSION_INTEGER < 8310
_genericPythiaGen->setRndmEnginePtr( _evtgenRandom.get() );
_aliasPythiaGen->setRndmEnginePtr( _evtgenRandom.get() );
+#else
+ _genericPythiaGen->setRndmEnginePtr( _evtgenRandom );
+ _aliasPythiaGen->setRndmEnginePtr( _evtgenRandom );
+#endif
}

_genericPythiaGen->init();

5 changes: 1 addition & 4 deletions pythia8.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
### RPM external pythia8 309
### RPM external pythia8 311

Source: https://pythia.org/download/pythia83/%{n}%{realversion}.tgz
# https://gitlab.com/Pythia8/releases/-/issues/289: fix compilation of C++20 code with pythia8
Patch0: pythia8_309-289

Requires: hepmc hepmc3 lhapdf

%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} --enable-mg5mes

Expand Down
31 changes: 0 additions & 31 deletions pythia8_309-289.patch

This file was deleted.

0 comments on commit 1d4e791

Please sign in to comment.