random seed

This commit is contained in:
Jan Kieseler
2023-10-10 10:12:31 +02:00
parent 6f6ffff96a
commit 19226f31e6
2 changed files with 16 additions and 5 deletions
+10
View File
@@ -4,6 +4,11 @@
#include <G4NistManager.hh>
#include <G4String.hh>
#include <G4INCLGeant4Random.hh>
#include <G4INCLRandomSeedVector.hh>
#include <ctime>
void G4System::init(GeometryDescriptor &CW){
if(CW.isAssigned()){
@@ -19,6 +24,9 @@ void G4System::init(GeometryDescriptor &CW){
bool first_init=true;
int seed=std::time(NULL) ;
CLHEP::HepRandom::setTheSeed(seed); G4Random::setTheSeed(seed);
if(runManager == nullptr){
// Construct the default run manager
@@ -150,6 +158,8 @@ void G4System::run_gui(){
void G4System::run_batch(int nEvents,const std::string& partSpecies, double minEnergy, double maxEnergy){
check();
G4String partSpec = partSpecies;
G4cout << "running with particle species " << partSpec << G4endl;
UImanager->ApplyCommand("/run/initialize");