Message: Re: Seed for Random Engines Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

More Re: Seed for Random Engines 

Forum: Run Management
Re: Question Seed for Random Engines
Date: 05 Aug, 2011
From: Gabriele Cosmo <Gabriele Cosmo>

Hi,

> I still have some problems in understanding the setting of the seed for
> the Random Engines. If I set a seed=35678 for an engine in the main of
> the example.cc this seed is used by the engine for each run (/run/beamOn
> ) I start, so that every run produces the same results. Doing more than
> one run by calling /run/beamOn several times, the seed has to be changed
> for each run.

not really. By calling /run/beamOn several times - in the same job - you'll
continue getting different events.
If you re-execute the same job using the same initial seed, you'll of course repeat
the same events sequence.
By either changing the initial seed in your main(), or by changing it before a run
in the same job (i.e. before a /run/beamOn), the event sequence after it will be
different...

> I hope that I am right up to here? What is the easiest way
> to change the seed for each run, by not changing the code and
> recompiling the example?

/random/setSeeds x y
either interactively or in a input macro; where, for Ranecu, x and y can
be any integer number you choose.

> I know that the RanecuEngine takes the seeds
> from a table with 255 entries. But I search a solution for more than 255
> runs.

The table of seeds is only for providing an uncorrelated set of seeds couples
which guarantee no correlation in the pseudo-random generation.
For the purpose of simulating different events, this is not really an issue
though, and you can use any couple of numbers of your choice (possibly
avoiding simple numbers like 0, 1, 2, etc...)...

> Another point is: If I want to produce more than one event, e.g. 1000
> events, during a run (/run/beamOn 1000). Are these 1000 events
> statistically independent, by setting the seed in the way described
> above?

All the 1000 events in a run (/run/beamOn 1000) will be different and have
almost certainly no statistical dependency each other.
Similarly if you repeat a new run of (/run/beamOn 1000) after it, without
exiting the job...

> I started one run with /run/beamOn 100000. After that, I exited from
> the Idle and started a second run /run/beamOn 100000. Before the
> second run I set another seed for the RanecuEngine than in the first run
> with /random/setSeeds. The seeds which have been used are from the
> table which the RanecuEngine uses, with the indexes 0 (for the first run)
> and 2 (for the second run). In spite of using different seeds the results
> of the two runs are the same. Did I something wrong?

If you use /random/setSeeds with Ranecu you must provide a couple of
reasonable numbers, as described above.

Hope it helps.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Question: Re: Seed for Random Engines   (Asja Pfaffenberger - 05 Aug, 2011)
1 Idea: Re: Seed for Random Engines   (Tom Roberts - 05 Aug, 2011)
1 None: Re: Seed for Random Engines   (Asja Pfaffenberger - 05 Aug, 2011)
2 More: Re: Seed for Random Engines   (Gabriele Cosmo - 05 Aug, 2011)
1 Ok: Re: Seed for Random Engines   (Asja Pfaffenberger - 05 Aug, 2011)
... 1 Message(s)
 Add Message Add Message
to: "Re: Seed for Random Engines"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]