Problem 1668

Summary: CLHEP RandPoissonQ minor bug
Product: Geant4 Reporter: Jia Fu Low <jia.fu.low>
Component: globalAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED WONTFIX    
Severity: trivial    
Priority: P5    
Version: other   
Hardware: All   
OS: All   

Description Jia Fu Low 2014-08-23 05:46:13 CEST
Hi,

If I understood the code correctly, the shoot() function in the poisson random number generator ( http://www-geant4.kek.jp/lxr/source/externals/clhep/src/RandPoissonQ.cc#L140 ) tries to save the variables lastA2, lastA1, lastA0, lastSigma, so they don't get recomputed every time shoot() is called.

However, lastLargeMean is never updated. So all those values are still recomputed for every function call.

I think this is not really a bug since the computation output is the same. But if the function is called very frequently, this could help saving some CPU time.

Thanks,
Jia Fu
Comment 1 Gabriele Cosmo 2014-08-26 09:28:39 CEST
Likely, it is done this way to avoid correlations between calls to shoot() and therefore avoid issues of reproducibility.
You may want to report this to the CLHEP support, rather than Geant4. Thanks.