I’m in the process of moving my geant4 simulation onto a different computer, and I want to verify the results by comparing the outputs on the two different computers. I was able to figure out how to get the run seeds to be the same using /random/setSeeds. However, even though the run seeds are the same, the event seeds (in currentEvent.rndm in seeds directory) are different for the last/current run. I don’t understand how I’m getting different event seeds despite my run seeds being identical. Is there a way to further set the seeds so that the output should be identical?
if you have multithreading enabled, the seeding is afaik a bit more complicated. One option would be to switch of MT, and see if that solves it for you.
If not:
I have managed to reproduce identical results on very different machines (windows/linux, different number of threads in multithreading) with the following (probably very inefficient) procedure:
for relevant/all events, obtain the respective seeds, e.g., in a sensitive detector
for replay, the output file for the ntuple was read back into two vectors, and passed to the PrimaryGeneratorAction class / GeneratePrimaries function, and for each eventID, directly prior to each fGeneralParticleSource->GeneratePrimaryVertex(anEvent) the random number state is reset to