58 using namespace CLHEP;
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;
95 HepRandom::saveFullState(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;
210 HepRandom::saveFullState(oss);
222 HepRandom::saveEngineStatus(fileN);
235 for(
G4int i_event=0; i_event<n_event; i_event++ )
297 "G4VUserPrimaryGeneratorAction is not defined!");
305 std::ostringstream oss;
306 HepRandom::saveFullState(oss);
313 HepRandom::saveEngineStatus(fileN);
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; }
502 HepRandom::restoreEngineStatus(fileNameWithDirectory);
504 << fileNameWithDirectory <<
G4endl;
505 HepRandom::showEngineStatus();
527 #include "G4HCofThisEvent.hh"
528 #include "G4VHitsCollection.hh"
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++)