Geant4  10.02.p03
G4RunManager Class Reference

#include <G4RunManager.hh>

Inheritance diagram for G4RunManager:
Collaboration diagram for G4RunManager:

Public Types

enum  RMType { sequentialRM, masterRM, workerRM }
 

Public Member Functions

 G4RunManager ()
 
virtual ~G4RunManager ()
 
virtual void BeamOn (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void Initialize ()
 
virtual void DefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
 
virtual void AbortRun (G4bool softAbort=false)
 
virtual void AbortEvent ()
 
virtual void InitializeGeometry ()
 
virtual void InitializePhysics ()
 
virtual G4bool ConfirmBeamOnCondition ()
 
virtual void RunInitialization ()
 
virtual void DoEventLoop (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void RunTermination ()
 
virtual void InitializeEventLoop (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void ProcessOneEvent (G4int i_event)
 
virtual void TerminateOneEvent ()
 
virtual void TerminateEventLoop ()
 
virtual G4EventGenerateEvent (G4int i_event)
 
virtual void AnalyzeEvent (G4Event *anEvent)
 
void DumpRegion (const G4String &rname) const
 
void DumpRegion (G4Region *region=0) const
 
virtual void rndmSaveThisRun ()
 
virtual void rndmSaveThisEvent ()
 
virtual void RestoreRandomNumberStatus (const G4String &fileN)
 
virtual void SetUserInitialization (G4VUserDetectorConstruction *userInit)
 
virtual void SetUserInitialization (G4VUserPhysicsList *userInit)
 
virtual void SetUserInitialization (G4VUserActionInitialization *userInit)
 
virtual void SetUserInitialization (G4UserWorkerInitialization *userInit)
 
virtual void SetUserInitialization (G4UserWorkerThreadInitialization *userInit)
 
virtual void SetUserAction (G4UserRunAction *userAction)
 
virtual void SetUserAction (G4VUserPrimaryGeneratorAction *userAction)
 
virtual void SetUserAction (G4UserEventAction *userAction)
 
virtual void SetUserAction (G4UserStackingAction *userAction)
 
virtual void SetUserAction (G4UserTrackingAction *userAction)
 
virtual void SetUserAction (G4UserSteppingAction *userAction)
 
const G4VUserDetectorConstructionGetUserDetectorConstruction () const
 
const G4VUserPhysicsListGetUserPhysicsList () const
 
const G4VUserActionInitializationGetUserActionInitialization () const
 
G4VUserActionInitializationGetNonConstUserActionInitialization () const
 
const G4UserWorkerInitializationGetUserWorkerInitialization () const
 
const G4UserWorkerThreadInitializationGetUserWorkerThreadInitialization () const
 
const G4UserRunActionGetUserRunAction () const
 
const G4VUserPrimaryGeneratorActionGetUserPrimaryGeneratorAction () const
 
const G4UserEventActionGetUserEventAction () const
 
const G4UserStackingActionGetUserStackingAction () const
 
const G4UserTrackingActionGetUserTrackingAction () const
 
const G4UserSteppingActionGetUserSteppingAction () const
 
void SetNumberOfAdditionalWaitingStacks (G4int iAdd)
 
const G4StringGetVersionString () const
 
void SetPrimaryTransformer (G4PrimaryTransformer *pt)
 
void StoreRandomNumberStatusToG4Event (G4int vl)
 
G4int GetFlagRandomNumberStatusToG4Event () const
 
void SetRandomNumberStore (G4bool flag)
 
G4bool GetRandomNumberStore () const
 
void SetRandomNumberStoreDir (const G4String &dir)
 
const G4StringGetRandomNumberStoreDir () const
 
const G4StringGetRandomNumberStatusForThisRun () const
 
const G4StringGetRandomNumberStatusForThisEvent () const
 
void SetRandomNumberStorePerEvent (G4bool flag)
 
G4bool GetRandomNumberStorePerEvent () const
 
void GeometryHasBeenModified (G4bool prop=true)
 
void ReinitializeGeometry (G4bool destroyFirst=false, G4bool prop=true)
 
void PhysicsHasBeenModified ()
 
void CutOffHasBeenModified ()
 
void ReOptimizeMotherOf (G4VPhysicalVolume *)
 
void ReOptimize (G4LogicalVolume *)
 
void SetVerboseLevel (G4int vl)
 
G4int GetVerboseLevel () const
 
G4int GetPrintProgress ()
 
void SetPrintProgress (G4int i)
 
void SetGeometryToBeOptimized (G4bool vl)
 
G4bool GetGeometryToBeOptimized ()
 
void SetNumberOfEventsToBeStored (G4int val)
 
const G4RunGetCurrentRun () const
 
G4RunGetNonConstCurrentRun () const
 
const G4EventGetCurrentEvent () const
 
const G4EventGetPreviousEvent (G4int i) const
 
void SetRunIDCounter (G4int i)
 
G4int GetNumberOfParallelWorld () const
 
void SetNumberOfEventsToBeProcessed (G4int val)
 
G4int GetNumberOfEventsToBeProcessed () const
 
G4int GetNumberOfSelectEvents () const
 
G4String GetSelectMacro () const
 
void SetDCtable (G4DCtable *DCtbl)
 
RMType GetRunManagerType () const
 
virtual void ConstructScoringWorlds ()
 
virtual void RestoreRndmEachEvent (G4bool)
 

Static Public Member Functions

static G4RunManagerGetRunManager ()
 
static G4bool IfGeometryHasBeenDestroyed ()
 

Protected Member Functions

void CleanUpPreviousEvents ()
 
void CleanUpUnnecessaryEvents (G4int keepNEvents)
 
void StackPreviousEvent (G4Event *anEvent)
 
 G4RunManager (RMType rmType)
 
virtual void StoreRNGStatus (const G4String &filenamePrefix)
 
void UpdateScoring ()
 
virtual void DeleteUserInitializations ()
 

Protected Attributes

G4RunManagerKernelkernel
 
G4EventManagereventManager
 
G4VUserDetectorConstructionuserDetector
 
G4VUserPhysicsListphysicsList
 
G4VUserActionInitializationuserActionInitialization
 
G4UserWorkerInitializationuserWorkerInitialization
 
G4UserWorkerThreadInitializationuserWorkerThreadInitialization
 
G4UserRunActionuserRunAction
 
G4VUserPrimaryGeneratorActionuserPrimaryGeneratorAction
 
G4UserEventActionuserEventAction
 
G4UserStackingActionuserStackingAction
 
G4UserTrackingActionuserTrackingAction
 
G4UserSteppingActionuserSteppingAction
 
G4bool geometryInitialized
 
G4bool physicsInitialized
 
G4bool runAborted
 
G4bool initializedAtLeastOnce
 
G4bool geometryToBeOptimized
 
G4int runIDCounter
 
G4int verboseLevel
 
G4int printModulo
 
G4Timertimer
 
G4DCtableDCtable
 
G4RuncurrentRun
 
G4EventcurrentEvent
 
std::list< G4Event * > * previousEvents
 
G4int n_perviousEventsToBeStored
 
G4int numberOfEventToBeProcessed
 
G4bool storeRandomNumberStatus
 
G4int storeRandomNumberStatusToG4Event
 
G4String randomNumberStatusDir
 
G4String randomNumberStatusForThisRun
 
G4String randomNumberStatusForThisEvent
 
G4bool rngStatusEventsFlag
 
G4VPhysicalVolumecurrentWorld
 
G4int nParallelWorlds
 
G4String msgText
 
G4int n_select_msg
 
G4int numberOfEventProcessed
 
G4String selectMacro
 
G4bool fakeRun
 
RMType runManagerType
 

Static Protected Attributes

static G4bool fGeometryHasBeenDestroyed = false
 

Private Member Functions

 G4RunManager (const G4RunManager &)
 
G4RunManageroperator= (const G4RunManager &)
 

Private Attributes

G4RunMessengerrunMessenger
 

Static Private Attributes

static G4ThreadLocal G4RunManagerfRunManager = 0
 

Detailed Description

Definition at line 138 of file G4RunManager.hh.

Member Enumeration Documentation

◆ RMType

Enumerator
sequentialRM 
masterRM 
workerRM 

Definition at line 268 of file G4RunManager.hh.

Constructor & Destructor Documentation

◆ G4RunManager() [1/3]

G4RunManager::G4RunManager ( )

Definition at line 82 of file G4RunManager.cc.

89  runAborted(false),initializedAtLeastOnce(false),
97 {
98  if(fRunManager)
99  {
100  G4Exception("G4RunManager::G4RunManager()", "Run0031",
101  FatalException, "G4RunManager constructed twice.");
102  }
103  fRunManager = this;
104 
105  kernel = new G4RunManagerKernel();
107 
108  timer = new G4Timer();
109  runMessenger = new G4RunMessenger(this);
110  previousEvents = new std::list<G4Event*>;
113  randomNumberStatusDir = "./";
114  std::ostringstream oss;
115  G4Random::saveFullState(oss);
116  randomNumberStatusForThisRun = oss.str();
117  randomNumberStatusForThisEvent = oss.str();
119 }
G4Timer * timer
G4int numberOfEventToBeProcessed
G4int n_select_msg
G4int numberOfEventProcessed
G4UserTrackingAction * userTrackingAction
G4String randomNumberStatusForThisRun
G4VUserPhysicsList * physicsList
G4String randomNumberStatusForThisEvent
G4UImessenger * CreateMessenger()
G4VUserActionInitialization * userActionInitialization
G4bool storeRandomNumberStatus
G4UImessenger * CreateMessenger()
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
G4bool physicsInitialized
G4VPhysicalVolume * currentWorld
RMType runManagerType
G4String msgText
G4bool runAborted
G4Event * currentEvent
G4bool geometryInitialized
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
G4bool initializedAtLeastOnce
G4EventManager * GetEventManager() const
G4bool geometryToBeOptimized
G4UserWorkerInitialization * userWorkerInitialization
G4String randomNumberStatusDir
G4bool rngStatusEventsFlag
G4int storeRandomNumberStatusToG4Event
G4UserEventAction * userEventAction
std::list< G4Event * > * previousEvents
G4UserRunAction * userRunAction
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int runIDCounter
G4String selectMacro
static G4ParticleTable * GetParticleTable()
G4int nParallelWorlds
G4Run * currentRun
G4RunManagerKernel * kernel
G4EventManager * eventManager
G4VUserDetectorConstruction * userDetector
G4UserSteppingAction * userSteppingAction
G4RunMessenger * runMessenger
static G4ProcessTable * GetProcessTable()
G4DCtable * DCtable
G4int n_perviousEventsToBeStored
G4int verboseLevel
static G4ThreadLocal G4RunManager * fRunManager
G4UserStackingAction * userStackingAction
Here is the call graph for this function:

◆ ~G4RunManager()

G4RunManager::~G4RunManager ( )
virtual

Definition at line 183 of file G4RunManager.cc.

184 {
186  // set the application state to the quite state
187  if(pStateManager->GetCurrentState()!=G4State_Quit)
188  {
189  if(verboseLevel>0) G4cout << "G4 kernel has come to Quit state." << G4endl;
190  pStateManager->SetNewState(G4State_Quit);
191  }
192 
194  if(currentRun) delete currentRun;
195  delete timer;
196  delete runMessenger;
199  delete previousEvents;
200 
201  //The following will work for all RunManager types
202  //if derived class does the correct thing in derived
203  //destructor that is set to zero pointers of
204  //user initialization objects for which does not have
205  //ownership
207  if(userRunAction)
208  {
209  delete userRunAction;
210  userRunAction = 0;
211  if(verboseLevel>1) G4cout << "UserRunAction deleted." << G4endl;
212  }
214  {
217  if(verboseLevel>1) G4cout << "UserPrimaryGenerator deleted." << G4endl;
218  }
219 
220  if(verboseLevel>1) G4cout << "RunManager is deleting RunManagerKernel." << G4endl;
221 
222  delete kernel;
223 
224  fRunManager = 0;
225 }
G4Timer * timer
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
G4bool SetNewState(G4ApplicationState requestedState)
virtual void DeleteUserInitializations()
std::list< G4Event * > * previousEvents
G4UserRunAction * userRunAction
static G4ParticleTable * GetParticleTable()
void CleanUpPreviousEvents()
G4Run * currentRun
#define G4endl
Definition: G4ios.hh:61
G4RunManagerKernel * kernel
G4ApplicationState GetCurrentState() const
G4RunMessenger * runMessenger
static G4ProcessTable * GetProcessTable()
G4int verboseLevel
static G4ThreadLocal G4RunManager * fRunManager
Here is the call graph for this function:

◆ G4RunManager() [2/3]

G4RunManager::G4RunManager ( RMType  rmType)
protected

Definition at line 121 of file G4RunManager.cc.

128  runAborted(false),initializedAtLeastOnce(false),
130  verboseLevel(0),printModulo(-1),DCtable(0),
136 {
137  //This version of the constructor should never be called in sequential mode!
138 #ifndef G4MULTITHREADED
140  msg<<"Geant4 code is compiled without multi-threading support (-DG4MULTITHREADED is set to off).";
141  msg<<" This type of RunManager can only be used in mult-threaded applications.";
142  G4Exception("G4RunManager::G4RunManager(G4bool)","Run0035",FatalException,msg);
143 #endif
144 
145  if(fRunManager)
146  {
147  G4Exception("G4RunManager::G4RunManager()", "Run0031",
148  FatalException, "G4RunManager constructed twice.");
149  return;
150  }
151  fRunManager = this;
152 
153  switch(rmType)
154  {
155  case masterRM:
157  break;
158  case workerRM:
160  break;
161  default:
163  msgx<<" This type of RunManager can only be used in mult-threaded applications.";
164  G4Exception("G4RunManager::G4RunManager(G4bool)","Run0035",FatalException,msgx);
165  return;
166  }
167  runManagerType = rmType;
168 
170 
171  timer = new G4Timer();
172  runMessenger = new G4RunMessenger(this);
173  previousEvents = new std::list<G4Event*>;
176  randomNumberStatusDir = "./";
177  std::ostringstream oss;
178  G4Random::saveFullState(oss);
179  randomNumberStatusForThisRun = oss.str();
180  randomNumberStatusForThisEvent = oss.str();
181 }
G4Timer * timer
G4int numberOfEventToBeProcessed
G4int n_select_msg
G4int numberOfEventProcessed
G4UserTrackingAction * userTrackingAction
G4String randomNumberStatusForThisRun
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4VUserPhysicsList * physicsList
G4String randomNumberStatusForThisEvent
G4UImessenger * CreateMessenger()
G4VUserActionInitialization * userActionInitialization
G4bool storeRandomNumberStatus
G4UImessenger * CreateMessenger()
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
G4bool physicsInitialized
G4VPhysicalVolume * currentWorld
RMType runManagerType
G4String msgText
G4bool runAborted
G4Event * currentEvent
G4bool geometryInitialized
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
G4bool initializedAtLeastOnce
G4EventManager * GetEventManager() const
G4bool geometryToBeOptimized
G4UserWorkerInitialization * userWorkerInitialization
G4String randomNumberStatusDir
G4bool rngStatusEventsFlag
G4int storeRandomNumberStatusToG4Event
G4UserEventAction * userEventAction
std::list< G4Event * > * previousEvents
G4UserRunAction * userRunAction
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int runIDCounter
G4String selectMacro
static G4ParticleTable * GetParticleTable()
G4int nParallelWorlds
G4Run * currentRun
G4RunManagerKernel * kernel
G4EventManager * eventManager
G4VUserDetectorConstruction * userDetector
G4UserSteppingAction * userSteppingAction
G4RunMessenger * runMessenger
static G4ProcessTable * GetProcessTable()
G4DCtable * DCtable
G4int n_perviousEventsToBeStored
G4int verboseLevel
static G4ThreadLocal G4RunManager * fRunManager
G4UserStackingAction * userStackingAction
Here is the call graph for this function:

◆ G4RunManager() [3/3]

G4RunManager::G4RunManager ( const G4RunManager )
inlineprivate

Definition at line 574 of file G4RunManager.hh.

574 {}

Member Function Documentation

◆ AbortEvent()

void G4RunManager::AbortEvent ( )
virtual

Reimplemented in G4MTRunManager.

Definition at line 624 of file G4RunManager.cc.

625 {
626  // This method is valid only for EventProc state
627  G4ApplicationState currentState =
629  if(currentState==G4State_EventProc)
630  {
633  }
634  else
635  {
636  G4cerr << "Event is not in progress. AbortEevnt() ignored." << G4endl;
637  }
638 }
G4Event * currentEvent
static G4StateManager * GetStateManager()
void SetEventAborted()
Definition: G4Event.hh:123
void AbortCurrentEvent()
#define G4endl
Definition: G4ios.hh:61
G4EventManager * eventManager
G4ApplicationState GetCurrentState() const
G4ApplicationState
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AbortRun()

void G4RunManager::AbortRun ( G4bool  softAbort = false)
virtual

Reimplemented in G4MTRunManager.

Definition at line 604 of file G4RunManager.cc.

605 {
606  // This method is valid only for GeomClosed or EventProc state
607  G4ApplicationState currentState =
609  if(currentState==G4State_GeomClosed || currentState==G4State_EventProc)
610  {
611  runAborted = true;
612  if(currentState==G4State_EventProc && !softAbort)
613  {
616  }
617  }
618  else
619  {
620  G4cerr << "Run is not in progress. AbortRun() ignored." << G4endl;
621  }
622 }
G4bool runAborted
G4Event * currentEvent
static G4StateManager * GetStateManager()
void SetEventAborted()
Definition: G4Event.hh:123
void AbortCurrentEvent()
#define G4endl
Definition: G4ios.hh:61
G4EventManager * eventManager
G4ApplicationState GetCurrentState() const
G4ApplicationState
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AnalyzeEvent()

void G4RunManager::AnalyzeEvent ( G4Event anEvent)
virtual

Definition at line 470 of file G4RunManager.cc.

471 {
473  if(fPersM) fPersM->Store(anEvent);
474  currentRun->RecordEvent(anEvent);
475 }
virtual G4bool Store(const G4Event *anEvent)=0
virtual void RecordEvent(const G4Event *)
Definition: G4Run.cc:51
G4Run * currentRun
static G4VPersistencyManager * GetPersistencyManager()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BeamOn()

void G4RunManager::BeamOn ( G4int  n_event,
const char *  macroFile = 0,
G4int  n_select = -1 
)
virtual

Definition at line 262 of file G4RunManager.cc.

263 {
264  if(n_event<=0) { fakeRun = true; }
265  else { fakeRun = false; }
267  if(cond)
268  {
269  numberOfEventToBeProcessed = n_event;
273  DoEventLoop(n_event,macroFile,n_select);
274  RunTermination();
275  }
276  fakeRun = false;
277 }
G4int numberOfEventToBeProcessed
G4int numberOfEventProcessed
virtual void RunTermination()
virtual void RunInitialization()
virtual G4bool ConfirmBeamOnCondition()
bool G4bool
Definition: G4Types.hh:79
virtual void ConstructScoringWorlds()
virtual void DoEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanUpPreviousEvents()

void G4RunManager::CleanUpPreviousEvents ( )
protected

Definition at line 491 of file G4RunManager.cc.

492 {
493  // Delete all events carried over from previous run.
494  // This method is invoked at the beginning of the next run
495  // or from the destructor of G4RunManager at the very end of
496  // the program.
497  // N.B. If ToBeKept() is true, the pointer of this event is
498  // kept in G4Run of the previous run, and deleted along with
499  // the deletion of G4Run.
500 
501  std::list<G4Event*>::iterator evItr = previousEvents->begin();
502  while(evItr!=previousEvents->end())
503  {
504  G4Event* evt = *evItr;
505  if(evt && !(evt->ToBeKept())) delete evt;
506  evItr = previousEvents->erase(evItr);
507  }
508 }
G4bool ToBeKept() const
Definition: G4Event.hh:137
std::list< G4Event * > * previousEvents
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanUpUnnecessaryEvents()

void G4RunManager::CleanUpUnnecessaryEvents ( G4int  keepNEvents)
protected

Definition at line 510 of file G4RunManager.cc.

511 {
512  // Delete events that are no longer necessary for post
513  // processing such as visualization.
514  // N.B. If ToBeKept() is true, the pointer of this event is
515  // kept in G4Run of the previous run, and deleted along with
516  // the deletion of G4Run.
517 
518  std::list<G4Event*>::iterator evItr = previousEvents->begin();
519  while(evItr!=previousEvents->end())
520  {
521  if(G4int(previousEvents->size()) <= keepNEvents) return;
522 
523  G4Event* evt = *evItr;
524  if(evt)
525  {
526  if(evt->GetNumberOfGrips()==0)
527  {
528  if(!(evt->ToBeKept())) delete evt;
529  evItr = previousEvents->erase(evItr);
530  }
531  else
532  { evItr++; }
533  }
534  else
535  { evItr = previousEvents->erase(evItr); }
536  }
537 }
G4bool ToBeKept() const
Definition: G4Event.hh:137
int G4int
Definition: G4Types.hh:78
std::list< G4Event * > * previousEvents
G4int GetNumberOfGrips() const
Definition: G4Event.hh:147
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfirmBeamOnCondition()

G4bool G4RunManager::ConfirmBeamOnCondition ( )
virtual

Definition at line 279 of file G4RunManager.cc.

280 {
282 
283  G4ApplicationState currentState = stateManager->GetCurrentState();
284  if(currentState!=G4State_PreInit && currentState!=G4State_Idle)
285  {
286  G4cerr << "Illegal application state - BeamOn() ignored." << G4endl;
287  return false;
288  }
289 
291  {
292  G4cerr << " Geant4 kernel should be initialized" << G4endl;
293  G4cerr << "before the first BeamOn(). - BeamOn ignored." << G4endl;
294  return false;
295  }
296 
298  {
299  if(verboseLevel>0)
300  {
301  G4cout << "Start re-initialization because " << G4endl;
302  if(!geometryInitialized) G4cout << " Geometry" << G4endl;
303  if(!physicsInitialized) G4cout << " Physics processes" << G4endl;
304  G4cout << "has been modified since last Run." << G4endl;
305  }
306  Initialize();
307  }
308  return true;
309 }
G4bool physicsInitialized
G4bool geometryInitialized
G4bool initializedAtLeastOnce
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
virtual void Initialize()
#define G4endl
Definition: G4ios.hh:61
G4ApplicationState GetCurrentState() const
G4ApplicationState
G4int verboseLevel
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConstructScoringWorlds()

void G4RunManager::ConstructScoringWorlds ( )
virtual

Reimplemented in G4WorkerRunManager, G4MTRunManager, and tbbWorkerRunManager.

Definition at line 726 of file G4RunManager.cc.

727 {
729  if(!ScM) return;
730 
731  G4int nPar = ScM->GetNumberOfMesh();
732  if(nPar<1) return;
733 
736  for(G4int iw=0;iw<nPar;iw++)
737  {
738  G4VScoringMesh* mesh = ScM->GetMesh(iw);
740 
741  G4VPhysicalVolume* pWorld
743  ->IsWorldExisting(ScM->GetWorldName(iw));
744  if(!pWorld)
745  {
747  ->GetParallelWorld(ScM->GetWorldName(iw));
748  pWorld->SetName(ScM->GetWorldName(iw));
749 
750  G4ParallelWorldProcess* theParallelWorldProcess
751  = mesh->GetParallelWorldProcess();
752  if(theParallelWorldProcess)
753  { theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw)); }
754  else
755  {
756  theParallelWorldProcess = new G4ParallelWorldProcess(ScM->GetWorldName(iw));
757  mesh->SetParallelWorldProcess(theParallelWorldProcess);
758  theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw));
759 
760  theParticleIterator->reset();
761  while( (*theParticleIterator)() ){
762  G4ParticleDefinition* particle = theParticleIterator->value();
763  G4ProcessManager* pmanager = particle->GetProcessManager();
764  if(pmanager)
765  {
766  pmanager->AddProcess(theParallelWorldProcess);
767  if(theParallelWorldProcess->IsAtRestRequired(particle))
768  { pmanager->SetProcessOrdering(theParallelWorldProcess, idxAtRest, 9900); }
769  pmanager->SetProcessOrderingToSecond(theParallelWorldProcess, idxAlongStep);
770  pmanager->SetProcessOrdering(theParallelWorldProcess, idxPostStep, 9900);
771  }
772  }
773  }
774  }
775 
776  mesh->Construct(pWorld);
777  }
778 
780 }
void GeometryHasBeenModified(G4bool prop=true)
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
void SetParallelWorldProcess(G4ParallelWorldProcess *proc)
static G4bool fGeometryHasBeenDestroyed
void GeometryHasBeenDestroyed()
void SetProcessOrderingToSecond(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
size_t GetNumberOfMesh() const
G4bool IsAtRestRequired(G4ParticleDefinition *)
G4String GetWorldName(G4int i) const
G4ProcessManager * GetProcessManager() const
G4VScoringMesh * GetMesh(G4int i) const
void SetName(const G4String &pName)
int G4int
Definition: G4Types.hh:78
void Construct(G4VPhysicalVolume *fWorldPhys)
void SetParallelWorld(G4String parallelWorldName)
void reset(G4bool ifSkipIon=true)
static G4ScoringManager * GetScoringManagerIfExist()
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
G4ParallelWorldProcess * GetParallelWorldProcess() const
static G4TransportationManager * GetTransportationManager()
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
static G4ParticleTable * GetParticleTable()
G4PTblDicIterator * GetIterator() const
#define theParticleIterator
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CutOffHasBeenModified()

void G4RunManager::CutOffHasBeenModified ( )
inline

Definition at line 468 of file G4RunManager.hh.

469  {
470  G4cerr << "CutOffHasBeenModified becomes obsolete." << G4endl;
471  G4cerr << "It is safe to remove invoking this method." << G4endl;
472  }
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:

◆ DefineWorldVolume()

void G4RunManager::DefineWorldVolume ( G4VPhysicalVolume worldVol,
G4bool  topologyIsChanged = true 
)
virtual

Definition at line 640 of file G4RunManager.cc.

642 {
643  kernel->DefineWorldVolume(worldVol,topologyIsChanged);
644 }
G4RunManagerKernel * kernel
void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteUserInitializations()

void G4RunManager::DeleteUserInitializations ( )
protectedvirtual

Definition at line 227 of file G4RunManager.cc.

228 {
229  if( userDetector )
230  {
231  delete userDetector;
232  userDetector = 0;
233  if(verboseLevel>1) G4cout << "UserDetectorConstruction deleted." << G4endl;
234  }
235  if(physicsList)
236  {
237  delete physicsList;
238  physicsList = 0;
239  if(verboseLevel>1) G4cout << "UserPhysicsList deleted." << G4endl;
240  }
242  {
245  if(verboseLevel>1) G4cout <<"UserActionInitialization deleted." << G4endl;
246  }
248  {
251  if(verboseLevel>1) G4cout <<"UserWorkerInitialization deleted." << G4endl;
252  }
254  {
257  if(verboseLevel>1) G4cout <<"UserWorkerThreadInitialization deleted." << G4endl;
258  }
259 
260 }
G4VUserPhysicsList * physicsList
G4VUserActionInitialization * userActionInitialization
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
G4GLOB_DLL std::ostream G4cout
G4UserWorkerInitialization * userWorkerInitialization
#define G4endl
Definition: G4ios.hh:61
G4VUserDetectorConstruction * userDetector
G4int verboseLevel
Here is the caller graph for this function:

◆ DoEventLoop()

void G4RunManager::DoEventLoop ( G4int  n_event,
const char *  macroFile = 0,
G4int  n_select = -1 
)
virtual

Reimplemented in CexmcRunManager, G4WorkerRunManager, ParRunManager, and ParRunManager.

Definition at line 360 of file G4RunManager.cc.

361 {
362  InitializeEventLoop(n_event,macroFile,n_select);
363 
364 // Event loop
365  for(G4int i_event=0; i_event<n_event; i_event++ )
366  {
367  ProcessOneEvent(i_event);
369  if(runAborted) break;
370  }
371 
372  // For G4MTRunManager, TerminateEventLoop() is invoked after all threads are finished.
374 }
virtual void ProcessOneEvent(G4int i_event)
virtual void TerminateEventLoop()
RMType runManagerType
int G4int
Definition: G4Types.hh:78
G4bool runAborted
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void TerminateOneEvent()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpRegion() [1/2]

void G4RunManager::DumpRegion ( const G4String rname) const

Definition at line 703 of file G4RunManager.cc.

704 {
705  kernel->DumpRegion(rname);
706 }
void DumpRegion(const G4String &rname) const
G4RunManagerKernel * kernel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpRegion() [2/2]

void G4RunManager::DumpRegion ( G4Region region = 0) const

Definition at line 708 of file G4RunManager.cc.

709 {
710  kernel->DumpRegion(region);
711 }
void DumpRegion(const G4String &rname) const
G4RunManagerKernel * kernel
Here is the call graph for this function:

◆ GenerateEvent()

G4Event * G4RunManager::GenerateEvent ( G4int  i_event)
virtual

Reimplemented in G4WorkerRunManager.

Definition at line 429 of file G4RunManager.cc.

430 {
432  {
433  G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
434  "G4VUserPrimaryGeneratorAction is not defined!");
435  return 0;
436  }
437 
438  G4Event* anEvent = new G4Event(i_event);
439 
441  {
442  std::ostringstream oss;
443  G4Random::saveFullState(oss);
444  randomNumberStatusForThisEvent = oss.str();
446  }
447 
449  G4String fileN = "currentEvent";
450  if ( rngStatusEventsFlag ) {
451  std::ostringstream os;
452  os << "run" << currentRun->GetRunID() << "evt" << anEvent->GetEventID();
453  fileN = os.str();
454  }
455  StoreRNGStatus(fileN);
456  }
457 
458  if(printModulo > 0 && anEvent->GetEventID()%printModulo == 0 )
459  { G4cout << "--> Event " << anEvent->GetEventID() << " starts." << G4endl; }
461  return anEvent;
462 }
G4String randomNumberStatusForThisEvent
G4bool storeRandomNumberStatus
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
G4GLOB_DLL std::ostream G4cout
G4bool rngStatusEventsFlag
G4int storeRandomNumberStatusToG4Event
G4int GetRunID() const
Definition: G4Run.hh:76
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
virtual void GeneratePrimaries(G4Event *anEvent)=0
G4int GetEventID() const
Definition: G4Event.hh:151
virtual void StoreRNGStatus(const G4String &filenamePrefix)
G4Run * currentRun
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GeometryHasBeenModified()

void G4RunManager::GeometryHasBeenModified ( G4bool  prop = true)

Definition at line 892 of file G4RunManager.cc.

893 {
894  if(prop)
895  { G4UImanager::GetUIpointer()->ApplyCommand("/run/geometryModified"); }
896  else
898 }
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4RunManagerKernel * kernel
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentEvent()

const G4Event* G4RunManager::GetCurrentEvent ( ) const
inline

Definition at line 521 of file G4RunManager.hh.

522  { return currentEvent; }
G4Event * currentEvent
Here is the caller graph for this function:

◆ GetCurrentRun()

const G4Run* G4RunManager::GetCurrentRun ( ) const
inline

Definition at line 515 of file G4RunManager.hh.

516  { return currentRun; }
G4Run * currentRun
Here is the caller graph for this function:

◆ GetFlagRandomNumberStatusToG4Event()

G4int G4RunManager::GetFlagRandomNumberStatusToG4Event ( ) const
inline

Definition at line 396 of file G4RunManager.hh.

G4int storeRandomNumberStatusToG4Event
Here is the caller graph for this function:

◆ GetGeometryToBeOptimized()

G4bool G4RunManager::GetGeometryToBeOptimized ( )
inline

Definition at line 505 of file G4RunManager.hh.

506  { return geometryToBeOptimized; }
G4bool geometryToBeOptimized
Here is the caller graph for this function:

◆ GetNonConstCurrentRun()

G4Run* G4RunManager::GetNonConstCurrentRun ( ) const
inline

Definition at line 517 of file G4RunManager.hh.

518  { return currentRun; }
G4Run * currentRun
Here is the caller graph for this function:

◆ GetNonConstUserActionInitialization()

G4VUserActionInitialization* G4RunManager::GetNonConstUserActionInitialization ( ) const
inline

Definition at line 354 of file G4RunManager.hh.

355  { return userActionInitialization; }
G4VUserActionInitialization * userActionInitialization
Here is the caller graph for this function:

◆ GetNumberOfEventsToBeProcessed()

G4int G4RunManager::GetNumberOfEventsToBeProcessed ( ) const
inline

Definition at line 549 of file G4RunManager.hh.

550  { return numberOfEventToBeProcessed; }
G4int numberOfEventToBeProcessed
Here is the caller graph for this function:

◆ GetNumberOfParallelWorld()

G4int G4RunManager::GetNumberOfParallelWorld ( ) const
inline

Definition at line 545 of file G4RunManager.hh.

546  { return nParallelWorlds; }
G4int nParallelWorlds

◆ GetNumberOfSelectEvents()

G4int G4RunManager::GetNumberOfSelectEvents ( ) const
inline

Definition at line 551 of file G4RunManager.hh.

552  { return n_select_msg; }
G4int n_select_msg
Here is the caller graph for this function:

◆ GetPreviousEvent()

const G4Event* G4RunManager::GetPreviousEvent ( G4int  i) const
inline

Definition at line 525 of file G4RunManager.hh.

526  {
527  if(i>=1 && i<=n_perviousEventsToBeStored)
528  {
529  std::list<G4Event*>::iterator itr = previousEvents->begin();
530  for(G4int j=1;j<i;j++) { itr++; }
531  return *itr;
532  }
533  return 0;
534  }
int G4int
Definition: G4Types.hh:78
std::list< G4Event * > * previousEvents
G4int n_perviousEventsToBeStored
Here is the caller graph for this function:

◆ GetPrintProgress()

G4int G4RunManager::GetPrintProgress ( )
inline

Definition at line 491 of file G4RunManager.hh.

492  { return printModulo; }
Here is the caller graph for this function:

◆ GetRandomNumberStatusForThisEvent()

const G4String& G4RunManager::GetRandomNumberStatusForThisEvent ( ) const
inline

Definition at line 428 of file G4RunManager.hh.

429  {
431  { G4Exception("GrRunManager::SetRandomNumberStoreDir",
432  "Run0072",JustWarning,
433  "Random number status is not available for this event."); }
435  }
G4String randomNumberStatusForThisEvent
G4int storeRandomNumberStatusToG4Event
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:

◆ GetRandomNumberStatusForThisRun()

const G4String& G4RunManager::GetRandomNumberStatusForThisRun ( ) const
inline

Definition at line 426 of file G4RunManager.hh.

427  { return randomNumberStatusForThisRun; }
G4String randomNumberStatusForThisRun

◆ GetRandomNumberStore()

G4bool G4RunManager::GetRandomNumberStore ( ) const
inline

Definition at line 402 of file G4RunManager.hh.

403  { return storeRandomNumberStatus; }
G4bool storeRandomNumberStatus
Here is the caller graph for this function:

◆ GetRandomNumberStoreDir()

const G4String& G4RunManager::GetRandomNumberStoreDir ( ) const
inline

Definition at line 424 of file G4RunManager.hh.

425  { return randomNumberStatusDir; }
G4String randomNumberStatusDir
Here is the caller graph for this function:

◆ GetRandomNumberStorePerEvent()

G4bool G4RunManager::GetRandomNumberStorePerEvent ( ) const
inline

Definition at line 438 of file G4RunManager.hh.

439  { return rngStatusEventsFlag; }
G4bool rngStatusEventsFlag
Here is the call graph for this function:

◆ GetRunManager()

G4RunManager * G4RunManager::GetRunManager ( )
static

Definition at line 79 of file G4RunManager.cc.

80 { return fRunManager; }
static G4ThreadLocal G4RunManager * fRunManager

◆ GetRunManagerType()

RMType G4RunManager::GetRunManagerType ( ) const
inline

Definition at line 559 of file G4RunManager.hh.

560  { return runManagerType; }
RMType runManagerType
Here is the caller graph for this function:

◆ GetSelectMacro()

G4String G4RunManager::GetSelectMacro ( ) const
inline

Definition at line 553 of file G4RunManager.hh.

554  { return selectMacro; }
G4String selectMacro
Here is the caller graph for this function:

◆ GetUserActionInitialization()

const G4VUserActionInitialization* G4RunManager::GetUserActionInitialization ( ) const
inline

Definition at line 352 of file G4RunManager.hh.

353  { return userActionInitialization; }
G4VUserActionInitialization * userActionInitialization
Here is the caller graph for this function:

◆ GetUserDetectorConstruction()

const G4VUserDetectorConstruction* G4RunManager::GetUserDetectorConstruction ( ) const
inline

Definition at line 348 of file G4RunManager.hh.

349  { return userDetector; }
G4VUserDetectorConstruction * userDetector
Here is the caller graph for this function:

◆ GetUserEventAction()

const G4UserEventAction* G4RunManager::GetUserEventAction ( ) const
inline

Definition at line 364 of file G4RunManager.hh.

365  { return userEventAction; }
G4UserEventAction * userEventAction
Here is the caller graph for this function:

◆ GetUserPhysicsList()

const G4VUserPhysicsList* G4RunManager::GetUserPhysicsList ( ) const
inline

Definition at line 350 of file G4RunManager.hh.

351  { return physicsList; }
G4VUserPhysicsList * physicsList
Here is the caller graph for this function:

◆ GetUserPrimaryGeneratorAction()

const G4VUserPrimaryGeneratorAction* G4RunManager::GetUserPrimaryGeneratorAction ( ) const
inline

Definition at line 362 of file G4RunManager.hh.

363  { return userPrimaryGeneratorAction; }
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
Here is the caller graph for this function:

◆ GetUserRunAction()

const G4UserRunAction* G4RunManager::GetUserRunAction ( ) const
inline

Definition at line 360 of file G4RunManager.hh.

361  { return userRunAction; }
G4UserRunAction * userRunAction
Here is the caller graph for this function:

◆ GetUserStackingAction()

const G4UserStackingAction* G4RunManager::GetUserStackingAction ( ) const
inline

Definition at line 366 of file G4RunManager.hh.

367  { return userStackingAction; }
G4UserStackingAction * userStackingAction
Here is the caller graph for this function:

◆ GetUserSteppingAction()

const G4UserSteppingAction* G4RunManager::GetUserSteppingAction ( ) const
inline

Definition at line 370 of file G4RunManager.hh.

371  { return userSteppingAction; }
G4UserSteppingAction * userSteppingAction
Here is the caller graph for this function:

◆ GetUserTrackingAction()

const G4UserTrackingAction* G4RunManager::GetUserTrackingAction ( ) const
inline

Definition at line 368 of file G4RunManager.hh.

369  { return userTrackingAction; }
G4UserTrackingAction * userTrackingAction
Here is the caller graph for this function:

◆ GetUserWorkerInitialization()

const G4UserWorkerInitialization* G4RunManager::GetUserWorkerInitialization ( ) const
inline

Definition at line 356 of file G4RunManager.hh.

357  { return userWorkerInitialization; }
G4UserWorkerInitialization * userWorkerInitialization
Here is the caller graph for this function:

◆ GetUserWorkerThreadInitialization()

const G4UserWorkerThreadInitialization* G4RunManager::GetUserWorkerThreadInitialization ( ) const
inline

Definition at line 358 of file G4RunManager.hh.

G4UserWorkerThreadInitialization * userWorkerThreadInitialization
Here is the caller graph for this function:

◆ GetVerboseLevel()

G4int G4RunManager::GetVerboseLevel ( ) const
inline

Definition at line 489 of file G4RunManager.hh.

490  { return verboseLevel; }
G4int verboseLevel
Here is the caller graph for this function:

◆ GetVersionString()

const G4String& G4RunManager::GetVersionString ( ) const
inline

Definition at line 381 of file G4RunManager.hh.

382  { return kernel->GetVersionString(); }
const G4String & GetVersionString() const
G4RunManagerKernel * kernel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IfGeometryHasBeenDestroyed()

G4bool G4RunManager::IfGeometryHasBeenDestroyed ( )
static

Definition at line 71 of file G4RunManager.cc.

71 { return fGeometryHasBeenDestroyed; }
static G4bool fGeometryHasBeenDestroyed

◆ Initialize()

void G4RunManager::Initialize ( void  )
virtual

Reimplemented in G4MTRunManager.

Definition at line 554 of file G4RunManager.cc.

555 {
557  G4ApplicationState currentState = stateManager->GetCurrentState();
558  if(currentState!=G4State_PreInit && currentState!=G4State_Idle)
559  {
560  G4cerr << "Illegal application state - "
561  << "G4RunManager::Initialize() ignored." << G4endl;
562  return;
563  }
564 
567  initializedAtLeastOnce = true;
568 }
G4bool physicsInitialized
virtual void InitializePhysics()
virtual void InitializeGeometry()
G4bool geometryInitialized
G4bool initializedAtLeastOnce
static G4StateManager * GetStateManager()
#define G4endl
Definition: G4ios.hh:61
G4ApplicationState GetCurrentState() const
G4ApplicationState
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeEventLoop()

void G4RunManager::InitializeEventLoop ( G4int  n_event,
const char *  macroFile = 0,
G4int  n_select = -1 
)
virtual

Reimplemented in G4MTRunManager.

Definition at line 376 of file G4RunManager.cc.

377 {
378  if(verboseLevel>0)
379  { timer->Start(); }
380 
381  n_select_msg = n_select;
382  if(macroFile!=0)
383  {
384  if(n_select_msg<0) n_select_msg = n_event;
385  msgText = "/control/execute ";
386  msgText += macroFile;
387  selectMacro = macroFile;
388  }
389  else
390  {
391  n_select_msg = -1;
392  selectMacro = "";
393  }
394 }
G4Timer * timer
G4int n_select_msg
G4String msgText
G4String selectMacro
void Start()
G4int verboseLevel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeGeometry()

void G4RunManager::InitializeGeometry ( )
virtual

Reimplemented in G4WorkerRunManager.

Definition at line 570 of file G4RunManager.cc.

571 {
572  if(!userDetector)
573  {
574  G4Exception("G4RunManager::InitializeGeometry", "Run0033",
575  FatalException, "G4VUserDetectorConstruction is not defined!");
576  return;
577  }
578 
579  if(verboseLevel>1) G4cout << "userDetector->Construct() start." << G4endl;
580 
586  geometryInitialized = true;
587 }
virtual G4VPhysicalVolume * Construct()=0
void SetNumberOfParallelWorld(G4int i)
G4bool geometryInitialized
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int nParallelWorlds
#define G4endl
Definition: G4ios.hh:61
G4RunManagerKernel * kernel
G4VUserDetectorConstruction * userDetector
G4int verboseLevel
void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializePhysics()

void G4RunManager::InitializePhysics ( )
virtual

Definition at line 589 of file G4RunManager.cc.

590 {
591  if(physicsList)
592  {
594  }
595  else
596  {
597  G4Exception("G4RunManager::InitializePhysics()", "Run0034",
598  FatalException, "G4VUserPhysicsList is not defined!");
599  }
600  physicsInitialized = true;
601 
602 }
G4VUserPhysicsList * physicsList
G4bool physicsInitialized
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4RunManagerKernel * kernel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

G4RunManager& G4RunManager::operator= ( const G4RunManager )
inlineprivate

Definition at line 575 of file G4RunManager.hh.

575 { return *this; }

◆ PhysicsHasBeenModified()

void G4RunManager::PhysicsHasBeenModified ( )
inline

Definition at line 460 of file G4RunManager.hh.

G4RunManagerKernel * kernel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessOneEvent()

void G4RunManager::ProcessOneEvent ( G4int  i_event)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 396 of file G4RunManager.cc.

397 {
398  currentEvent = GenerateEvent(i_event);
401  UpdateScoring();
403 }
G4int n_select_msg
G4String msgText
G4Event * currentEvent
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
virtual G4Event * GenerateEvent(G4int i_event)
virtual void AnalyzeEvent(G4Event *anEvent)
void ProcessOneEvent(G4Event *anEvent)
G4EventManager * eventManager
void UpdateScoring()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReinitializeGeometry()

void G4RunManager::ReinitializeGeometry ( G4bool  destroyFirst = false,
G4bool  prop = true 
)

Definition at line 906 of file G4RunManager.cc.

907 {
908  if(destroyFirst && G4Threading::IsMasterThread())
909  {
910  if(verboseLevel>0)
911  {
912  G4cout<<"#### G4PhysicalVolumeStore, G4LogicalVolumeStore and G4SolidStore\n"
913  <<"#### are wiped out."<<G4endl;
914  }
919 
920  // remove all logical volume pointers from regions
921  // exception: world logical volume pointer must be kept
922  G4RegionStore* regionStore = G4RegionStore::GetInstance();
923  std::vector<G4Region*>::iterator rItr;
924  for(rItr = regionStore->begin();rItr != regionStore->end(); rItr++)
925  {
926  if((*rItr)->GetName()=="DefaultRegionForTheWorld") continue;
927  //if((*rItr)->GetName()=="DefaultRegionForParallelWorld") continue;
928  std::vector<G4LogicalVolume*>::iterator lvItr
929  = (*rItr)->GetRootLogicalVolumeIterator();
930  for(size_t iRLV = 0;iRLV < (*rItr)->GetNumberOfRootVolumes(); iRLV++)
931  {
932  (*rItr)->RemoveRootLogicalVolume(*lvItr,false);
933  lvItr++;
934  }
935  if(verboseLevel>0)
936  { G4cout<<"#### Region <"<<(*rItr)->GetName()<<"> is cleared."<<G4endl; }
937  }
938 
939  // clear transportation manager
942  }
943  if(prop)
944  { G4UImanager::GetUIpointer()->ApplyCommand("/run/reinitializeGeometry"); }
945  else
946  {
948  geometryInitialized = false;
949  }
950 }
static G4bool fGeometryHasBeenDestroyed
static void Clean()
Definition: G4SolidStore.cc:79
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
static G4PhysicalVolumeStore * GetInstance()
G4bool geometryInitialized
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
static G4GeometryManager * GetInstance()
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4bool IsMasterThread()
Definition: G4Threading.cc:136
G4RunManagerKernel * kernel
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
G4int verboseLevel
Here is the call graph for this function:

◆ ReOptimize()

void G4RunManager::ReOptimize ( G4LogicalVolume pLog)

Definition at line 810 of file G4RunManager.cc.

811 {
812  G4Timer localtimer;
813  if(verboseLevel>1)
814  { localtimer.Start(); }
815  G4SmartVoxelHeader* header = pLog->GetVoxelHeader();
816  delete header;
817  header = new G4SmartVoxelHeader(pLog);
818  pLog->SetVoxelHeader(header);
819  if(verboseLevel>1)
820  {
821  localtimer.Stop();
822  G4SmartVoxelStat stat(pLog,header,localtimer.GetSystemElapsed(),
823  localtimer.GetUserElapsed());
824  G4cout << G4endl << "Voxelisation of logical volume <"
825  << pLog->GetName() << ">" << G4endl;
826  G4cout << " heads : " << stat.GetNumberHeads() << " - nodes : "
827  << stat.GetNumberNodes() << " - pointers : "
828  << stat.GetNumberPointers() << G4endl;
829  G4cout << " Memory used : " << (stat.GetMemoryUse()+512)/1024
830  << "k - total time : " << stat.GetTotalTime()
831  << " - system time : " << stat.GetSysTime() << G4endl;
832  }
833 }
void SetVoxelHeader(G4SmartVoxelHeader *pVoxel)
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4SmartVoxelHeader * GetVoxelHeader() const
G4double GetUserElapsed() const
Definition: G4Timer.cc:130
void Stop()
#define G4endl
Definition: G4ios.hh:61
G4double GetSystemElapsed() const
Definition: G4Timer.cc:119
void Start()
G4int verboseLevel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReOptimizeMotherOf()

void G4RunManager::ReOptimizeMotherOf ( G4VPhysicalVolume pPhys)

Definition at line 804 of file G4RunManager.cc.

805 {
806  G4LogicalVolume* pMotherL = pPhys->GetMotherLogical();
807  if(pMotherL) ReOptimize(pMotherL);
808 }
void ReOptimize(G4LogicalVolume *)
G4LogicalVolume * GetMotherLogical() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RestoreRandomNumberStatus()

void G4RunManager::RestoreRandomNumberStatus ( const G4String fileN)
virtual

Definition at line 689 of file G4RunManager.cc.

690 {
691  G4String fileNameWithDirectory;
692  if(fileN.index("/")==std::string::npos)
693  { fileNameWithDirectory = randomNumberStatusDir+fileN; }
694  else
695  { fileNameWithDirectory = fileN; }
696 
697  G4Random::restoreEngineStatus(fileNameWithDirectory);
698  if(verboseLevel>0) G4cout << "RandomNumberEngineStatus restored from file: "
699  << fileNameWithDirectory << G4endl;
700  G4Random::showEngineStatus();
701 }
str_size index(const char *, G4int pos=0) const
G4GLOB_DLL std::ostream G4cout
G4String randomNumberStatusDir
#define G4endl
Definition: G4ios.hh:61
G4int verboseLevel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RestoreRndmEachEvent()

virtual void G4RunManager::RestoreRndmEachEvent ( G4bool  )
inlinevirtual

Reimplemented in G4WorkerRunManager.

Definition at line 585 of file G4RunManager.hh.

585 { /*No effect in SEQ */ }
Here is the caller graph for this function:

◆ rndmSaveThisEvent()

void G4RunManager::rndmSaveThisEvent ( )
virtual

Definition at line 668 of file G4RunManager.cc.

669 {
671  G4cerr << "Warning from G4RunManager::rndmSaveThisEvent():"
672  << " there is no currentEvent or its RandomEngineStatus is not available."
673  << G4endl << "Command ignored." << G4endl;
674  return;
675  }
676 
677  G4String fileIn = randomNumberStatusDir + "currentEvent.rndm";
678 
679  std::ostringstream os;
680  os << "run" << currentRun->GetRunID() << "evt" << currentEvent->GetEventID()
681  << ".rndm" << '\0';
682  G4String fileOut = randomNumberStatusDir + os.str();
683 
684  G4String copCmd = "/control/shell cp "+fileIn+" "+fileOut;
686  if(verboseLevel>0) G4cout << "currentEvent.rndm is copied to file: " << fileOut << G4endl;
687 }
G4bool storeRandomNumberStatus
G4Event * currentEvent
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
G4String randomNumberStatusDir
G4int GetRunID() const
Definition: G4Run.hh:76
G4int GetEventID() const
Definition: G4Event.hh:151
G4Run * currentRun
#define G4endl
Definition: G4ios.hh:61
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
G4int verboseLevel
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rndmSaveThisRun()

void G4RunManager::rndmSaveThisRun ( )
virtual

Definition at line 646 of file G4RunManager.cc.

647 {
648  G4int runNumber = 0;
649  if(currentRun) runNumber = currentRun->GetRunID();
651  G4cerr << "Warning from G4RunManager::rndmSaveThisRun():"
652  << " Random number status was not stored prior to this run."
653  << G4endl << "Command ignored." << G4endl;
654  return;
655  }
656 
657  G4String fileIn = randomNumberStatusDir + "currentRun.rndm";
658 
659  std::ostringstream os;
660  os << "run" << runNumber << ".rndm" << '\0';
661  G4String fileOut = randomNumberStatusDir + os.str();
662 
663  G4String copCmd = "/control/shell cp "+fileIn+" "+fileOut;
665  if(verboseLevel>0) G4cout << "currentRun.rndm is copied to file: " << fileOut << G4endl;
666 }
G4bool storeRandomNumberStatus
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
G4String randomNumberStatusDir
G4int GetRunID() const
Definition: G4Run.hh:76
G4Run * currentRun
#define G4endl
Definition: G4ios.hh:61
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
G4int verboseLevel
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunInitialization()

void G4RunManager::RunInitialization ( )
virtual

Reimplemented in G4WorkerRunManager.

Definition at line 311 of file G4RunManager.cc.

312 {
313  if(!(kernel->RunInitialization(fakeRun))) return;
314 
315  runAborted = false;
317 
319  if(currentRun) delete currentRun;
320  currentRun = 0;
321 
322  if(fakeRun) return;
323 
325 
327  if(!currentRun) currentRun = new G4Run();
328 
331 
334  if(fSDM)
335  { currentRun->SetHCtable(fSDM->GetHCtable()); }
336 
337  std::ostringstream oss;
338  G4Random::saveFullState(oss);
339  randomNumberStatusForThisRun = oss.str();
341 
342  for(G4int i_prev=0;i_prev<n_perviousEventsToBeStored;i_prev++)
343  { previousEvents->push_back((G4Event*)0); }
344 
345  if(printModulo>=0 || verboseLevel>0)
346  { G4cout << "### Run " << currentRun->GetRunID() << " starts." << G4endl; }
348 
350  G4String fileN = "currentRun";
351  if ( rngStatusEventsFlag ) {
352  std::ostringstream os;
353  os << "run" << currentRun->GetRunID();
354  fileN = os.str();
355  }
356  StoreRNGStatus(fileN);
357  }
358 }
void SetNumberOfEventToBeProcessed(G4int n_ev)
Definition: G4Run.hh:97
G4int numberOfEventToBeProcessed
void SetDCtable(G4DCtable *DCtbl)
Definition: G4Run.hh:101
G4int numberOfEventProcessed
G4String randomNumberStatusForThisRun
static G4bool fGeometryHasBeenDestroyed
G4bool storeRandomNumberStatus
int G4int
Definition: G4Types.hh:78
G4bool runAborted
G4bool RunInitialization(G4bool fakeRun=false)
static G4ParallelWorldProcessStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
G4bool rngStatusEventsFlag
Definition: G4Run.hh:46
std::list< G4Event * > * previousEvents
G4UserRunAction * userRunAction
G4int GetRunID() const
Definition: G4Run.hh:76
void SetHCtable(G4HCtable *HCtbl)
Definition: G4Run.hh:99
G4int runIDCounter
void CleanUpPreviousEvents()
virtual void StoreRNGStatus(const G4String &filenamePrefix)
virtual void BeginOfRunAction(const G4Run *aRun)
G4Run * currentRun
#define G4endl
Definition: G4ios.hh:61
G4RunManagerKernel * kernel
G4HCtable * GetHCtable() const
Definition: G4SDManager.hh:101
void SetRunID(G4int id)
Definition: G4Run.hh:95
void SetRandomNumberStatus(G4String &st)
Definition: G4Run.hh:103
virtual G4Run * GenerateRun()
G4DCtable * DCtable
G4int n_perviousEventsToBeStored
G4int verboseLevel
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunTermination()

void G4RunManager::RunTermination ( )
virtual

Reimplemented in G4MTRunManager, G4WorkerRunManager, and tbbMasterRunManager.

Definition at line 477 of file G4RunManager.cc.

478 {
479  if(!fakeRun)
480  {
484  if(fPersM) fPersM->Store(currentRun);
485  runIDCounter++;
486  }
487 
489 }
void CleanUpUnnecessaryEvents(G4int keepNEvents)
virtual void EndOfRunAction(const G4Run *aRun)
virtual G4bool Store(const G4Event *anEvent)=0
G4UserRunAction * userRunAction
G4int runIDCounter
G4Run * currentRun
G4RunManagerKernel * kernel
static G4VPersistencyManager * GetPersistencyManager()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDCtable()

void G4RunManager::SetDCtable ( G4DCtable DCtbl)
inline

Definition at line 555 of file G4RunManager.hh.

556  { DCtable = DCtbl; }
G4DCtable * DCtable
Here is the caller graph for this function:

◆ SetGeometryToBeOptimized()

void G4RunManager::SetGeometryToBeOptimized ( G4bool  vl)
inline

Definition at line 496 of file G4RunManager.hh.

497  {
498  if(geometryToBeOptimized != vl)
499  {
503  }
504  }
void SetGeometryToBeOptimized(G4bool vl)
G4bool geometryToBeOptimized
G4RunManagerKernel * kernel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNumberOfAdditionalWaitingStacks()

void G4RunManager::SetNumberOfAdditionalWaitingStacks ( G4int  iAdd)
inline

Definition at line 374 of file G4RunManager.hh.

G4EventManager * eventManager
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
Here is the call graph for this function:

◆ SetNumberOfEventsToBeProcessed()

void G4RunManager::SetNumberOfEventsToBeProcessed ( G4int  val)
inline

Definition at line 547 of file G4RunManager.hh.

548  { numberOfEventToBeProcessed = val; }
G4int numberOfEventToBeProcessed

◆ SetNumberOfEventsToBeStored()

void G4RunManager::SetNumberOfEventsToBeStored ( G4int  val)
inline

Definition at line 509 of file G4RunManager.hh.

510  { n_perviousEventsToBeStored = val; }
G4int n_perviousEventsToBeStored

◆ SetPrimaryTransformer()

void G4RunManager::SetPrimaryTransformer ( G4PrimaryTransformer pt)
inline

Definition at line 384 of file G4RunManager.hh.

385  { kernel->SetPrimaryTransformer(pt); }
void SetPrimaryTransformer(G4PrimaryTransformer *pt)
G4RunManagerKernel * kernel
Here is the call graph for this function:

◆ SetPrintProgress()

void G4RunManager::SetPrintProgress ( G4int  i)
inline

Definition at line 493 of file G4RunManager.hh.

494  { printModulo = i; }
Here is the caller graph for this function:

◆ SetRandomNumberStore()

void G4RunManager::SetRandomNumberStore ( G4bool  flag)
inline

Definition at line 400 of file G4RunManager.hh.

401  { storeRandomNumberStatus = flag; }
G4bool storeRandomNumberStatus
Here is the caller graph for this function:

◆ SetRandomNumberStoreDir()

void G4RunManager::SetRandomNumberStoreDir ( const G4String dir)
inline

Definition at line 404 of file G4RunManager.hh.

405  {
406  G4String dirStr = dir;
407  if( dirStr(dirStr.length()-1) != '/' ) dirStr += "/";
408 #ifndef WIN32
409  G4String shellCmd = "mkdir -p ";
410 #else
411  std::replace(dirStr.begin(), dirStr.end(),'/','\\');
412  G4String shellCmd = "if not exist " + dirStr + " mkdir ";
413 #endif
414  shellCmd += dirStr;
415  randomNumberStatusDir = dirStr;
416  G4int sysret = system(shellCmd);
417  if(sysret!=0)
418  {
419  G4String errmsg = "\"" + shellCmd + "\" returns non-zero value. Directory creation failed.";
420  G4Exception("GrRunManager::SetRandomNumberStoreDir","Run0071",JustWarning,errmsg);
421  G4cerr << " return value = " << sysret << G4endl;
422  }
423  }
TDirectory * dir
int G4int
Definition: G4Types.hh:78
G4String randomNumberStatusDir
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
system("rm -rf microbeam.root")
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetRandomNumberStorePerEvent()

void G4RunManager::SetRandomNumberStorePerEvent ( G4bool  flag)
inline

Definition at line 436 of file G4RunManager.hh.

437  { rngStatusEventsFlag = flag; }
G4bool rngStatusEventsFlag
Here is the caller graph for this function:

◆ SetRunIDCounter()

void G4RunManager::SetRunIDCounter ( G4int  i)
inline

Definition at line 539 of file G4RunManager.hh.

540  { runIDCounter = i; }
G4int runIDCounter
Here is the caller graph for this function:

◆ SetUserAction() [1/6]

void G4RunManager::SetUserAction ( G4UserRunAction userAction)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 862 of file G4RunManager.cc.

863 { userRunAction = userAction; }
G4UserRunAction * userRunAction
Here is the caller graph for this function:

◆ SetUserAction() [2/6]

void G4RunManager::SetUserAction ( G4VUserPrimaryGeneratorAction userAction)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 865 of file G4RunManager.cc.

866 { userPrimaryGeneratorAction = userAction; }
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction

◆ SetUserAction() [3/6]

void G4RunManager::SetUserAction ( G4UserEventAction userAction)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 868 of file G4RunManager.cc.

869 {
870  eventManager->SetUserAction(userAction);
871  userEventAction = userAction;
872 }
G4UserEventAction * userEventAction
void SetUserAction(G4UserEventAction *userAction)
G4EventManager * eventManager
Here is the call graph for this function:

◆ SetUserAction() [4/6]

void G4RunManager::SetUserAction ( G4UserStackingAction userAction)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 874 of file G4RunManager.cc.

875 {
876  eventManager->SetUserAction(userAction);
877  userStackingAction = userAction;
878 }
void SetUserAction(G4UserEventAction *userAction)
G4EventManager * eventManager
G4UserStackingAction * userStackingAction
Here is the call graph for this function:

◆ SetUserAction() [5/6]

void G4RunManager::SetUserAction ( G4UserTrackingAction userAction)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 880 of file G4RunManager.cc.

881 {
882  eventManager->SetUserAction(userAction);
883  userTrackingAction = userAction;
884 }
G4UserTrackingAction * userTrackingAction
void SetUserAction(G4UserEventAction *userAction)
G4EventManager * eventManager
Here is the call graph for this function:

◆ SetUserAction() [6/6]

void G4RunManager::SetUserAction ( G4UserSteppingAction userAction)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 886 of file G4RunManager.cc.

887 {
888  eventManager->SetUserAction(userAction);
889  userSteppingAction = userAction;
890 }
void SetUserAction(G4UserEventAction *userAction)
G4EventManager * eventManager
G4UserSteppingAction * userSteppingAction
Here is the call graph for this function:

◆ SetUserInitialization() [1/5]

void G4RunManager::SetUserInitialization ( G4VUserDetectorConstruction userInit)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 835 of file G4RunManager.cc.

836 { userDetector = userInit; }
G4VUserDetectorConstruction * userDetector
Here is the caller graph for this function:

◆ SetUserInitialization() [2/5]

void G4RunManager::SetUserInitialization ( G4VUserPhysicsList userInit)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 838 of file G4RunManager.cc.

839 {
840  physicsList = userInit;
841  kernel->SetPhysics(userInit);
842 }
void SetPhysics(G4VUserPhysicsList *uPhys)
G4VUserPhysicsList * physicsList
G4RunManagerKernel * kernel
Here is the call graph for this function:

◆ SetUserInitialization() [3/5]

void G4RunManager::SetUserInitialization ( G4VUserActionInitialization userInit)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 856 of file G4RunManager.cc.

857 {
858  userActionInitialization = userInit;
860 }
G4VUserActionInitialization * userActionInitialization
virtual void Build() const =0
Here is the call graph for this function:

◆ SetUserInitialization() [4/5]

void G4RunManager::SetUserInitialization ( G4UserWorkerInitialization userInit)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 844 of file G4RunManager.cc.

845 {
846  G4Exception("G4RunManager::SetUserInitialization()", "Run3001", FatalException,
847  "Base-class G4RunManager cannot take G4UserWorkerInitialization. Use G4MTRunManager.");
848 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:

◆ SetUserInitialization() [5/5]

void G4RunManager::SetUserInitialization ( G4UserWorkerThreadInitialization userInit)
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 850 of file G4RunManager.cc.

851 {
852  G4Exception("G4RunManager::SetUserThreadInitialization()", "Run3001", FatalException,
853  "Base-class G4RunManager cannot take G4UserWorkerThreadInitialization. Use G4MTRunManager.");
854 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:

◆ SetVerboseLevel()

void G4RunManager::SetVerboseLevel ( G4int  vl)
inline

Definition at line 486 of file G4RunManager.hh.

487  { verboseLevel = vl;
488  kernel->SetVerboseLevel(vl); }
G4RunManagerKernel * kernel
void SetVerboseLevel(G4int vl)
G4int verboseLevel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StackPreviousEvent()

void G4RunManager::StackPreviousEvent ( G4Event anEvent)
protected

Definition at line 539 of file G4RunManager.cc.

540 {
541  if(anEvent->ToBeKept()) currentRun->StoreEvent(anEvent);
542 
544  {
545  if(anEvent->GetNumberOfGrips()==0)
546  { if(!(anEvent->ToBeKept())) delete anEvent; }
547  else
548  { previousEvents->push_back(anEvent); }
549  }
550 
552 }
G4bool ToBeKept() const
Definition: G4Event.hh:137
void CleanUpUnnecessaryEvents(G4int keepNEvents)
std::list< G4Event * > * previousEvents
void StoreEvent(G4Event *evt)
Definition: G4Run.cc:62
G4Run * currentRun
G4int n_perviousEventsToBeStored
G4int GetNumberOfGrips() const
Definition: G4Event.hh:147
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreRandomNumberStatusToG4Event()

void G4RunManager::StoreRandomNumberStatusToG4Event ( G4int  vl)
inline

Definition at line 387 of file G4RunManager.hh.

392  {
395  }
G4int storeRandomNumberStatusToG4Event
void StoreRandomNumberStatusToG4Event(G4int vl)
G4EventManager * eventManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreRNGStatus()

void G4RunManager::StoreRNGStatus ( const G4String filenamePrefix)
protectedvirtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 464 of file G4RunManager.cc.

465 {
466  G4String fileN = randomNumberStatusDir + fnpref+".rndm";
467  G4Random::saveEngineStatus(fileN);
468 }
G4String randomNumberStatusDir
Here is the caller graph for this function:

◆ TerminateEventLoop()

void G4RunManager::TerminateEventLoop ( )
virtual

Reimplemented in G4WorkerRunManager.

Definition at line 412 of file G4RunManager.cc.

413 {
414  if(verboseLevel>0 && !fakeRun)
415  {
416  timer->Stop();
417  G4cout << " Run terminated." << G4endl;
418  G4cout << "Run Summary" << G4endl;
419  if(runAborted)
420  { G4cout << " Run Aborted after " << numberOfEventProcessed << " events processed." << G4endl; }
421  else
422  { G4cout << " Number of events processed : " << numberOfEventProcessed << G4endl; }
423  G4cout << " " << *timer << G4endl;
424  }
427 }
G4Timer * timer
G4int numberOfEventProcessed
static G4bool fGeometryHasBeenDestroyed
G4bool runAborted
G4GLOB_DLL std::ostream G4cout
void Stop()
#define G4endl
Definition: G4ios.hh:61
G4int verboseLevel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TerminateOneEvent()

void G4RunManager::TerminateOneEvent ( )
virtual

Reimplemented in G4MTRunManager.

Definition at line 405 of file G4RunManager.cc.

406 {
408  currentEvent = 0;
410 }
G4int numberOfEventProcessed
G4Event * currentEvent
void StackPreviousEvent(G4Event *anEvent)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateScoring()

void G4RunManager::UpdateScoring ( )
protected

Definition at line 782 of file G4RunManager.cc.

783 {
785  if(!ScM) return;
786  G4int nPar = ScM->GetNumberOfMesh();
787  if(nPar<1) return;
788 
790  if(!HCE) return;
791  G4int nColl = HCE->GetCapacity();
792  for(G4int i=0;i<nColl;i++)
793  {
794  G4VHitsCollection* HC = HCE->GetHC(i);
795  if(HC) ScM->Accumulate(HC);
796  }
797 }
size_t GetNumberOfMesh() const
int G4int
Definition: G4Types.hh:78
G4Event * currentEvent
static G4ScoringManager * GetScoringManagerIfExist()
void Accumulate(G4VHitsCollection *map)
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ currentEvent

G4Event* G4RunManager::currentEvent
protected

Definition at line 306 of file G4RunManager.hh.

◆ currentRun

G4Run* G4RunManager::currentRun
protected

Definition at line 305 of file G4RunManager.hh.

◆ currentWorld

G4VPhysicalVolume* G4RunManager::currentWorld
protected

Definition at line 319 of file G4RunManager.hh.

◆ DCtable

G4DCtable* G4RunManager::DCtable
protected

Definition at line 303 of file G4RunManager.hh.

◆ eventManager

G4EventManager* G4RunManager::eventManager
protected

Definition at line 275 of file G4RunManager.hh.

◆ fakeRun

G4bool G4RunManager::fakeRun
protected

Definition at line 327 of file G4RunManager.hh.

◆ fGeometryHasBeenDestroyed

G4bool G4RunManager::fGeometryHasBeenDestroyed = false
staticprotected

Definition at line 579 of file G4RunManager.hh.

◆ fRunManager

G4ThreadLocal G4RunManager * G4RunManager::fRunManager = 0
staticprivate

Definition at line 148 of file G4RunManager.hh.

◆ geometryInitialized

G4bool G4RunManager::geometryInitialized
protected

Definition at line 293 of file G4RunManager.hh.

◆ geometryToBeOptimized

G4bool G4RunManager::geometryToBeOptimized
protected

Definition at line 297 of file G4RunManager.hh.

◆ initializedAtLeastOnce

G4bool G4RunManager::initializedAtLeastOnce
protected

Definition at line 296 of file G4RunManager.hh.

◆ kernel

G4RunManagerKernel* G4RunManager::kernel
protected

Definition at line 274 of file G4RunManager.hh.

◆ msgText

G4String G4RunManager::msgText
protected

Definition at line 323 of file G4RunManager.hh.

◆ n_perviousEventsToBeStored

G4int G4RunManager::n_perviousEventsToBeStored
protected

Definition at line 308 of file G4RunManager.hh.

◆ n_select_msg

G4int G4RunManager::n_select_msg
protected

Definition at line 324 of file G4RunManager.hh.

◆ nParallelWorlds

G4int G4RunManager::nParallelWorlds
protected

Definition at line 321 of file G4RunManager.hh.

◆ numberOfEventProcessed

G4int G4RunManager::numberOfEventProcessed
protected

Definition at line 325 of file G4RunManager.hh.

◆ numberOfEventToBeProcessed

G4int G4RunManager::numberOfEventToBeProcessed
protected

Definition at line 309 of file G4RunManager.hh.

◆ physicsInitialized

G4bool G4RunManager::physicsInitialized
protected

Definition at line 294 of file G4RunManager.hh.

◆ physicsList

G4VUserPhysicsList* G4RunManager::physicsList
protected

Definition at line 278 of file G4RunManager.hh.

◆ previousEvents

std::list<G4Event*>* G4RunManager::previousEvents
protected

Definition at line 307 of file G4RunManager.hh.

◆ printModulo

G4int G4RunManager::printModulo
protected

Definition at line 301 of file G4RunManager.hh.

◆ randomNumberStatusDir

G4String G4RunManager::randomNumberStatusDir
protected

Definition at line 313 of file G4RunManager.hh.

◆ randomNumberStatusForThisEvent

G4String G4RunManager::randomNumberStatusForThisEvent
protected

Definition at line 315 of file G4RunManager.hh.

◆ randomNumberStatusForThisRun

G4String G4RunManager::randomNumberStatusForThisRun
protected

Definition at line 314 of file G4RunManager.hh.

◆ rngStatusEventsFlag

G4bool G4RunManager::rngStatusEventsFlag
protected

Definition at line 316 of file G4RunManager.hh.

◆ runAborted

G4bool G4RunManager::runAborted
protected

Definition at line 295 of file G4RunManager.hh.

◆ runIDCounter

G4int G4RunManager::runIDCounter
protected

Definition at line 299 of file G4RunManager.hh.

◆ runManagerType

RMType G4RunManager::runManagerType
protected

Definition at line 563 of file G4RunManager.hh.

◆ runMessenger

G4RunMessenger* G4RunManager::runMessenger
private

Definition at line 290 of file G4RunManager.hh.

◆ selectMacro

G4String G4RunManager::selectMacro
protected

Definition at line 326 of file G4RunManager.hh.

◆ storeRandomNumberStatus

G4bool G4RunManager::storeRandomNumberStatus
protected

Definition at line 311 of file G4RunManager.hh.

◆ storeRandomNumberStatusToG4Event

G4int G4RunManager::storeRandomNumberStatusToG4Event
protected

Definition at line 312 of file G4RunManager.hh.

◆ timer

G4Timer* G4RunManager::timer
protected

Definition at line 302 of file G4RunManager.hh.

◆ userActionInitialization

G4VUserActionInitialization* G4RunManager::userActionInitialization
protected

Definition at line 279 of file G4RunManager.hh.

◆ userDetector

G4VUserDetectorConstruction* G4RunManager::userDetector
protected

Definition at line 277 of file G4RunManager.hh.

◆ userEventAction

G4UserEventAction* G4RunManager::userEventAction
protected

Definition at line 284 of file G4RunManager.hh.

◆ userPrimaryGeneratorAction

G4VUserPrimaryGeneratorAction* G4RunManager::userPrimaryGeneratorAction
protected

Definition at line 283 of file G4RunManager.hh.

◆ userRunAction

G4UserRunAction* G4RunManager::userRunAction
protected

Definition at line 282 of file G4RunManager.hh.

◆ userStackingAction

G4UserStackingAction* G4RunManager::userStackingAction
protected

Definition at line 285 of file G4RunManager.hh.

◆ userSteppingAction

G4UserSteppingAction* G4RunManager::userSteppingAction
protected

Definition at line 287 of file G4RunManager.hh.

◆ userTrackingAction

G4UserTrackingAction* G4RunManager::userTrackingAction
protected

Definition at line 286 of file G4RunManager.hh.

◆ userWorkerInitialization

G4UserWorkerInitialization* G4RunManager::userWorkerInitialization
protected

Definition at line 280 of file G4RunManager.hh.

◆ userWorkerThreadInitialization

G4UserWorkerThreadInitialization* G4RunManager::userWorkerThreadInitialization
protected

Definition at line 281 of file G4RunManager.hh.

◆ verboseLevel

G4int G4RunManager::verboseLevel
protected

Definition at line 300 of file G4RunManager.hh.


The documentation for this class was generated from the following files: