proper seedings
This commit is contained in:
+4
-2
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <ctime>
|
||||
|
||||
void G4System::init(GeometryDescriptor &CW){
|
||||
void G4System::init(GeometryDescriptor &CW, int seed){
|
||||
|
||||
if(CW.isAssigned()){
|
||||
throw std::runtime_error("GeometryDescriptor already assigned");
|
||||
@@ -28,7 +28,9 @@ void G4System::init(GeometryDescriptor &CW){
|
||||
|
||||
bool first_init=true;
|
||||
|
||||
int seed=std::time(NULL) ;
|
||||
if(seed < 0){
|
||||
seed = std::time(NULL);
|
||||
}
|
||||
CLHEP::HepRandom::setTheSeed(seed); G4Random::setTheSeed(seed);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user