Random inconsistency between Root and RooFit

Dear all,

I am creating Poisson distributions using random numbers with the standard Root method and RooFit. I thought that the distributions using both methods should be the same, but they are not. I am attaching the code and the plots so you can see this more clearly. I saw a similar problem in this other post that comment about an inconsistency between random and some algebras functions:

Trying to understand this issue I changed the random library from TRandom to TRandom3 in order to see the differences between them; with this study I realize that RooFit is invariant under the change of the random method (it seems that it have a predefined random).

Do you know why both methods don’t show the same distribution?

Cheers!
Sebastian
Mean10.eps (12.1 KB)
RunRandom_x.cpp (2.82 KB)

Hi,

Which version in ROOT are you using ? I think there was a bug in RooFIt generate for extended events, that has been fixed in 5.34

Lorenzo

Hi Lorenzo,

Thanks for you answer but I am using the last root version (5.34).

Cheers,
Sebastian

Hi,

Yes, you are right. I can reproduce this problem in version >= 5.34.01. 5.34.00 seems fine. I will investigate it.
I see there is already a similar issue reported in Savannah, which is still open

savannah.cern.ch/bugs/?98832

Thank you for reporting this issue

Lorenzo

Hi,
This bug is now fixed in the trunk and 5.34 patches.Thank you for reporting it
Best Regards
Lorenzo

Hi Lorenzo,

Thanks! Now the distributions look alike.

However, I have another thing to mention about the random tools. Unlike the Standard Root method, RooFit can use only TRandom library. There is a way to implement RooFit to use the other random methods: TRandom1, TRandom2 and TRandom3?

Cheers,
Sebastian

Hi,

RooFit uses as random generator engine TRandom3 which is created in the constructor of the RooRandom singleton class. We would need to change RooRandom to have the possibility to uses alternative random engines
(e.g. TRandom1 or TRandom2)

Cheers

Lorenzo

Hi Lorenzo,
Thanks for the clarification.

Cheers,
Sebastian