106 #ifndef G4RunManager_h
107 #define G4RunManager_h 1
160 virtual void BeamOn(
G4int n_event,
const char* macroFile=0,
G4int n_select=-1);
182 G4bool topologyIsChanged=
true);
393 storeRandomNumberStatusToG4Event = vl;
401 { storeRandomNumberStatus = flag; }
407 if( dirStr(dirStr.length()-1) !=
'/' ) dirStr +=
"/";
411 std::replace(dirStr.begin(), dirStr.end(),
'/',
'\\');
412 G4String shellCmd =
"if not exist " + dirStr +
" mkdir ";
415 randomNumberStatusDir = dirStr;
416 G4int sysret = system(shellCmd);
419 G4String errmsg =
"\"" + shellCmd +
"\" returns non-zero value. Directory creation failed.";
430 if(storeRandomNumberStatusToG4Event==0 || storeRandomNumberStatusToG4Event==2)
431 {
G4Exception(
"GrRunManager::SetRandomNumberStoreDir",
433 "Random number status is not available for this event."); }
437 { rngStatusEventsFlag = flag; }
470 G4cerr <<
"CutOffHasBeenModified becomes obsolete." <<
G4endl;
471 G4cerr <<
"It is safe to remove invoking this method." <<
G4endl;
498 if(geometryToBeOptimized != vl)
500 geometryToBeOptimized = vl;
510 { n_perviousEventsToBeStored = val; }
527 if(i>=1 && i<=n_perviousEventsToBeStored)
529 std::list<G4Event*>::iterator itr = previousEvents->begin();
530 for(
G4int j=1;j<i;j++) { itr++; }
540 { runIDCounter = i; }
548 { numberOfEventToBeProcessed = val; }
void GeometryHasBeenModified(G4bool prop=true)
G4int GetVerboseLevel() const
virtual void AbortRun(G4bool softAbort=false)
G4int numberOfEventToBeProcessed
const G4String & GetVersionString() const
virtual void ProcessOneEvent(G4int i_event)
virtual void TerminateEventLoop()
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
const G4VUserPrimaryGeneratorAction * GetUserPrimaryGeneratorAction() const
void SetPrimaryTransformer(G4PrimaryTransformer *pt)
G4int numberOfEventProcessed
G4UserTrackingAction * userTrackingAction
G4String randomNumberStatusForThisRun
virtual void RunTermination()
G4VUserPhysicsList * physicsList
G4String randomNumberStatusForThisEvent
static G4bool fGeometryHasBeenDestroyed
const G4String & GetRandomNumberStoreDir() const
void SetVerboseLevel(G4int vl)
G4VUserActionInitialization * userActionInitialization
void SetPrimaryTransformer(G4PrimaryTransformer *pt)
G4bool GetRandomNumberStore() const
G4bool storeRandomNumberStatus
G4String GetSelectMacro() const
void SetPrintProgress(G4int i)
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
virtual void RunInitialization()
G4RunManager(const G4RunManager &)
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
void CleanUpUnnecessaryEvents(G4int keepNEvents)
void SetGeometryToBeOptimized(G4bool vl)
G4bool physicsInitialized
G4VPhysicalVolume * currentWorld
const G4Event * GetPreviousEvent(G4int i) const
void SetRandomNumberStorePerEvent(G4bool flag)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
const G4UserWorkerInitialization * GetUserWorkerInitialization() const
void SetRandomNumberStore(G4bool flag)
G4int GetFlagRandomNumberStatusToG4Event() const
virtual void InitializePhysics()
void ReOptimize(G4LogicalVolume *)
void SetGeometryToBeOptimized(G4bool vl)
const G4UserSteppingAction * GetUserSteppingAction() const
const G4Run * GetCurrentRun() const
virtual void InitializeGeometry()
G4bool GetGeometryToBeOptimized()
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
virtual G4bool ConfirmBeamOnCondition()
virtual void RestoreRandomNumberStatus(const G4String &fileN)
G4bool geometryInitialized
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
G4bool initializedAtLeastOnce
G4int GetNumberOfParallelWorld() const
virtual void rndmSaveThisRun()
virtual G4Event * GenerateEvent(G4int i_event)
static G4bool IfGeometryHasBeenDestroyed()
void StoreRandomNumberStatusToG4Event(G4int vl)
G4bool geometryToBeOptimized
const G4UserStackingAction * GetUserStackingAction() const
const G4String & GetVersionString() const
G4UserWorkerInitialization * userWorkerInitialization
G4String randomNumberStatusDir
void PhysicsHasBeenModified()
RMType GetRunManagerType() const
G4bool rngStatusEventsFlag
virtual void ConstructScoringWorlds()
virtual void AnalyzeEvent(G4Event *anEvent)
const G4String & GetRandomNumberStatusForThisRun() const
G4int storeRandomNumberStatusToG4Event
G4UserEventAction * userEventAction
virtual void rndmSaveThisEvent()
G4bool GetRandomNumberStorePerEvent() const
const G4UserEventAction * GetUserEventAction() const
virtual void DeleteUserInitializations()
G4int GetNumberOfEventsToBeProcessed() const
const G4UserTrackingAction * GetUserTrackingAction() const
const G4VUserActionInitialization * GetUserActionInitialization() const
std::list< G4Event * > * previousEvents
G4UserRunAction * userRunAction
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4int GetNumberOfSelectEvents() const
void SetNumberOfEventsToBeProcessed(G4int val)
const G4UserWorkerThreadInitialization * GetUserWorkerThreadInitialization() const
static G4RunManager * GetRunManager()
void SetDCtable(G4DCtable *DCtbl)
virtual void DoEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
void CleanUpPreviousEvents()
void SetRunIDCounter(G4int i)
void ReOptimizeMotherOf(G4VPhysicalVolume *)
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
G4VUserActionInitialization * GetNonConstUserActionInitialization() const
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
virtual void RestoreRndmEachEvent(G4bool)
virtual void StoreRNGStatus(const G4String &filenamePrefix)
virtual void Initialize()
void SetNumberOfEventsToBeStored(G4int val)
void StackPreviousEvent(G4Event *anEvent)
const G4String & GetRandomNumberStatusForThisEvent() const
void GeometryHasBeenModified()
virtual void AbortEvent()
void CutOffHasBeenModified()
G4RunManagerKernel * kernel
const G4UserRunAction * GetUserRunAction() const
void StoreRandomNumberStatusToG4Event(G4int vl)
G4EventManager * eventManager
const G4Event * GetCurrentEvent() const
const G4VUserPhysicsList * GetUserPhysicsList() const
virtual void TerminateOneEvent()
void PhysicsHasBeenModified()
void SetRandomNumberStoreDir(const G4String &dir)
G4VUserDetectorConstruction * userDetector
G4UserSteppingAction * userSteppingAction
G4RunMessenger * runMessenger
void SetVerboseLevel(G4int vl)
G4Run * GetNonConstCurrentRun() const
void DumpRegion(const G4String &rname) const
G4RunManager & operator=(const G4RunManager &)
G4int n_perviousEventsToBeStored
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
static G4ThreadLocal G4RunManager * fRunManager
G4GLOB_DLL std::ostream G4cerr
G4UserStackingAction * userStackingAction
virtual void SetUserAction(G4UserRunAction *userAction)