72 #ifdef theParticleIterator
73 #undef theParticleIterator
82 : physicsList(0),currentWorld(0),
83 geometryInitialized(
false),physicsInitialized(
false),
84 geometryToBeOptimized(
true),
85 physicsNeedsToBeReBuilt(
true),verboseLevel(0),
86 numberOfParallelWorld(0),geometryNeedsToBeClosed(
true),
87 numberOfStaticAllocators(0)
97 G4Exception(
"G4RunManagerKernel::G4RunManagerKernel()",
"Run0001",
98 FatalException,
"More than one G4RunManagerKernel is constructed.");
107 ED<<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<
G4endl;
108 ED<<
" G4RunManagerKernel fatal exception"<<
G4endl;
109 ED<<
" -- Following particles have already been registered"<<
G4endl;
110 ED<<
" before G4RunManagerKernel is instantiated."<<
G4endl;
111 for(
int i=0;i<particleTable->
entries();i++)
113 ED<<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<
G4endl;
114 G4Exception(
"G4RunManagerKernel::G4RunManagerKernel()",
"Run0002",
134 vs = vs.substr(1,vs.size()-2);
140 <<
"**************************************************************" <<
G4endl
142 <<
" Copyright : Geant4 Collaboration" <<
G4endl
143 <<
" References : NIM A 506 (2003), 250-303" <<
G4endl
144 <<
" : IEEE-TNS 53 (2006), 270-278" <<
G4endl
145 <<
" : NIM A 835 (2016), 186-225" <<
G4endl
146 <<
" WWW : http://geant4.org/" <<
G4endl
147 <<
"**************************************************************" <<
G4endl
152 : physicsList(0),currentWorld(0),
153 geometryInitialized(
false),physicsInitialized(
false),
154 geometryToBeOptimized(
true),
155 physicsNeedsToBeReBuilt(
true),verboseLevel(0),
156 numberOfParallelWorld(0),geometryNeedsToBeClosed(
true),
157 numberOfStaticAllocators(0)
160 #ifndef G4MULTITHREADED
162 msg<<
"Geant4 code is compiled without multi-threading support (-DG4MULTITHREADED is set to off).";
163 msg<<
" This type of RunManagerKernel can only be used in mult-threaded applications.";
176 G4Exception(
"G4RunManagerKernel::G4RunManagerKernel()",
"Run0001",
177 FatalException,
"More than one G4RunManagerKernel is constructed.");
204 msgx<<
" This type of RunManagerKernel can only be used in mult-threaded applications.";
214 vs = vs.substr(1,vs.size()-2);
223 <<
"**************************************************************" <<
G4endl
225 <<
" << in Multi-threaded mode >> " <<
G4endl
226 <<
" Copyright : Geant4 Collaboration" <<
G4endl
227 <<
" References : NIM A 506 (2003), 250-303" <<
G4endl
228 <<
" : IEEE-TNS 53 (2006), 270-278" <<
G4endl
229 <<
" : NIM A 835 (2016), 186-225" <<
G4endl
230 <<
" WWW : http://geant4.org/" <<
G4endl
231 <<
"**************************************************************" <<
G4endl
239 <<
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" << G4endl
241 <<
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" << G4endl
246 #ifdef G4MULTITHREADED
263 "Default world region should have a unique logical volume.");
265 std::vector<G4LogicalVolume*>::iterator lvItr
269 <<
"Obsolete world logical volume is removed from the default region." <<
G4endl;
289 if(pwps)
delete pwps;
304 if (pFinder)
delete pFinder;
306 if (fmStore)
delete fmStore;
308 if (gManager)
delete gManager;
343 G4cout <<
"Thread-local UImanager is to be deleted." << G4endl
344 <<
"There should not be any thread-local G4cout/G4cerr hereafter."
348 if(pUImanager)
delete pUImanager;
351 delete pStateManager;
363 G4MTRunManager::masterWorlds_t::iterator itrMW = masterWorlds.begin();
364 for(;itrMW!=masterWorlds.end();itrMW++)
384 G4cout <<
"Current application state is "
386 G4Exception(
"G4RunManagerKernel::DefineWorldVolume",
387 "DefineWorldVolumeAtIncorrectState",
389 "Geant4 kernel is not Init state : Method ignored.");
406 G4MTRunManager::masterWorlds_t::iterator itrMW = masterWorlds.begin();
407 for(;itrMW!=masterWorlds.end();itrMW++)
409 if((*itrMW).first == 0)
413 G4Exception(
"G4RunManagerKernel::WorkerDefineWorldVolume",
"RUN3091",
449 G4cout <<
"Current application state is "
451 G4Exception(
"G4RunManagerKernel::DefineWorldVolume",
452 "DefineWorldVolumeAtIncorrectState",
454 "Geant4 kernel is not Init state : Method ignored.");
473 ED <<
"The world volume has a user-defined region <"
476 ED <<
"World would have a default region assigned by RunManagerKernel."
494 <<
" is registered to the default region." <<
G4endl;
524 G4cout <<
"List of instantiated particles ============================================" <<
G4endl;
526 for(
G4int i=0;i<nPtcl;i++)
572 #ifdef G4MULTITHREADED
587 G4cout <<
"Current application state is "
591 G4Exception(
"G4RunManagerKernel::InitializePhysics",
592 "InitializePhysicsIncorrectState",
594 "Geant4 kernel is not Init state : Method ignored.");
601 G4cout<<
"Warning : Geant4 kernel is not Init state : Assuming Init state."
609 G4Exception(
"G4RunManagerKernel::InitializePhysics",
611 "G4VUserPhysicsList is not defined");
650 #ifdef G4MULTITHREADED
666 G4Exception(
"G4RunManagerKernel::RunInitialization",
669 "Geometry has not yet initialized : method ignored.");
675 G4Exception(
"G4RunManagerKernel::RunInitialization",
678 "Physics has not yet initialized : method ignored.");
684 G4Exception(
"G4RunManagerKernel::RunInitialization",
687 "Geant4 kernel not in Idle state : method ignored.");
713 #ifdef G4MULTITHREADED
773 "Geant4 kernel not in Init state : method ignored.");
792 #ifdef G4MULTITHREADED
814 std::vector<G4VPhysicalVolume*>::iterator wItr;
826 for(
size_t iw=0;iw<nWorlds;iw++)
845 <<
"> does not have specific production cuts," <<
G4endl
846 <<
"even though it appears in the current tracking world." <<
G4endl;
847 G4cout <<
"Default cuts are used for this region." <<
G4endl;
854 ->GetDefaultProductionCuts());
864 for(
size_t iw=0;iw<nWorlds;iw++)
903 G4cout <<
" -- appears in <"
907 {
G4cout <<
" -- is not associated to any world."; }
910 {
G4cout <<
" This region is in the mass world." <<
G4endl; }
912 {
G4cout <<
" This region is in the parallel world." <<
G4endl; }
914 G4cout <<
" Root logical volume(s) : ";
917 for(
size_t j=0;j<nRootLV;j++)
918 {
G4cout << (*lvItr)->GetName() <<
" "; lvItr++; }
926 G4cout <<
" Materials : ";
929 for(
size_t iMate=0;iMate<nMaterial;iMate++)
931 G4cout << (*mItr)->GetName() <<
" ";
939 <<
"> does not have specific production cuts." <<
G4endl;
940 G4cerr <<
"Default cuts are used for this region." <<
G4endl;
946 G4cout <<
" Production cuts : "
964 for(G4LogicalVolumeStore::iterator
pos=store->begin();
pos!=store->end();
pos++)
966 if((*
pos)&&((*pos)->GetNoDaughters()==1))
968 if((*pos)->GetDaughter(0)->IsRegularStructure())
986 theParticleIterator->
reset();
987 while((*theParticleIterator)())
1010 if( ! InitSplitter ) {
1011 InitSplitter =
true;
1013 theParticleIterator->
reset();
1014 while( (*theParticleIterator)() )
1024 G4cout <<
"G4RunManagerKernel -- G4ScoreSplittingProcess is appended to all particles." <<
G4endl;
1033 theParticleIterator->
reset();
1035 while((*theParticleIterator)())
1049 procs[
idx]->SetMasterProcess(const_cast<G4VProcess*>(procs[
idx]));