Open c-dilks opened 1 year ago
BTW, there is random generator service but it is barely usable in the current implementation.
Nice, let's make it a proper service (e.g., src/RandGen_driver.cpp
should not live in src
) and start using it! Unfortunately I don't have time to help do this, but this seems like a very good entry-level issue for a new person to get involved with.
this seems like a very good entry-level issue for a new person to get involved with.
Not quite. Getting random numbers isn't hard. It's getting the same random numbers in the same sequence to the same algorithms, even when algorithms may run out of sequence the next time you run it... And this must all work in multithreaded running.
BTW, there is random generator service but it is barely usable in the current implementation.
Removed by https://github.com/eic/EICrecon/pull/640.
Is your feature request related to a problem? Please describe. Problem: In the algorithm
PhotoMultiplierHitDigi
, if the seed for theTRandomMixMax
object is set to 0 (use "random" seed, see documentation), then the randomly generated number can sometimes remain the same for several generations, then start actually randomizing later; this is a possible symptom of thread unsafety. This issue does not appear to happen if the seed is non-zero (a fixed seed, useful for reproducibility, but less random than seed 0).TRandom
is used in the following algorithms and factories:and some tracking efficiency benchmarks.
Describe the solution you'd like Ideally, we should implement a thread-safe random number generation service.
When resolved, remove the following warnings and consider using
seed=0
:PhotoMultiplierHitDigi::AlgorithmInit
: https://github.com/eic/EICrecon/blob/f24168476559b317aad2b498928fd8d58b3df8a8/src/algorithms/digi/PhotoMultiplierHitDigi.cc#L32-L36PhotoMultiplierHitDigiConfig
: https://github.com/eic/EICrecon/blob/f24168476559b317aad2b498928fd8d58b3df8a8/src/algorithms/digi/PhotoMultiplierHitDigiConfig.h#L12-L17Describe alternatives you've considered Use seed != 0, which appears to work okay, but is not really ideal for the long term, especially if we want more randomness.