Skip to content
Snippets Groups Projects
Commit f9c8106b authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: as the random seed will be reset in the initialization of Gaudi's HEP...

WIP: as the random seed will be reset in the initialization of Gaudi's HEP random engine, we need to set the seed again.
parent 7bc450b3
No related branches found
No related tags found
No related merge requests found
......@@ -2,12 +2,14 @@
#include "GaudiKernel/IEventProcessor.h"
#include "GaudiKernel/IAppMgrUI.h"
#include "GaudiKernel/GaudiException.h"
#include "GaudiKernel/IRndmEngine.h"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#include "Randomize.hh"
#include "DetectorConstruction.h"
#include "G4PhysListFactory.hh"
#include "G4EmParameters.hh"
......@@ -30,6 +32,15 @@ DetSimAlg::initialize() {
info() << "Initialize DetSimAlg... " << endmsg;
// Initialize random seed
if (not m_randomSeeds.empty()) {
randSvc()->engine()->setSeeds( m_randomSeeds );
}
info() << "Random Seed is initialized to "
<< G4Random::getTheSeed()
<< " in Geant4" << std::endl;
m_detsimsvc = service("DetSimSvc");
if (!m_detsimsvc) {
error() << "Failed to find DetSimSvc. " << endmsg;
......
......@@ -31,6 +31,8 @@ private:
private:
Gaudi::Property<std::vector<long>> m_randomSeeds{this, "RandomSeeds", {}};
Gaudi::Property<std::vector<std::string>> m_run_macs{this, "RunMacs"};
Gaudi::Property<std::vector<std::string>> m_run_cmds{this, "RunCmds"};
Gaudi::Property<std::vector<std::string>> m_vis_macs{this, "VisMacs"};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment