Re: random generator and seed

From: Marc Escalier <escalier_at_lal.in2p3.fr>
Date: Fri, 4 Mar 2011 23:02:46 +0100


thanks a lot Jason and John

the help you have provided me gave me a huge step

thanks a lot




On Fri, 4 Mar 2011, John Idarraga wrote:

> Hello Marc,
>
> Well, if I understand correctly TRandom3 has an spectacularly big period. So
> the first pathology of you option B is that your period becomes the overflow
> of your iterator that for an Int_t is quite small (4294967295 ~1E9). So you
> just killed your period. I wouldn't use option B.
>
> cheers,
>
> John
>
> On 03/04/2011 09:21 PM, Marc Escalier wrote:r
>> Hello,
>>
>> when one is using a random generator as, for example TRandom3,
>> one can choose a given seed, with myrandom3.SetSeed(MyValue)
>>
>> one could do the following to make a smearing of a given variable inside a
>> file, according to a gaussian centred to 0) :
>>
>> (option A) :
>> myrandom3.SetSeed(a given seed);
>> for (...) {
>> ...
>> myrandom3.Gaus(0,a given value);
>> make the correction to the variable
>> ...
>> }
>>
>> (option B)
>> for (...) {
>> ...
>> myrandom3.SetSeed(TheEventNumberOfAFile); //for example one needs to
>> smear a variable inside a file
>> // for which each event has a different event number
>> myrandom3.Gaus(0,a given value);
>> make the correction to the variable
>> ...
>> }
>>
>> Is there a "pathology" in the option B in terms of distribution of the
>> random numbers ?
>>
>> (there are no problems, just asking a naive question)
>>
>> thanks
>>
>
>
Received on Fri Mar 04 2011 - 23:02:54 CET

This archive was generated by hypermail 2.2.0 : Sat Mar 05 2011 - 17:50:01 CET