|Message: Re: RandomSeed saving in Sensitive Detector||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)|
> If I use CLHEP::HepRandom::showEngineStatus(); in ProcessHits() I see a > different set of seeds for each secondary track. Is this correct?
Yes, because showEngineStatus() shows you the random seeds as they are after the invocation of the last previous random engine request occurring before the execution of this line in the code.
> If so, is one of these the correct seed to use to recall the event?
No, none is correct.
> G4RunManager::GetRunManager()->rndmSaveThisEvent();, both of which save > the last seed that I see printed on the screen?
That, I find a bit odd. Please, read:
"the user may wish to preserve the rndm seed of selected events. At any time in the event, put the following statement:
if (condition) G4RunManager::GetRunManager()->rndmSaveThisEvent();
currentEvent.rndm will be copied to runXXevntYY.rndm"
It is the seeds in the file runXXevntYY.rndm that you must use to reseed your interesting event. Mind you, in your ProcessHits() you may want to make sure that the rndmSaveThisEvent method is only called once for every event and not always when your 'condition' is fulfilled during an invocation of ProcessHits(). You may want to follow the LXe example where the hits (through their collection) are interrogated after the event has finished processing.
> Is there something wrong with trying to save the event from within a SD > object?
No, not in principle.
> I can use the seeds to retrieve a specific event, but it hasn't > been the event that I *want*. Can you recommend any further debugging I > can do?
If it is really true that the seeds stored in the file runXXevntYY.rndm are not reproducing the event as you know it to be from the initial run, then this points to some problem with your simulation. You may be using a second random number generator, or you may be using/reading from a file to initiate your 'primary event'. In the initial run the progam will be somewhere inside the file reading a line but at the rerun the program will read from the top of the file. In that case, you not only need to know the seeds at the beginning of event but also where in the file the program read the information.
To be sure, if all is correct, G4 will reproduce the event from the initial seed.
|Inline Depth:||Outline Depth:||Add message:|