Problem 1668 - CLHEP RandPoissonQ minor bug
Summary: CLHEP RandPoissonQ minor bug
Status: RESOLVED WONTFIX
Alias: None
Product: Geant4
Classification: Unclassified
Component: global (show other problems)
Version: other
Hardware: All All
: P5 trivial
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2014-08-23 05:46 CEST by Jia Fu Low
Modified: 2014-08-26 09:28 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.