Random number generators
art provides a
RandomNumberGenerator service whose state can be read from a file, and module to save that state.
To support reproducibility, all the algorithms using random numbers should use this generator facility.
A few instances of
TRandom from ROOT are scattered through the code, which should be replaced; to date:
lardata/Utilities/SeedCreator.h larreco/Genfit/GFDetPlane.cxx larreco/Genfit/TGeant3/TGeant3.cxx larreco/Genfit/TGeant3/TGeant3TGeo.cxx larreco/Genfit/GFKalman.cxx larreco/Genfit/PointHit.cxx larana/OpticalDetector/OpMCDigi_module.cc larana/OpticalDetector/BoDataFrameInput_module.cc larsim/Simulation/sim.h larsim/EventGenerator/CRY/CosmicsGen_module.cc lbnecode/lbne/RawdataDisplay/.svn/text-base/rawEVD10ktFD.C.svn-base lbnecode/lbne/RawdataDisplay/.svn/text-base/rawEVD35tFD.C.svn-base lbnecode/lbne/RawdataDisplay/DbigDisplay_FD4apa.C lbnecode/lbne/RawdataDisplay/rawEVD35tFD.C lbnecode/lbne/RawdataDisplay/rawEVD10ktFD.C lbnecode/lbne/RawdataDisplay/DbigDisplay_FD4apa_C.d
All these instances (an any other) should be considered for a replacement.
lardata/RecoObjects/test/PropTest_module.ccuses the ANSI C generator... it should also be considered (it is a test but it could be used as an example).
#4 Updated by Gianluca Petrillo over 4 years ago
- Category changed from Simulation to Other
- % Done changed from 0 to 70
SeedCreator.h has been removed
- offending part in
sim.h has also been removed
- all other instances fixed to use
SeedService, except the cases below.
GenFit is a messy code and fixing it requires some dedicated time.
Genie is using its own generator given by
GENIEHelper. A ugly workaround is possible, but the resolution of #7911 will make solution a bit easier.
Fixed code is in branches
feature/Issue5737 of repositories
#5 Updated by Gianluca Petrillo over 4 years ago
- % Done changed from 70 to 80
GENIE is now tied to
SeedService and to
RandomNumberGenerator as much as possible.
Two random engines are used: a
TRandom3 in GENIE and another
GENIEHelper initialized both with the same seed.
I have disabled
GENIEHelper internal generator and replaced with one from
RandomNumberGenerator, via a
TRandom wrapper to
I have registered this engine as an external engine in
The seeds of both engines, independent, are now managed by
I have simplified the changes in
UBOpticalADCSim module and algorithms by using the same
Genfit is the last standing issue.