Bug #5737
Random number generators
100%
Description
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.cc
uses the ANSI C generator... it should also be considered (it is a test but it could be used as an example).
History
#1 Updated by Erica Snider almost 7 years ago
See related ticket #5540
#2 Updated by Lynn Garren almost 7 years ago
- Status changed from New to Assigned
- Assignee set to Erica Snider
#3 Updated by Erica Snider over 6 years ago
- Assignee changed from Erica Snider to Gianluca Petrillo
#4 Updated by Gianluca Petrillo almost 6 years ago
- Category changed from Simulation to Other
- % Done changed from 0 to 70
Resolution status:
- 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 nutools
's 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 lardata
, larsim
, larana
and uboonecode
.
#5 Updated by Gianluca Petrillo almost 6 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 TRandom3
in GENIEHelper
.GENIEHelper
initialized both with the same seed.
I have disabled GENIEHelper
internal generator and replaced with one from RandomNumberGenerator
, via a TRandom
wrapper to CLHEP::HepRandomEngine
(lardata/Utilities/TRandomCLHEP.h
).
I have registered this engine as an external engine in SeedService
.
The seeds of both engines, independent, are now managed by SeedService
.
I have simplified the changes in UBOpticalADCSim
module and algorithms by using the same TRandomCLHEP
.
Genfit
is the last standing issue.
#6 Updated by Gianluca Petrillo over 4 years ago
- Status changed from Assigned to Resolved
- % Done changed from 80 to 100
Given that there are no reports of reproducibility problems, and Genfit is close to a dead branch, I am declaring this done.
#7 Updated by Gianluca Petrillo over 4 years ago
- Status changed from Resolved to Closed