File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,20 @@ public:
1818 GeneratorPythia8ALICE3 () {
1919
2020 char * alien_proc_id = getenv ("ALIEN_PROC_ID" );
21- int seed ;
21+ uint64_t seedFull ;
22+ uint64_t seed = 0 ;
2223
2324 if (alien_proc_id != NULL ) {
24- seed = atoi (alien_proc_id );
25- LOG (info ) << "Seed set to ALIEN_PROC_ID: " << seed ;
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 ;
2629 } else {
2730 LOG (info ) << "Unable to retrieve ALIEN_PROC_ID" ;
2831 LOG (info ) << "Setting seed to 0 (random)" ;
2932 seed = 0 ;
3033 }
31-
32- mPythia .readString ("Random:seed = " + std ::to_string (seed ));
34+ mPythia .readString ("Random:seed = " + std ::to_string (static_cast < int > (seed )));
3335 }
3436
3537 /// Destructor
@@ -40,4 +42,4 @@ public:
4042 FairGenerator * generator_pythia8_ALICE3 ()
4143 {
4244 return new GeneratorPythia8ALICE3 ();
43- }
45+ }
You can’t perform that action at this time.
0 commit comments