Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gpronost
Copy link
Collaborator

I was forgetting to commit this fix, I'm sorry for this.

The ROOT/CERN Randomizer seed isn't properly initialized, here we set it to be the same value than Geant4's Randomizer seed.

@bquilain
Copy link
Owner

Hi Guillaume. Thank you very much for this fix, it seems perfect to me. I should have realised also this initialisation was not done...

@bquilain bquilain merged commit 0266b1c into hybridPMT Apr 30, 2021
@gpronost gpronost deleted the FixRootRandomizer branch April 30, 2021 08:47
@pdeperio
Copy link

what's the impact of this?

@nickwp
Copy link
Collaborator

nickwp commented Apr 30, 2021

Is there a reason to use TRandom3 at all? As far as I can see the only place in the entire WCSim that it is used is here, which could be changed to use the G4 random generator to match the random number generation used anywhere else.

@gpronost
Copy link
Collaborator Author

gpronost commented Apr 30, 2021

Hi,

what's the impact of this?

-> impact should be negligible for 99% of WCSim usage. Normally, G4 randomizer should be used in WCSim. However, for the Rn generator, since we are using TF2 Random functions, it's absolutely necessary.

Is there a reason to use TRandom3 at all?

-> gRandom is TRandom3 by default, but the header doesn't really matter I guess.

As far as I can see the only place in the entire WCSim that it is used is here, which could be changed to use the G4 random generator to match the random number generation used anywhere else.

-> No, this is not the same, gRandom is the default ROOT Randomizer, but here ranGen is declared as another Randomizer. Actually, I think ranGen initialization is quite bad: it is always initialized with the default seed so it will always produce the same sequence. I think you are right that replacing ranGen by the default G4 random generator would be better.

@nickwp
Copy link
Collaborator

nickwp commented Apr 30, 2021

Ah I see, I had searched for any occurrence of TRandom and that was all I could find. I didn't realise that the Rn generator used TRandom in a "hidden" way through the TF2 random functions. Thanks for the clarification.

kmtsui pushed a commit to kmtsui/WCSim that referenced this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants