|Message: Random Number Generation||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I've realized that the source of several problems I have been having has been due to my lack of understanding of the Geant random number engines. From what I understand, if you don't specify a random number generator engine, it uses the default (HepJamesRandom).
My goal is to be able to repeat a specific event by using the following macro command: /random/resetEngineFrom run0evt0.rndm. That said, I have no problem generating run#evt###.rndm files. The issue here is duplicating them after a run.
In my main() function, if I do not specify a random number generator, it uses the same seed every time (*). If I do specify a random number generator, I get a different seed every time, which is what I want. However, if I try to run my code using /random/resetEngineFrom run#evt###.rndm (using a seed from a specific event which I would like to repeat), I do not duplicate the results. I am curious about how this works. Does /random/resetEngineFrom override my code in main()? In main() I have:
time_t systime = time(NULL);
long seed = (long) systime;
It seems like it should if the command works as intended, but that is not the case. Additionally, if I try to run with /random/resetEngineFrom run#evt####.rndm and comment out the above code in main(), it simply runs the code using a random seed, --in fact, it uses the same seed I mentioned in (*) and, importantly, this is NOT the seed from run#evt####.rndm.
I need to be able to access the seed in other parts of my code. For example, at one point, I print out
G4cout << "SEED: " << theSeed << G4endl;
If I look at the standard output, however, I see
SEED: 0 --------- Ranecu engine status --------- Initial seed (index) = 58 Current couple of seeds = 571385019, 1602100966 ----------------------------------------
I must not be accessing the correct seed when I do this. Can anyone point me in the right direction? Perhaps I have not found the documentation or examples that I need.
|Inline Depth:||Outline Depth:||Add message:|