63{
return fRunManager; }
66:userDetector(0),physicsList(0),
67 userRunAction(0),userPrimaryGeneratorAction(0),userEventAction(0),
68 userStackingAction(0),userTrackingAction(0),userSteppingAction(0),
69 geometryInitialized(false),physicsInitialized(false),
70 runAborted(false),initializedAtLeastOnce(false),
71 geometryToBeOptimized(true),runIDCounter(0),verboseLevel(0),DCtable(0),
72 currentRun(0),currentEvent(0),n_perviousEventsToBeStored(0),
73 numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),
74 storeRandomNumberStatusToG4Event(0),
75 currentWorld(0),nParallelWorlds(0),msgText(
" "),n_select_msg(-1),
76 numberOfEventProcessed(0)
80 G4Exception(
"G4RunManager::G4RunManager()",
"Run0031",
94 std::ostringstream oss;
155 if(n_event>0)
DoEventLoop(n_event,macroFile,n_select);
167 G4cerr <<
"Illegal application state - BeamOn() ignored." <<
G4endl;
173 G4cerr <<
" Geant4 kernel should be initialized" <<
G4endl;
174 G4cerr <<
"before the first BeamOn(). - BeamOn ignored." <<
G4endl;
185 G4cout <<
"has been modified since last Run." <<
G4endl;
209 std::ostringstream oss;
235 for(
G4int i_event=0; i_event<n_event; i_event++ )
297 "G4VUserPrimaryGeneratorAction is not defined!");
305 std::ostringstream oss;
323 if(fPersM) fPersM->
Store(anEvent);
331 G4Event* prevEv = (*previousEvents)[itr];
332 if((prevEv) && !(prevEv->
ToBeKept()))
delete prevEv;
359 if(evt && !(evt->
ToBeKept()))
delete evt;
368 G4cerr <<
"Illegal application state - "
369 <<
"G4RunManager::Initialize() ignored." <<
G4endl;
382 G4Exception(
"G4RunManager::InitializeGeometry",
"Run0033",
403 G4Exception(
"G4RunManager::InitializePhysics()",
"Run0034",
425 G4cerr <<
"Run is not in progress. AbortRun() ignored." <<
G4endl;
441 G4cerr <<
"Event is not in progress. AbortEevnt() ignored." <<
G4endl;
456 G4cerr <<
"Warning from G4RunManager::rndmSaveThisRun():"
457 <<
" Random number status was not stored prior to this run."
464 std::ostringstream os;
465 os <<
"run" << runNumber <<
".rndm" <<
'\0';
468 G4String copCmd =
"/control/shell cp "+fileIn+
" "+fileOut;
476 G4cerr <<
"Warning from G4RunManager::rndmSaveThisEvent():"
477 <<
" there is no currentEvent or its RandomEngineStatus is not available."
484 std::ostringstream os;
489 G4String copCmd =
"/control/shell cp "+fileIn+
" "+fileOut;
497 if(fileN.
index(
"/")==std::string::npos)
500 { fileNameWithDirectory = fileN; }
504 << fileNameWithDirectory <<
G4endl;
539 for(
G4int iw=0;iw<nPar;iw++)
555 theParticleIterator->
reset();
556 while( (*theParticleIterator)() ){
561 pmanager->
AddProcess(theParallelWorldScoringProcess);
584 for(
G4int i=0;i<nColl;i++)
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
static std::ostream & saveFullState(std::ostream &os)
static void restoreEngineStatus(const char filename[]="Config.conf")
static void showEngineStatus()
static void saveEngineStatus(const char filename[]="Config.conf")
void ProcessOneEvent(G4Event *anEvent)
void SetRandomNumberStatus(G4String &st)
G4HCofThisEvent * GetHCofThisEvent() const
G4VHitsCollection * GetHC(G4int i)
void SetVoxelHeader(G4SmartVoxelHeader *pVoxel)
G4SmartVoxelHeader * GetVoxelHeader() const
G4bool IsAtRestRequired(G4ParticleDefinition *partDef)
void SetParallelWorld(G4String parallelWorldName)
G4ProcessManager * GetProcessManager() const
G4PTblDicIterator * GetIterator()
static G4ParticleTable * GetParticleTable()
G4UImessenger * CreateMessenger()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetProcessOrderingToSecond(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4ProcessTable * GetProcessTable()
G4UImessenger * CreateMessenger()
void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
void SetNumberOfParallelWorld(G4int i)
G4EventManager * GetEventManager() const
G4bool RunInitialization()
void DumpRegion(const G4String &rname) const
G4bool geometryInitialized
G4int storeRandomNumberStatusToG4Event
virtual void AbortRun(G4bool softAbort=false)
virtual void Initialize()
G4int numberOfEventProcessed
virtual void RestoreRandomNumberStatus(const G4String &fileN)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void DoEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void rndmSaveThisEvent()
G4RunManagerKernel * kernel
virtual G4bool ConfirmBeamOnCondition()
static G4RunManager * GetRunManager()
virtual void AbortEvent()
virtual void rndmSaveThisRun()
virtual void InitializePhysics()
G4String randomNumberStatusForThisRun
G4UserRunAction * userRunAction
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
virtual void InitializeGeometry()
virtual void RunTermination()
G4bool physicsInitialized
void StackPreviousEvent(G4Event *anEvent)
void ReOptimize(G4LogicalVolume *)
void GeometryHasBeenModified()
G4VUserDetectorConstruction * userDetector
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
G4int numberOfEventToBeProcessed
G4String randomNumberStatusDir
virtual void TerminateEventLoop()
G4String randomNumberStatusForThisEvent
G4int n_perviousEventsToBeStored
void ReOptimizeMotherOf(G4VPhysicalVolume *)
virtual void ProcessOneEvent(G4int i_event)
G4bool storeRandomNumberStatus
virtual G4Event * GenerateEvent(G4int i_event)
G4bool initializedAtLeastOnce
G4EventManager * eventManager
virtual void TerminateOneEvent()
virtual void RunInitialization()
void DumpRegion(const G4String &rname) const
G4VUserPhysicsList * physicsList
virtual void AnalyzeEvent(G4Event *anEvent)
std::vector< G4Event * > * previousEvents
void ConstructScoringWorlds()
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
void SetHCtable(G4HCtable *HCtbl)
void StoreEvent(G4Event *evt)
virtual void RecordEvent(const G4Event *)
void SetNumberOfEventToBeProcessed(G4int n_ev)
void SetDCtable(G4DCtable *DCtbl)
void SetRandomNumberStatus(G4String &st)
static G4SDManager * GetSDMpointerIfExist()
G4HCtable * GetHCtable() const
G4VScoringMesh * GetMesh(G4int i) const
void Accumulate(G4VHitsCollection *map)
size_t GetNumberOfMesh() const
G4String GetWorldName(G4int i) const
static G4ScoringManager * GetScoringManagerIfExist()
G4ApplicationState GetCurrentState() const
static G4StateManager * GetStateManager()
G4bool SetNewState(G4ApplicationState requestedState)
str_size index(const char *, G4int pos=0) const
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
static G4TransportationManager * GetTransportationManager()
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
virtual void EndOfRunAction(const G4Run *aRun)
virtual void BeginOfRunAction(const G4Run *aRun)
virtual G4Run * GenerateRun()
static G4VPersistencyManager * GetPersistencyManager()
virtual G4bool Store(const G4Event *anEvent)=0
G4LogicalVolume * GetMotherLogical() const
void SetName(const G4String &pName)
virtual void Construct(G4VPhysicalVolume *fWorldPhys)=0
virtual G4VPhysicalVolume * Construct()=0
G4int ConstructParallelGeometries()
virtual void GeneratePrimaries(G4Event *anEvent)=0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)