Skip to content
Snippets Groups Projects

Fix Geant4 random number initialisation

Merged Florian Uhlig requested to merge f.uhlig/cbmroot:fix_random_seed_geant4 into master
All threads resolved!

Between Root 6.22 and 6.24 the return value of TRandom3::GetSeed() was changed. Since Root 6.24 the function GetSeed returns the current element of the state used to generate the random number which returns a fixed value of 624 for TRandom3. Note that the returned value is not the seed of the generator that was defined with the SetSeed function. To get the seed value which was set by the function SetSeed one neeeds to use the GetSeed() function from the base class (gRandom->TRandom::GetSeed()), Since the function GetSeed is used to initialize the Geant4 random number generator with the same seed value used by Root the previous implementation always set the Geant4 random seed to 624 when using ROOT 6.24 or newer. FairSoft apr21p2 does not have the problem but any later FairSoft version will initialise the Geant4 random number generator with the fixed number 624 irrespective of the seed value defined in Root. This commit fixes the issue and initialises the Geant4 random number generator again with the seed specified by gRandom->SetSeed(). The seed value passed to Geant4 is now also stored in the CbmGeant4Settings such that one can contoll the seed value from the transport file.

Merge request reports

Merge request pipeline #22835 passed

Merge request pipeline passed for 02a1fedc

Approved by

Merged by Volker FrieseVolker Friese 2 years ago (Jun 23, 2023 2:14pm UTC)

Merge details

  • Changes merged into master with 0441cf82 (commits were squashed).
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #22836 passed

Pipeline passed for 0441cf82 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Pierre-Alain Loizeau approved this merge request

    approved this merge request

  • Florian Uhlig added 1 commit

    added 1 commit

    • 5c2cb5a2 - Fix Geant4 random number initialisation

    Compare with previous version

  • Volker Friese added 1 commit

    added 1 commit

    Compare with previous version

  • Volker Friese resolved all threads

    resolved all threads

  • Volker Friese enabled an automatic merge when the pipeline for 02a1fedc succeeds

    enabled an automatic merge when the pipeline for 02a1fedc succeeds

  • merged

  • Please register or sign in to reply
    Loading