To some case, the simulation need more random number, but the total random number of geant4 is Subtract 1 to the 31st power of 2.
how to make the total random number more than Subtract 1 to the 31st power of 2?
To some case, the simulation need more random number, but the total random number of geant4 is Subtract 1 to the 31st power of 2.
how to make the total random number more than Subtract 1 to the 31st power of 2?
Do you need more numbers, or higher values?
Keep in mind that the number of events is limited by the maximum value of the eventID which is G4int, and therefore the 2^31-1 value that you mentioned. For more events, you can accumulate multiple runs.
The state of the random number generator depends on two (or more?) numbers, so the order in which these numbers are generated does not repeat so soon after 2^31-1, if that is your concern…
If you simply need higher values for something you do manually:
G4UniformRand()
comes as a G4double
, which is afaik 64 bit, hence,
G4long(G4UniformRand() * ULONG_MAX);
could do the trick!? I would boldly assume @mkelsey would quickly object if that is wrong
I meant the bigger eventID.
No. The event ID is a G4int
, which is a typedef for int
, which is a 32-bit signed integer value. It is what it is.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.