Hi Mohammad,
Geant4 does not use the random number generator from Root, but from CLHEP, that's why I considered it as misleading to implement setting its seed via gRandom.
The reason is that this way would not allow you to re-process a run or event from a previous simulation by storing gRandom status and restoring it in a new simulation, as gRandom status has nothing to do with the random generator used by Geant4.
The command
/random/resetEngineFrom current.rnd
should be used together with a file stored via Geant4
commands
/random/saveThisRun
/random/saveThisEvent
If you try the command and look at the file, you
will see that there is more data than just one long number.
You can use gRandom->GetSeed() (=mySeed) number for setting
initial seed:
/random/setSeeds mySeed mySeed
(G4 setSeeds requires at least two long values)
but a question is what it will be good for.
A possible solution to handle the different random generators in a common way via VMC could be to interface the appropriate functions for storing/restoring the generator status.
Best regards,
Ivana
Mohammad Al-Turany wrote:
> Hallo,
>
> As you all know to set the Random seed in G3_VMC it is enough to use
> gRandom->SetSeed(seed), in G4_VMC this does not work, and what I do to
> set the seed is to go via the g4config.in macro and put there:
>
> /random/resetEngineFrom seed.rnd
>
> Where seed.rnd is an ASCII file containing my seeds.
>
> Is it possible to unify this behavior and to pass the seed from gRandom
> to the G4_VMC in the initialization? Or do you have any other suggestion?
>
> Regards
>
> Mohammad
>
-- ============================================================== e-mail: Ivana.Hrivnacova_at_cern.ch address: Institut Physique Nucleaire, 91406 Orsay, France phone: (33) 01 69 15 65 94 ==============================================================Received on Mon Oct 05 2009 - 11:33:15 CEST
This archive was generated by hypermail 2.2.0 : Mon Oct 05 2009 - 17:25:01 CEST