Skip to content

Commit f13820d

Browse files
committed
fix: Apply lhcb/RapidSim#76
1 parent 2948047 commit f13820d

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

recipe/76.patch

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
From 536e59060ade6da0723c8d437995c38181f12593 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?L=C3=A9a?= <lea.dreyfus@cern.ch>
3+
Date: Wed, 22 Oct 2025 11:18:53 +0200
4+
Subject: [PATCH 1/2] Changed minimum required version to 3.5 because of
5+
deprecated errors using newer CMAKE versions
6+
7+
---
8+
CMakeLists.txt | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/CMakeLists.txt b/CMakeLists.txt
12+
index 8615163..35b0f2f 100644
13+
--- a/CMakeLists.txt
14+
+++ b/CMakeLists.txt
15+
@@ -1,5 +1,5 @@
16+
# CMAKE CONFIG
17+
-CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR )
18+
+CMAKE_MINIMUM_REQUIRED( VERSION 3.5 FATAL_ERROR )
19+
project(RapidSim)
20+
21+
set(CMAKE_VERBOSE_MAKEFILE ON)
22+
23+
From 5262ff357a578ddc1cc6aad67c94560764743797 Mon Sep 17 00:00:00 2001
24+
From: =?UTF-8?q?L=C3=A9a?= <lea.dreyfus@cern.ch>
25+
Date: Wed, 22 Oct 2025 11:24:09 +0200
26+
Subject: [PATCH 2/2] Changed all instances of gRandom->GetSeed() and
27+
gRandom->SetSeed() to gRandom->TRandom::GetSeed() /
28+
gRandom->TRandom::SetSeed()
29+
30+
---
31+
src/RapidConfig.cc | 6 +++---
32+
src/RapidExternalEvtGen.cc | 2 +-
33+
2 files changed, 4 insertions(+), 4 deletions(-)
34+
35+
diff --git a/src/RapidConfig.cc b/src/RapidConfig.cc
36+
index 2ba85f6..4af94ce 100644
37+
--- a/src/RapidConfig.cc
38+
+++ b/src/RapidConfig.cc
39+
@@ -297,7 +297,7 @@ bool RapidConfig::loadDecay() {
40+
bool RapidConfig::loadConfig() {
41+
std::cout << "INFO in RapidConfig::loadConfig : attempting to load configuration from file: " << fileName_+".config" << std::endl;
42+
43+
- gRandom->SetSeed(0.);
44+
+ gRandom->TRandom::SetSeed(0.);
45+
46+
std::ifstream fin;
47+
fin.open(fileName_+".config", std::ifstream::in);
48+
@@ -447,9 +447,9 @@ bool RapidConfig::configParticle(unsigned int part, TString command, TString val
49+
bool RapidConfig::configGlobal(TString command, TString value) {
50+
if(command=="seed") {
51+
int seed = value.Atoi();
52+
- gRandom->SetSeed(seed);
53+
+ gRandom->TRandom::SetSeed(seed);
54+
std::cout << "INFO in RapidConfig::configGlobal : setting seed for random number generation to " << seed << "." << std::endl
55+
- << " seed is now " << gRandom->GetSeed() << "." << std::endl;
56+
+ << " seed is now " << gRandom->TRandom::GetSeed() << "." << std::endl;
57+
} else if(command=="acceptance") {
58+
std::cout << "INFO in RapidConfig::configGlobal : setting acceptance type to " << value << "." << std::endl;
59+
acceptanceType_ = RapidAcceptance::typeFromString(value);
60+
diff --git a/src/RapidExternalEvtGen.cc b/src/RapidExternalEvtGen.cc
61+
index 0c44beb..63405c1 100644
62+
--- a/src/RapidExternalEvtGen.cc
63+
+++ b/src/RapidExternalEvtGen.cc
64+
@@ -124,7 +124,7 @@ bool RapidExternalEvtGen::setupGenerator() {
65+
std::list<EvtDecayBase*> extraModels;
66+
67+
// Define the random number generator
68+
- uint seed = gRandom->GetSeed();
69+
+ uint seed = gRandom->TRandom::GetSeed();
70+
randomEngine = new EvtMTRandomEngine(seed);
71+
72+
bool useEvtGenRandom(false);

recipe/recipe.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ source:
1515
- 0001-Update-CMakeLists.txt.patch
1616
- 0002-Fix-linking-to-evtgen-on-macOS.patch
1717
- 0003-Remove-Werror-for-CMAKE_CXX_FLAGS.patch
18+
- 76.patch
1819

1920
build:
2021
number: 23

0 commit comments

Comments
 (0)