Geant4  10.02.p01
G4WorkerRunManager.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 
28 #include "G4WorkerRunManager.hh"
30 #include "G4UImanager.hh"
32 #include "G4MTRunManager.hh"
33 #include "G4ScoringManager.hh"
36 #include "G4WorkerThread.hh"
37 #include "G4VUserPhysicsList.hh"
41 #include "G4UserRunAction.hh"
42 #include "G4RNGHelper.hh"
43 #include "G4Run.hh"
45 #include "G4VVisManager.hh"
46 #include "G4SDManager.hh"
47 #include "G4VScoringMesh.hh"
48 #include "G4Timer.hh"
49 #include <sstream>
50 #include <fstream>
51 
53 { return static_cast<G4WorkerRunManager*>(G4RunManager::GetRunManager()); }
54 
56 { return static_cast<G4WorkerRunManagerKernel*>(GetWorkerRunManager()->kernel); }
57 
59  //This constructor should never be called in non-multithreaded mode
60 #ifndef G4MULTITHREADED
62  msg<<"Geant4 code is compiled without multi-threading support (-DG4MULTITHREADED is set to off).";
63  msg<<" This type of RunManager can only be used in mult-threaded applications.";
64  G4Exception("G4WorkerRunManager::G4WorkerRunManager()","Run0035",FatalException,msg);
65 #endif
68  if(masterScM) G4ScoringManager::GetScoringManager(); //TLS instance for a worker
69 
70  eventLoopOnGoing = false;
71  runIsSeeded = false;
72  nevModulo = -1;
73  currEvID = -1;
74  workerContext = 0;
75  readStatusFromFile = false;
76 
78 
79 #ifdef G4MULTITHREADED
81  if(pVVis)
82  {
83  pVVis->SetUpForAThread();
84  visIsSetUp = true;
85  }
86  else
87  { visIsSetUp = false; }
88 #endif
89 }
90 
91 #include "G4MTRunManager.hh"
92 
94  // Delete thread-local process manager objects
96 
97  //Put these pointers to zero: owned by master thread
98  //If not to zero, the base class destructor will attempt to
99  //delete them
100  userDetector = 0;
104  physicsList = 0;
105  if(verboseLevel>0) G4cout<<"Destroying WorkerRunManager ("<<this<<")"<<G4endl;
106 }
107 
108 
110  if(!userDetector)
111  {
112  G4Exception("G4RunManager::InitializeGeometry", "Run0033",
113  FatalException, "G4VUserDetectorConstruction is not defined!");
114  return;
115  }
118 
119  //Step1: Get pointer to the physiWorld (note: needs to get the "super pointer, i.e. the one shared by all threads"
121  G4VPhysicalVolume* worldVol = masterKernel->GetCurrentWorld();
122  //Step2:, Call a new "WorkerDefineWorldVolume( pointer from 2-, false);
123  kernel->WorkerDefineWorldVolume(worldVol,false);
125  //Step3: Call user's ConstructSDandField()
128  geometryInitialized = true;
129 }
130 
132 
134 {
135 #ifdef G4MULTITHREADED
136  if(!visIsSetUp)
137  {
139  if(pVVis)
140  {
141  pVVis->SetUpForAThread();
142  visIsSetUp = true;
143  }
144  }
145 #endif
146 
147  if(!(kernel->RunInitialization(fakeRun))) return;
148 
149  //Signal this thread can start event loop.
150  //Note this will return only when all threads reach this point
152  if(fakeRun) return;
153 
154  const G4UserWorkerInitialization* uwi
157  if(currentRun) delete currentRun;
158  currentRun = 0;
159 
161  //Call a user hook: this is guaranteed all threads are "synchronized"
162  if(uwi) uwi->WorkerRunStart();
163 
165  if(!currentRun) currentRun = new G4Run();
166 
169 
172  if(fSDM)
173  { currentRun->SetHCtable(fSDM->GetHCtable()); }
174 
175  std::ostringstream oss;
176  G4Random::saveFullState(oss);
177  randomNumberStatusForThisRun = oss.str();
179 
180  for(G4int i_prev=0;i_prev<n_perviousEventsToBeStored;i_prev++)
181  { previousEvents->push_back((G4Event*)0); }
182 
183  if(printModulo>0 || verboseLevel>0)
184  {
185  G4cout << "### Run " << currentRun->GetRunID() << " starts on worker thread "
186  << G4Threading::G4GetThreadId() << "." << G4endl;
187  }
189 
191  G4String fileN = "currentRun";
192  if ( rngStatusEventsFlag ) {
193  std::ostringstream os;
194  os << "run" << currentRun->GetRunID();
195  fileN = os.str();
196  }
197  StoreRNGStatus(fileN);
198  }
199 
200  runAborted = false;
202 }
203 
204 void G4WorkerRunManager::DoEventLoop(G4int n_event, const char* macroFile , G4int n_select)
205 {
207  {
208  G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
209  "G4VUserPrimaryGeneratorAction is not defined!");
210  }
211 
212  //This is the same as in the sequential case, just the for-loop indexes are
213  //different
214  InitializeEventLoop(n_event,macroFile,n_select);
215 
216  // Reset random number seeds queue
217  while(seedsQueue.size()>0)
218  { seedsQueue.pop(); }
219  // for each run, worker should receive at least one set of random number seeds.
220  runIsSeeded = false;
221 
222  // Event loop
223  eventLoopOnGoing = true;
225  G4int i_event = -1;
226  nevModulo = -1;
227  currEvID = -1;
228 
229  while(eventLoopOnGoing)
230  {
231  ProcessOneEvent(i_event);
232  if(eventLoopOnGoing)
233  {
235  if(runAborted)
236  { eventLoopOnGoing = false; }
242  }
243  }
244 
246 }
247 
249 {
250  currentEvent = GenerateEvent(i_event);
251  if(eventLoopOnGoing)
252  {
255  UpdateScoring();
257  }
258 }
259 
261 {
262  G4Event* anEvent = new G4Event(i_event);
263  long s1 = 0;
264  long s2 = 0;
265  long s3 = 0;
266  G4bool eventHasToBeSeeded = true;
268  { eventHasToBeSeeded = false; }
269 
270  if(i_event<0)
271  {
273  if(nevM==1)
274  {
276  ->SetUpAnEvent(anEvent,s1,s2,s3,eventHasToBeSeeded);
277  runIsSeeded = true;
278  }
279  else
280  {
281  if(nevModulo<=0)
282  {
284  ->SetUpNEvents(anEvent,&seedsQueue,eventHasToBeSeeded);
285  if(nevToDo==0)
286  { eventLoopOnGoing = false; }
287  else
288  {
289  currEvID = anEvent->GetEventID();
290  nevModulo = nevToDo - 1;
291  }
292  }
293  else
294  {
295  if(G4MTRunManager::SeedOncePerCommunication()>0) eventHasToBeSeeded = false;
296  anEvent->SetEventID(++currEvID);
297  nevModulo--;
298  }
299  if(eventLoopOnGoing && eventHasToBeSeeded)
300  {
301  s1 = seedsQueue.front(); seedsQueue.pop();
302  s2 = seedsQueue.front(); seedsQueue.pop();
303  }
304  }
305 
306  if(!eventLoopOnGoing)
307  {
308  delete anEvent;
309  return 0;
310  }
311  }
312  else if(eventHasToBeSeeded)
313  {
314  //Need to reseed random number generator
316  s1 = helper->GetSeed(i_event*2);
317  s2 = helper->GetSeed(i_event*2+1);
318  }
319 
320  if(eventHasToBeSeeded)
321  {
322  long seeds[3] = { s1, s2, 0 };
323  G4Random::setTheSeeds(seeds,-1);
324  runIsSeeded = true;
326  }
327 
328  //Read from file seed.
329  //Andrea Dotti 4 November 2015
330  //This is required for strong-reproducibility, in MT mode we have that each
331  //thread produces, for each event a status file, we want to do that.
332  //Search a random file with the format run{%d}evt{%d}.rndm
333 
334  //This is the filename base constructed from run and event
335  const auto filename = [&] {
336  std::ostringstream os;
337  os << "run"<<currentRun->GetRunID() << "evt" << anEvent->GetEventID();
338  return os.str();
339  };
340 
341  G4bool RNGstatusReadFromFile = false;
342  if ( readStatusFromFile ) {
343  //Build full path of RNG status file for this event
344  std::ostringstream os;
345  os << filename() << ".rndm";
346  const G4String& randomStatusFile = os.str();
347  std::ifstream ifile(randomStatusFile.c_str());
348  if ( ifile ) { //File valid and readable
349  RNGstatusReadFromFile = true;
350  G4Random::restoreEngineStatus(randomStatusFile.c_str());
351  }
352  }
353 
354 
356  {
357  std::ostringstream oss;
358  G4Random::saveFullState(oss);
359  randomNumberStatusForThisEvent = oss.str();
361  }
362 
363  if(storeRandomNumberStatus && ! RNGstatusReadFromFile ) { //If reading from file, avoid to rewrite the same
364  G4String fileN = "currentEvent";
365  if ( rngStatusEventsFlag ) {
366  fileN = filename();
367  }
368  StoreRNGStatus(fileN);
369  }
370 
371  if(printModulo > 0 && anEvent->GetEventID()%printModulo == 0 )
372  {
373  G4cout << "--> Event " << anEvent->GetEventID() << " starts with initial seeds ("
374  << s1 << "," << s2 << ")." << G4endl;
375  }
377  return anEvent;
378 }
379 
381 {
382  //Merge partial results into global run
385  if(ScM) mtRM->MergeScores(ScM);
386  mtRM->MergeRun(currentRun);
387 }
388 
390 {
391  if(!fakeRun)
392  {
394 
395  //Call a user hook: note this is before the next barrier
396  //so threads execute this method asyncrhonouzly
397  //(TerminateRun allows for synch via G4RunAction::EndOfRun)
398  const G4UserWorkerInitialization* uwi
400  if(uwi) uwi->WorkerRunEnd();
401  }
402 
404  //Signal this thread has finished envent-loop.
405  //Note this will return only whan all threads reach this point
407 
408 }
409 
411 {
412  if(verboseLevel>0 && !fakeRun)
413  {
414  timer->Stop();
415  G4cout << "Thread-local run terminated." << G4endl;
416  G4cout << "Run Summary" << G4endl;
417  if(runAborted)
418  { G4cout << " Run Aborted after " << numberOfEventProcessed << " events processed." << G4endl; }
419  else
420  { G4cout << " Number of events processed : " << numberOfEventProcessed << G4endl; }
421  G4cout << " " << *timer << G4endl;
422  }
423 }
424 
425 /****************************
426 void G4WorkerRunManager::BeamOn(G4int n_event,const char* macroFile,G4int n_select)
427 {
428  if(n_event>0)
429  { G4RunManager::BeamOn(n_event,macroFile,n_select); }
430  else
431  {
432  // fake BeamOn.
433  G4MTRunManager::GetMasterRunManager()->ThisWorkerReady();
434  G4MTRunManager::GetMasterRunManager()->ThisWorkerEndEventLoop();
435  }
436 }
437 ******************************/
438 
439 #include "G4AutoLock.hh"
440 namespace { G4Mutex ConstructScoringWorldsMutex = G4MUTEX_INITIALIZER; }
442 {
443  // Return if unnecessary
445  if(!ScM) return;
446  G4int nPar = ScM->GetNumberOfMesh();
447  if(nPar<1) return;
448 
449  // Update thread-local G4TransportationManager of all the world volumes
451 
453  assert( masterScM != NULL );
454 
457 
458  for(G4int iw=0;iw<nPar;iw++)
459  {
460  G4VScoringMesh* mesh = ScM->GetMesh(iw);
462  G4VPhysicalVolume* pWorld
464  ->IsWorldExisting(ScM->GetWorldName(iw));
465  if(!pWorld)
466  {
468  ed<<"Mesh name <"<<ScM->GetWorldName(iw)<<"> is not found in the masther thread.";
469  G4Exception("G4WorkerRunManager::ConstructScoringWorlds()","RUN79001",
470  FatalException,ed);
471  }
472  if(!(mesh->GetMeshElementLogical()))
473  {
474  G4AutoLock l(&ConstructScoringWorldsMutex);
475  G4VScoringMesh* masterMesh = masterScM->GetMesh(iw);
476  mesh->SetMeshElementLogical(masterMesh->GetMeshElementLogical());
477  l.unlock();
478 
479  G4ParallelWorldProcess* theParallelWorldProcess = mesh->GetParallelWorldProcess();
480  if(theParallelWorldProcess)
481  { theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw)); }
482  else
483  {
484  theParallelWorldProcess = new G4ParallelWorldProcess(ScM->GetWorldName(iw));
485  mesh->SetParallelWorldProcess(theParallelWorldProcess);
486  theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw));
487 
488  particleIterator->reset();
489  while( (*particleIterator)() ){
490  G4ParticleDefinition* particle = particleIterator->value();
491  G4ProcessManager* pmanager = particle->GetProcessManager();
492  if(pmanager)
493  {
494  pmanager->AddProcess(theParallelWorldProcess);
495  if(theParallelWorldProcess->IsAtRestRequired(particle))
496  { pmanager->SetProcessOrdering(theParallelWorldProcess, idxAtRest, 9900); }
497  pmanager->SetProcessOrderingToSecond(theParallelWorldProcess, idxAlongStep);
498  pmanager->SetProcessOrdering(theParallelWorldProcess, idxPostStep, 9900);
499  } //if(pmanager)
500  }//while
501  }
502  }
503  mesh->WorkerConstruct(pWorld);
504  }
505 }
506 
508 {
509  G4Exception("G4RunManager::SetUserInitialization(G4UserWorkerInitialization*)", "Run3021",
510  FatalException, "This method should be used only with an instance of G4MTRunManager");
511 }
512 
514 {
515  G4Exception("G4RunManager::SetUserInitialization(G4UserWorkerThreadInitialization*)", "Run3021",
516  FatalException, "This method should be used only with an instance of G4MTRunManager");
517 }
518 
520 {
521  G4Exception("G4RunManager::SetUserInitialization(G4VUserActionInitialization*)", "Run3021",
522  FatalException, "This method should be used only with an instance of G4MTRunManager");
523 }
524 
526 {
527  G4Exception("G4RunManager::SetUserInitialization(G4VUserDetectorConstruction*)", "Run3021",
528  FatalException, "This method should be used only with an instance of G4MTRunManager");
529 }
530 
532 {
533  pl->InitializeWorker();
535 }
536 
538 {
539  G4RunManager::SetUserAction(userAction);
540  userAction->SetMaster(false);
541 }
542 
544 {
545  const CLHEP::HepRandomEngine* mrnge = G4MTRunManager::GetMasterRunManager()->getMasterRandomEngine();
546  assert(mrnge);//Master has created RNG
549  uwti->SetupRNGEngine(mrnge);
550 }
551 
552 
553 //Forward calls (avoid GCC compilation warnings)
555 {
557 }
558 
560 {
562 }
563 
565 {
567 }
568 
570 {
572 }
573 
575 {
577 }
578 
580 {
581  std::ostringstream os;
582  os << randomNumberStatusDir << "G4Worker"<<workerContext->GetThreadId()<<"_"<<fn <<".rndm";
583  G4Random::saveEngineStatus(os.str().c_str());
584 }
585 
587 {
590  while( nextAction != G4MTRunManager::ENDWORKER )
591  {
592  if( nextAction == G4MTRunManager::NEXTITERATION ) // start the next run
593  {
594  //The following code deals with changing materials between runs
595  static G4ThreadLocal G4bool skipInitialization = true;
596  if(skipInitialization)
597  {
598  // re-initialization is not necessary for the first run
599  skipInitialization = false;
600  }
601  else
602  {
603 // ReinitializeGeometry();
605  }
606 
607  // Execute UI commands stored in the masther UI manager
608  std::vector<G4String> cmds = mrm->GetCommandStack();
609  G4UImanager* uimgr = G4UImanager::GetUIpointer(); //TLS instance
610  std::vector<G4String>::const_iterator it = cmds.begin();
611  for(;it!=cmds.end();it++)
612  { uimgr->ApplyCommand(*it); }
613  //Start this run
614  G4int numevents = mrm->GetNumberOfEventsToBeProcessed();
615  G4String macroFile = mrm->GetSelectMacro();
616  G4int numSelect = mrm->GetNumberOfSelectEvents();
617  if ( macroFile == "" || macroFile == " " )
618  {
619  this->BeamOn(numevents);
620  }
621  else
622  {
623  this->BeamOn(numevents,macroFile,numSelect);
624  }
625  }
626  else
627  {
629  d<<"Cannot continue, this worker has been requested an unknwon action: "
630  <<nextAction<<" expecting: ENDWORKER(=" <<G4MTRunManager::ENDWORKER
631  <<") or NEXTITERATION(="<<G4MTRunManager::NEXTITERATION<<")";
632  G4Exception("G4WorkerRunManager::DoWork","Run0035",FatalException,d);
633  }
634 
635  //Now wait for master thread to signal new action to be performed
636  nextAction = mrm->ThisWorkerWaitForNextAction();
637  } //No more actions to perform
638 
639  return;
640 }
G4Timer * timer
void SetNumberOfEventToBeProcessed(G4int n_ev)
Definition: G4Run.hh:97
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
void SetMaster(G4bool val=true)
void WorkerG4ParticleTable()
G4int numberOfEventToBeProcessed
static G4TemplateRNGHelper * GetInstance()
Definition: G4RNGHelper.hh:52
void SetDCtable(G4DCtable *DCtbl)
Definition: G4Run.hh:101
virtual G4int SetUpNEvents(G4Event *, G4SeedsQueue *seedsQueue, G4bool reseedRequired=true)
std::vector< G4String > GetCommandStack()
G4int GetNumberOfParallelWorld() const
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
G4int n_select_msg
void SetParallelWorldProcess(G4ParallelWorldProcess *proc)
G4int numberOfEventProcessed
G4String GetWorldName(G4int i) const
G4String randomNumberStatusForThisRun
virtual void RunTermination()
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
virtual void ThisWorkerEndEventLoop()
virtual void SetupRNGEngine(const CLHEP::HepRandomEngine *aRNGEngine) const
G4VUserPhysicsList * physicsList
virtual void InitializeGeometry()
G4String randomNumberStatusForThisEvent
static G4bool fGeometryHasBeenDestroyed
G4WorkerThread * workerContext
void GeometryHasBeenDestroyed()
static void UpdateGeometryAndPhysicsVectorFromMaster()
static G4VVisManager * GetConcreteInstance()
void SetIgnoreCmdNotFound(G4bool val)
Definition: G4UImanager.hh:269
void SetNumberOfParallelWorld(G4int i)
void SetProcessOrderingToSecond(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4VUserActionInitialization * userActionInitialization
void SetMeshElementLogical(G4LogicalVolume *val)
virtual void ConstructScoringWorlds()
static G4WorkerRunManager * GetWorkerRunManager()
G4bool storeRandomNumberStatus
G4String GetSelectMacro() const
G4bool IsAtRestRequired(G4ParticleDefinition *)
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
virtual void TerminateEventLoop()
virtual void DoEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void RunInitialization()
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual const T GetSeed(const G4int &sdId)
Definition: G4RNGHelper.hh:78
const G4UserWorkerInitialization * GetUserWorkerInitialization() const
void WorkerConstruct(G4VPhysicalVolume *fWorldPhys)
#define G4ThreadLocal
Definition: tls.hh:89
virtual void SetUserInitialization(G4VUserPhysicsList *userInit)
G4ProcessManager * GetProcessManager() const
G4String msgText
int G4int
Definition: G4Types.hh:78
G4bool runAborted
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:175
G4bool RunInitialization(G4bool fakeRun=false)
void WorkerDefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
G4Event * currentEvent
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
static G4ParallelWorldProcessStore * GetInstance()
G4int GetEventID() const
Definition: G4Event.hh:151
G4bool geometryInitialized
G4HCtable * GetHCtable() const
Definition: G4SDManager.hh:101
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
void SetParallelWorld(G4String parallelWorldName)
static G4RunManagerKernel * GetMasterRunManagerKernel()
G4GLOB_DLL std::ostream G4cout
void MergeRun(const G4Run *localRun)
void reset(G4bool ifSkipIon=true)
static G4ScoringManager * GetScoringManagerIfExist()
G4UserWorkerInitialization * userWorkerInitialization
G4String randomNumberStatusDir
bool G4bool
Definition: G4Types.hh:79
G4bool rngStatusEventsFlag
virtual void AnalyzeEvent(G4Event *anEvent)
static G4MTRunManager * GetMasterRunManager()
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4int storeRandomNumberStatusToG4Event
virtual WorkerActionRequest ThisWorkerWaitForNextAction()
G4int GetRunID() const
Definition: G4Run.hh:76
Definition: G4Run.hh:46
G4int GetThreadId() const
G4int GetNumberOfEventsToBeProcessed() const
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
std::list< G4Event * > * previousEvents
G4UserRunAction * userRunAction
virtual void RunTermination()
virtual void ProcessOneEvent(G4int i_event)
void SetHCtable(G4HCtable *HCtbl)
Definition: G4Run.hh:99
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void SetRandomNumberStatus(G4String &st)
Definition: G4Event.hh:125
static G4TransportationManager * GetTransportationManager()
G4int GetNumberOfSelectEvents() const
const G4UserWorkerThreadInitialization * GetUserWorkerThreadInitialization() const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4int runIDCounter
G4int G4Mutex
Definition: G4Threading.hh:173
static G4ScoringManager * GetMasterScoringManager()
virtual void GeneratePrimaries(G4Event *anEvent)=0
virtual void ThisWorkerReady()
static G4ParticleTable * GetParticleTable()
void CleanUpPreviousEvents()
virtual G4Event * GenerateEvent(G4int i_event)
void Stop()
virtual G4bool SetUpAnEvent(G4Event *, long &s1, long &s2, long &s3, G4bool reseedRequired=true)
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
const CLHEP::HepRandomEngine * getMasterRandomEngine() const
G4int GetEventModulo() const
G4ParallelWorldProcess * GetParallelWorldProcess() const
virtual void BeginOfRunAction(const G4Run *aRun)
static G4int SeedOncePerCommunication()
G4LogicalVolume * GetMeshElementLogical() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4Run * currentRun
#define G4endl
Definition: G4ios.hh:61
void ProcessOneEvent(G4Event *anEvent)
G4RunManagerKernel * kernel
static G4ScoringManager * GetScoringManager()
size_t GetNumberOfMesh() const
G4EventManager * eventManager
virtual void TerminateOneEvent()
void SetRunID(G4int id)
Definition: G4Run.hh:95
G4VUserDetectorConstruction * userDetector
G4VScoringMesh * GetMesh(G4int i) const
virtual void SetUserAction(G4UserRunAction *userAction)
void SetRandomNumberStatus(G4String &st)
Definition: G4Run.hh:103
virtual G4Run * GenerateRun()
void MergeScores(const G4ScoringManager *localScoringManager)
void SetEventID(G4int i)
Definition: G4Event.hh:115
G4PTblDicIterator * GetIterator() const
void UpdateScoring()
G4DCtable * DCtable
G4int n_perviousEventsToBeStored
G4VPhysicalVolume * GetCurrentWorld() const
G4int G4GetThreadId()
Definition: G4Threading.cc:128
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
G4int verboseLevel
virtual void SetUserAction(G4UserRunAction *userAction)
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49
static G4WorkerRunManagerKernel * GetWorkerRunManagerKernel()
virtual void MergePartialResults()
virtual void StoreRNGStatus(const G4String &filenamePrefix)