I found a major problem in the management of random number. This problem seems to be strongly coupled with CLHEP. Currently it is impossible to reproduce an event, whose status of random number is stored via "/run/storeRandomNumberStatus" command, even if the status is restored via "/run/restoreRandomNumberStatus" command. In my examination, this probrem is due to the implementation of at least "RandFlat::shootBit()" and "RandGauss::shoot()" in CLHEP. "RandFlat" class and "RandGauss" class have their own static members for keeping their internal status. So, even if store/restore a random engine, its sequence depends on these "uncontrollable" variables whenever these methods are called. Until now, I found at least the above two methods cause this problem.
Thanks for reporting the problem. This is a known problem which has only recently been resolved in CLHEP 1.5 by providing alternative Gaussian random distribution algorithms. Concerning Geant4, we did not manage to migrate the code in time for release 2.0. We plan to make this available in a minor release or patch.
All occurences of RandGauss have been replaced by G4RandGauss which in turns now invokes CLHEP's RandGaussQ, which being stateless assures reproducibility of gaussian random sequences (claimed to be also much faster, though less accurate). All occurences of RandFlat::shootBit() have been replaced by CLHEP's RandBit::shootBit(), a simpler but less efficient implementation for generating sequences of bits.
Fixes will be available in the public patch to Geant4 2.0.
The CLHEP code now has provision for saving and restoring the state of the random number generator, including the cached data from RandGauss and RandFlat, by using the functions HepRandom::saveStaticRandomStates and HepRandom::restoreStaticRandomStates. To avoid problems for people that, not knowing about this issue, might use RandGauss or RandFlat in their code, I suggest that the lines G4Random::saveFullState(oss); in G4RunManager should be changed to G4Random::saveStaticRandomStates(oss); ~ ~ ~ ~