random seed
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user