-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent noise from going out of bounds #114
Conversation
src/TRestRawSignal.cxx
Outdated
@@ -591,12 +595,14 @@ void TRestRawSignal::GetWhiteNoiseSignal(TRestRawSignal* noiseSignal, Double_t n | |||
double* dd = new double(); | |||
uintptr_t seed = (uintptr_t)dd + (uintptr_t)this; | |||
delete dd; | |||
TRandom3* fRandom = new TRandom3(seed); | |||
TRandom3 random(seed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the seed
should be stored inside TRestRawSignal::fSeed
. It should be initialised just once, not every time GetWhiteNoiseSignal
is called. This may lead to unreproducible results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in 9499c8e.
By default it will use the same seed as the global seed for TRandom
but it can also be specified via TRestRawSignal::SetSeed
.
Closes #113