Skip to content

Commit 121572c

Browse files
committed
Use new methods to seed Pythia8
1 parent 633ed67 commit 121572c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ using namespace Pythia8;
99
#endif
1010

1111
// Default pythia8 minimum bias generator
12-
1312
class GeneratorPythia8ALICE3 : public o2::eventgen::GeneratorPythia8
1413
{
1514
public:
@@ -18,20 +17,16 @@ public:
1817
GeneratorPythia8ALICE3() {
1918

2019
char* alien_proc_id = getenv("ALIEN_PROC_ID");
21-
uint64_t seedFull;
22-
uint64_t seed = 0;
20+
int64_t seed = 0;
2321

2422
if (alien_proc_id != NULL) {
25-
seedFull = static_cast<uint64_t>(atol(alien_proc_id));
26-
for(int ii=0; ii<29; ii++) // there might be a cleaner way but this will work
27-
seed |= ((seedFull) & (static_cast<uint64_t>(1) << static_cast<uint64_t>(ii)));
28-
LOG(info) << "Value of ALIEN_PROC_ID: " << seedFull <<" truncated to 0-28 bits: "<<seed<<endl;
23+
seed = static_cast<int64_t>(atol(alien_proc_id));
2924
} else {
3025
LOG(info) << "Unable to retrieve ALIEN_PROC_ID";
3126
LOG(info) << "Setting seed to 0 (random)";
3227
seed = 0;
3328
}
34-
mPythia.readString("Random:seed = "+std::to_string(static_cast<int>(seed)));
29+
setInitialSeed(seed);
3530
}
3631

3732
/// Destructor

0 commit comments

Comments
 (0)