Geant4  10.02.p03
G4RunManagerKernel Class Reference

#include <G4RunManagerKernel.hh>

Inheritance diagram for G4RunManagerKernel:
Collaboration diagram for G4RunManagerKernel:

Public Types

enum  RMKType { sequentialRMK, masterRMK, workerRMK }
 

Public Member Functions

 G4RunManagerKernel ()
 
virtual ~G4RunManagerKernel ()
 
void DefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
 
void WorkerDefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
 
void SetPhysics (G4VUserPhysicsList *uPhys)
 
void InitializePhysics ()
 
G4bool RunInitialization (G4bool fakeRun=false)
 
void RunTermination ()
 
void WorkerUpdateWorldVolume ()
 
void UpdateRegion ()
 
void DumpRegion (const G4String &rname) const
 
void DumpRegion (G4Region *region=0) const
 
void GeometryHasBeenModified ()
 
void PhysicsHasBeenModified ()
 
G4EventManagerGetEventManager () const
 
G4StackManagerGetStackManager () const
 
G4TrackingManagerGetTrackingManager () const
 
void SetPrimaryTransformer (G4PrimaryTransformer *pt)
 
G4PrimaryTransformerGetPrimaryTransformer () const
 
const G4StringGetVersionString () const
 
void SetVerboseLevel (G4int vl)
 
void SetGeometryToBeOptimized (G4bool vl)
 
G4int GetNumberOfParallelWorld () const
 
void SetNumberOfParallelWorld (G4int i)
 
G4VUserPhysicsListGetPhysicsList () const
 
G4VPhysicalVolumeGetCurrentWorld () const
 
G4int GetNumberOfStaticAllocators () const
 

Static Public Member Functions

static G4RunManagerKernelGetRunManagerKernel ()
 

Protected Member Functions

 G4RunManagerKernel (RMKType rmkType)
 
void SetupDefaultRegion ()
 
void SetupPhysics ()
 
void ResetNavigator ()
 
void BuildPhysicsTables (G4bool fakeRun)
 
void CheckRegions ()
 
virtual void SetupShadowProcess () const
 
void PropagateGenericIonID ()
 

Protected Attributes

RMKType runManagerKernelType
 
G4RegiondefaultRegion
 
G4RegiondefaultRegionForParallelWorld
 
G4bool geometryNeedsToBeClosed
 

Private Member Functions

void CheckRegularGeometry ()
 
G4bool ConfirmCoupledTransportation ()
 
void SetScoreSplitter ()
 

Private Attributes

G4VUserPhysicsListphysicsList
 
G4VPhysicalVolumecurrentWorld
 
G4bool geometryInitialized
 
G4bool physicsInitialized
 
G4bool geometryToBeOptimized
 
G4bool physicsNeedsToBeReBuilt
 
G4int verboseLevel
 
G4int numberOfParallelWorld
 
G4EventManagereventManager
 
G4ExceptionHandlerdefaultExceptionHandler
 
G4String versionString
 
G4int numberOfStaticAllocators
 

Static Private Attributes

static G4ThreadLocal G4RunManagerKernelfRunManagerKernel = 0
 

Detailed Description

Definition at line 68 of file G4RunManagerKernel.hh.

Member Enumeration Documentation

◆ RMKType

Constructor & Destructor Documentation

◆ G4RunManagerKernel() [1/2]

G4RunManagerKernel::G4RunManagerKernel ( )

Definition at line 78 of file G4RunManagerKernel.cc.

85 {
86 #ifdef G4FPE_DEBUG
88 #endif
90  if(allocList) numberOfStaticAllocators = allocList->Size();
93  {
94  G4Exception("G4RunManagerKernel::G4RunManagerKernel()","Run0001",
95  FatalException,"More than one G4RunManagerKernel is constructed.");
96  }
97  fRunManagerKernel = this;
98 
100  if(particleTable->entries()>0)
101  {
102  // No particle should be registered beforehand
104  ED<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<G4endl;
105  ED<<" G4RunManagerKernel fatal exception"<<G4endl;
106  ED<<" -- Following particles have already been registered"<<G4endl;
107  ED<<" before G4RunManagerKernel is instantiated."<<G4endl;
108  for(int i=0;i<particleTable->entries();i++)
109  { ED<<" "<<particleTable->GetParticle(i)->GetParticleName()<<G4endl; }
110  ED<<"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<G4endl;
111  G4Exception("G4RunManagerKernel::G4RunManagerKernel()","Run0002",
112  FatalException,ED);
113  }
114 
115  // construction of Geant4 kernel classes
117 
118  defaultRegion = new G4Region("DefaultRegionForTheWorld"); // deleted by store
119  defaultRegionForParallelWorld = new G4Region("DefaultRegionForParallelWorld"); // deleted by store
121  G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
123  G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
124 
126  // set the initial application state
128 
129  // version banner
130  G4String vs = G4Version;
131  vs = vs.substr(1,vs.size()-2);
132  versionString = " Geant4 version ";
133  versionString += vs;
134  versionString += " ";
136  G4cout << G4endl
137  << "*************************************************************" << G4endl
138  << versionString << G4endl
139  << " Copyright : Geant4 Collaboration" << G4endl
140  << " Reference : NIM A 506 (2003), 250-303" << G4endl
141  << " WWW : http://cern.ch/geant4" << G4endl
142  << "*************************************************************" << G4endl
143  << G4endl;
144 }
G4Region * defaultRegionForParallelWorld
G4VPhysicalVolume * currentWorld
G4EventManager * eventManager
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
static G4AllocatorList * GetAllocatorListIfExist()
G4int Size() const
G4ExceptionHandler * defaultExceptionHandler
static G4StateManager * GetStateManager()
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4bool SetNewState(G4ApplicationState requestedState)
static void InvalidOperationDetection()
static const G4String G4Version
Definition: G4Version.hh:63
static const G4String G4Date
Definition: G4Version.hh:65
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4ProductionCutsTable * GetProductionCutsTable()
static G4ParticleTable * GetParticleTable()
G4VUserPhysicsList * physicsList
static G4ThreadLocal G4RunManagerKernel * fRunManagerKernel
#define G4endl
Definition: G4ios.hh:61
void SetProductionCuts(G4ProductionCuts *cut)
G4ParticleDefinition * GetParticle(G4int index) const
G4int entries() const
Here is the call graph for this function:

◆ ~G4RunManagerKernel()

G4RunManagerKernel::~G4RunManagerKernel ( )
virtual

Definition at line 261 of file G4RunManagerKernel.cc.

262 {
264  // set the application state to the quite state
265  if(pStateManager->GetCurrentState()!=G4State_Quit)
266  {
267  if(verboseLevel>0) G4cout << "G4 kernel has come to Quit state." << G4endl;
268  pStateManager->SetNewState(G4State_Quit);
269  }
270 
271  // open geometry for deletion
273 
274  // deletion of Geant4 kernel classes
276  if(pwps) delete pwps;
278  if(fSDM)
279  {
280  delete fSDM;
281  if(verboseLevel>1) G4cout << "G4SDManager deleted." << G4endl;
282  }
283  delete eventManager;
284  if(verboseLevel>1) G4cout << "EventManager deleted." << G4endl;
285 
287  if(verboseLevel>1) G4cout << "Units table cleared." << G4endl;
288 
289  // deletion of navigation levels
292 
293  // deletion of allocators
295  if(allocList)
296  {
298  delete allocList;
299  if(verboseLevel>1) G4cout << "G4Allocator objects are deleted." << G4endl;
300  }
301 
302  G4UImanager* pUImanager = G4UImanager::GetUIpointer();
304  {
305  G4cout << "Thread-local UImanager is to be deleted." << G4endl
306  << "There should not be any thread-local G4cout/G4cerr hereafter."
307  << G4endl;
308  verboseLevel = 0;
309  }
310  if(pUImanager) delete pUImanager;
311  if(verboseLevel>1) G4cout << "UImanager deleted." << G4endl;
312 
313  delete pStateManager;
314  if(verboseLevel>1) G4cout << "StateManager deleted." << G4endl;
316  if(verboseLevel>0) G4cout << "RunManagerKernel is deleted. Good bye :)" << G4endl;
317  fRunManagerKernel = 0;
318 }
G4EventManager * eventManager
static G4AllocatorList * GetAllocatorListIfExist()
G4ExceptionHandler * defaultExceptionHandler
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
static G4ParallelWorldProcessStore * GetInstanceIfExist()
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
G4bool SetNewState(G4ApplicationState requestedState)
static G4GeometryManager * GetInstance()
static void ClearUnitsTable()
static G4ThreadLocal G4RunManagerKernel * fRunManagerKernel
void Destroy(G4int nStat=0, G4int verboseLevel=0)
#define G4endl
Definition: G4ios.hh:61
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4ApplicationState GetCurrentState() const
static G4NavigationHistoryPool * GetInstance()
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49
Here is the call graph for this function:

◆ G4RunManagerKernel() [2/2]

G4RunManagerKernel::G4RunManagerKernel ( RMKType  rmkType)
protected

Definition at line 146 of file G4RunManagerKernel.cc.

147 : physicsList(0),currentWorld(0),
153 {
154 //This version of the constructor should never be called in sequential mode!
155 #ifndef G4MULTITHREADED
157  msg<<"Geant4 code is compiled without multi-threading support (-DG4MULTITHREADED is set to off).";
158  msg<<" This type of RunManagerKernel can only be used in mult-threaded applications.";
159  G4Exception("G4RunManagerKernel::G4RunManagerKernel(G4bool)","Run0035",FatalException,msg);
160 #endif
161 
162 #ifdef G4FPE_DEBUG
163  if ( G4Threading::IsMasterThread() ) {
165  }
166 #endif
167 
170  {
171  G4Exception("G4RunManagerKernel::G4RunManagerKernel()","Run0001",
172  FatalException,"More than one G4RunManagerKernel is constructed.");
173  }
174  fRunManagerKernel = this;
175  // construction of Geant4 kernel classes
177 
178  switch(rmkType)
179  {
180  case masterRMK:
181  //Master thread behvior
182  defaultRegion = new G4Region("DefaultRegionForTheWorld"); // deleted by store
183  defaultRegionForParallelWorld = new G4Region("DefaultRegionForParallelWorld"); // deleted by store
185  G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
187  G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
188  break;
189  case workerRMK:
190  //Worker thread behavior
191  defaultRegion = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForTheWorld", true);
193  = G4RegionStore::GetInstance()->GetRegion("DefaultRegionForParallelWorld", true);
194  break;
195  default:
196  defaultRegion = 0;
199  msgx<<" This type of RunManagerKernel can only be used in mult-threaded applications.";
200  G4Exception("G4RunManagerKernel::G4RunManagerKernel(G4bool)","Run0035",FatalException,msgx);
201  }
202  runManagerKernelType = rmkType;
203 
204  // set the initial application state
206 
207  // version banner
208  G4String vs = G4Version;
209  vs = vs.substr(1,vs.size()-2);
210  switch(rmkType)
211  {
212  case masterRMK:
213  versionString = " Geant4 version ";
214  versionString += vs;
215  versionString += " ";
217  G4cout << G4endl
218  << "*************************************************************" << G4endl
219  << versionString << G4endl
220  << " << in Multi-threaded mode >> " << G4endl
221  << " Copyright : Geant4 Collaboration" << G4endl
222  << " Reference : NIM A 506 (2003), 250-303" << G4endl
223  << " WWW : http://cern.ch/geant4" << G4endl
224  << "*************************************************************" << G4endl
225  << G4endl;
226  break;
227  default:
228  versionString = " Local thread RunManagerKernel version ";
229  versionString += vs;
230  G4cout << G4endl
231  << "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" << G4endl
232  << versionString << G4endl
233  << "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" << G4endl
234  << G4endl;
235  }
236 }
G4Region * defaultRegionForParallelWorld
G4VPhysicalVolume * currentWorld
G4EventManager * eventManager
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4ExceptionHandler * defaultExceptionHandler
static G4RegionStore * GetInstance()
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
G4bool SetNewState(G4ApplicationState requestedState)
static void InvalidOperationDetection()
static const G4String G4Version
Definition: G4Version.hh:63
static const G4String G4Date
Definition: G4Version.hh:65
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4ProductionCutsTable * GetProductionCutsTable()
G4VUserPhysicsList * physicsList
static G4ThreadLocal G4RunManagerKernel * fRunManagerKernel
#define G4endl
Definition: G4ios.hh:61
void SetProductionCuts(G4ProductionCuts *cut)
G4bool IsMasterThread()
Definition: G4Threading.cc:136
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
Here is the call graph for this function:

Member Function Documentation

◆ BuildPhysicsTables()

void G4RunManagerKernel::BuildPhysicsTables ( G4bool  fakeRun)
protected

Definition at line 694 of file G4RunManagerKernel.cc.

695 {
698  {
699 #ifdef G4MULTITHREADED
701  {
702  // make sure workers also rebuild physics tables
703  G4UImanager* pUImanager = G4UImanager::GetUIpointer();
704  pUImanager->ApplyCommand("/run/physicsModified");
705  }
706 #endif
709  physicsNeedsToBeReBuilt = false;
710  }
711 
712  if(!fakeRun && verboseLevel>1) DumpRegion();
713  if(!fakeRun && verboseLevel>0) physicsList->DumpCutValuesTable();
715 }
void DumpRegion(const G4String &rname) const
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void DumpCutValuesTable(G4int flag=1)
static G4ProductionCutsTable * GetProductionCutsTable()
G4VUserPhysicsList * physicsList
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:

◆ CheckRegions()

void G4RunManagerKernel::CheckRegions ( )
protected

Definition at line 717 of file G4RunManagerKernel.cc.

718 {
720  size_t nWorlds = transM->GetNoWorlds();
721  std::vector<G4VPhysicalVolume*>::iterator wItr;
722  for(size_t i=0;i<G4RegionStore::GetInstance()->size();i++)
723  {
724  G4Region* region = (*(G4RegionStore::GetInstance()))[i];
725 
726  //Let each region have a pointer to the world volume where it belongs to.
727  //G4Region::SetWorld() checks if the region belongs to the given world and set it
728  //only if it does. Thus, here we go through all the registered world volumes.
729  region->SetWorld(0); // reset
730  region->UsedInMassGeometry(false);
731  region->UsedInParallelGeometry(false);
732  wItr = transM->GetWorldsIterator();
733  for(size_t iw=0;iw<nWorlds;iw++)
734  {
735  if(region->BelongsTo(*wItr))
736  {
737  if(*wItr==currentWorld)
738  { region->UsedInMassGeometry(true); }
739  else
740  { region->UsedInParallelGeometry(true); }
741  }
742  region->SetWorld(*wItr);
743  wItr++;
744  }
745 
746  G4ProductionCuts* cuts = region->GetProductionCuts();
747  if(!cuts)
748  {
749  if(region->IsInMassGeometry())
750  {
751  G4cout << "Warning : Region <" << region->GetName()
752  << "> does not have specific production cuts," << G4endl
753  << "even though it appears in the current tracking world." << G4endl;
754  G4cout << "Default cuts are used for this region." << G4endl;
755  }
756 
757  if(region->IsInMassGeometry()||region->IsInParallelGeometry())
758  {
759  region->SetProductionCuts(
761  ->GetDefaultProductionCuts());
762  }
763  }
764  }
765 
766  //
767  // If a parallel world has no region, set default region for parallel world
768  //
769 
770  wItr = transM->GetWorldsIterator();
771  for(size_t iw=0;iw<nWorlds;iw++)
772  {
773  //G4cout << "+++ " << (*wItr)->GetName() << G4endl;
774  if(*wItr!=currentWorld)
775  {
776  G4LogicalVolume* pwLogical = (*wItr)->GetLogicalVolume();
777  if(!(pwLogical->GetRegion()))
778  {
781  //G4cout << "+++++ defaultRegionForParallelWorld is set to "
782  // << (*wItr)->GetName() << " +++++" << G4endl;
783  }
784  }
785  wItr++;
786  }
787 
788 }
G4bool IsInMassGeometry() const
G4Region * defaultRegionForParallelWorld
G4VPhysicalVolume * currentWorld
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
void UsedInParallelGeometry(G4bool val=true)
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
size_t GetNoWorlds() const
static G4RegionStore * GetInstance()
void SetRegion(G4Region *reg)
G4GLOB_DLL std::ostream G4cout
G4bool IsInParallelGeometry() const
void UsedInMassGeometry(G4bool val=true)
G4bool BelongsTo(G4VPhysicalVolume *thePhys) const
Definition: G4Region.cc:398
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
static G4ProductionCutsTable * GetProductionCutsTable()
void SetWorld(G4VPhysicalVolume *wp)
Definition: G4Region.cc:382
G4Region * GetRegion() const
#define G4endl
Definition: G4ios.hh:61
void SetProductionCuts(G4ProductionCuts *cut)
G4ProductionCuts * GetProductionCuts() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckRegularGeometry()

void G4RunManagerKernel::CheckRegularGeometry ( )
private

Definition at line 868 of file G4RunManagerKernel.cc.

869 {
871  for(G4LogicalVolumeStore::iterator pos=store->begin(); pos!=store->end(); pos++)
872  {
873  if((*pos)&&((*pos)->GetNoDaughters()==1))
874  {
875  if((*pos)->GetDaughter(0)->IsRegularStructure())
876  {
878  return;
879  }
880  }
881  }
882 }
static G4LogicalVolumeStore * GetInstance()
static const G4double pos
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfirmCoupledTransportation()

G4bool G4RunManagerKernel::ConfirmCoupledTransportation ( )
private

Definition at line 889 of file G4RunManagerKernel.cc.

890 {
893  theParticleIterator->reset();
894  while((*theParticleIterator)())
895  {
896  G4ParticleDefinition* pd = theParticleIterator->value();
898  if(pm)
899  {
901  G4VProcess* p = (*pv)[0];
902  return ( (p->GetProcessName()) == "CoupledTransportation" );
903  }
904  }
905  return false;
906 }
G4ProcessManager * GetProcessManager() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void reset(G4bool ifSkipIon=true)
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
static G4ParticleTable * GetParticleTable()
G4PTblDicIterator * GetIterator() const
#define theParticleIterator
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DefineWorldVolume()

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

Definition at line 389 of file G4RunManagerKernel.cc.

391 {
393  G4ApplicationState currentState = stateManager->GetCurrentState();
394  if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
395  {
396  G4Exception("G4RunManagerKernel::DefineWorldVolume",
397  "Run00031",
398  JustWarning,
399  "Geant4 kernel is not PreInit or Idle state : Method ignored.");
400  return;
401  }
402 
403  // The world volume MUST NOT have a region defined by the user
404  if(worldVol->GetLogicalVolume()->GetRegion())
405  {
406  if(worldVol->GetLogicalVolume()->GetRegion()!=defaultRegion)
407  {
409  ED << "The world volume has a user-defined region <"
410  << worldVol->GetLogicalVolume()->GetRegion()->GetName()
411  << ">." << G4endl;
412  ED << "World would have a default region assigned by RunManagerKernel."
413  << G4endl;
414  G4Exception("G4RunManager::DefineWorldVolume",
415  "Run0004", FatalException, ED);
416  }
417  }
418 
420 
421  // Accept the world volume
422  currentWorld = worldVol;
423 
424  // Set the default region to the world
425 
427  worldLog->SetRegion(defaultRegion);
429  if(verboseLevel>1) G4cout << worldLog->GetName()
430  << " is registered to the default region." << G4endl;
431 
432  // Set the world volume, notify the Navigator and reset its state
435  if(topologyIsChanged) geometryNeedsToBeClosed = true;
436 
437  // Notify the VisManager as well
439  {
441  if(pVVisManager) pVVisManager->GeometryHasChanged();
442  }
443 
444  geometryInitialized = true;
445  if(physicsInitialized && currentState!=G4State_Idle)
446  { stateManager->SetNewState(G4State_Idle); }
447 }
virtual void GeometryHasChanged()=0
G4VPhysicalVolume * currentWorld
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
static G4VVisManager * GetConcreteInstance()
static G4StateManager * GetStateManager()
void SetRegion(G4Region *reg)
G4GLOB_DLL std::ostream G4cout
G4bool SetNewState(G4ApplicationState requestedState)
const G4String & GetName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
G4Region * GetRegion() const
#define G4endl
Definition: G4ios.hh:61
G4bool IsMasterThread()
Definition: G4Threading.cc:136
void SetWorldForTracking(G4VPhysicalVolume *theWorld)
G4ApplicationState GetCurrentState() const
G4LogicalVolume * GetLogicalVolume() const
G4ApplicationState
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpRegion() [1/2]

void G4RunManagerKernel::DumpRegion ( const G4String rname) const

Definition at line 790 of file G4RunManagerKernel.cc.

791 {
792  G4Region* region = G4RegionStore::GetInstance()->GetRegion(rname);
793  if(region) DumpRegion(region);
794 }
void DumpRegion(const G4String &rname) const
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DumpRegion() [2/2]

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

Definition at line 796 of file G4RunManagerKernel.cc.

797 {
798  if(!region)
799  {
800  for(size_t i=0;i<G4RegionStore::GetInstance()->size();i++)
801  { DumpRegion((*(G4RegionStore::GetInstance()))[i]); }
802  }
803  else
804  {
805  if(G4Threading::IsWorkerThread()) return;
806  G4cout << G4endl;
807  G4cout << "Region <" << region->GetName() << "> -- ";
808  if(region->GetWorldPhysical())
809  {
810  G4cout << " -- appears in <"
811  << region->GetWorldPhysical()->GetName() << "> world volume";
812  }
813  else
814  { G4cout << " -- is not associated to any world."; }
815  G4cout << G4endl;
816  if(region->IsInMassGeometry())
817  { G4cout << " This region is in the mass world." << G4endl; }
818  if(region->IsInParallelGeometry())
819  { G4cout << " This region is in the parallel world." << G4endl; }
820 
821  G4cout << " Root logical volume(s) : ";
822  size_t nRootLV = region->GetNumberOfRootVolumes();
823  std::vector<G4LogicalVolume*>::iterator lvItr = region->GetRootLogicalVolumeIterator();
824  for(size_t j=0;j<nRootLV;j++)
825  { G4cout << (*lvItr)->GetName() << " "; lvItr++; }
826  G4cout << G4endl;
827 
828  G4cout << " Pointers : G4VUserRegionInformation[" << region->GetUserInformation()
829  << "], G4UserLimits[" << region->GetUserLimits()
830  << "], G4FastSimulationManager[" << region->GetFastSimulationManager()
831  << "], G4UserSteppingAction[" << region->GetRegionalSteppingAction() << "]" << G4endl;
832 
833  G4cout << " Materials : ";
834  std::vector<G4Material*>::const_iterator mItr = region->GetMaterialIterator();
835  size_t nMaterial = region->GetNumberOfMaterials();
836  for(size_t iMate=0;iMate<nMaterial;iMate++)
837  {
838  G4cout << (*mItr)->GetName() << " ";
839  mItr++;
840  }
841  G4cout << G4endl;
842  G4ProductionCuts* cuts = region->GetProductionCuts();
843  if(!cuts && region->IsInMassGeometry())
844  {
845  G4cerr << "Warning : Region <" << region->GetName()
846  << "> does not have specific production cuts." << G4endl;
847  G4cerr << "Default cuts are used for this region." << G4endl;
848  region->SetProductionCuts(
849  G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
850  }
851  else if(cuts)
852  {
853  G4cout << " Production cuts : "
854  << " gamma "
855  << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
856  << " e- "
857  << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
858  << " e+ "
859  << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
860  << " proton "
861  << G4BestUnit(cuts->GetProductionCut("proton"),"Length")
862  << G4endl;
863  }
864  }
865 }
G4bool IsInMassGeometry() const
void DumpRegion(const G4String &rname) const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
size_t GetNumberOfMaterials() const
G4VPhysicalVolume * GetWorldPhysical() const
G4double GetProductionCut(G4int index) const
static G4RegionStore * GetInstance()
size_t GetNumberOfRootVolumes() const
G4GLOB_DLL std::ostream G4cout
std::vector< G4Material * >::const_iterator GetMaterialIterator() const
G4FastSimulationManager * GetFastSimulationManager() const
Definition: G4Region.cc:137
G4bool IsInParallelGeometry() const
G4UserLimits * GetUserLimits() const
const G4String & GetName() const
G4bool IsWorkerThread()
Definition: G4Threading.cc:135
const G4String & GetName() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4VUserRegionInformation * GetUserInformation() const
#define G4endl
Definition: G4ios.hh:61
void SetProductionCuts(G4ProductionCuts *cut)
G4ProductionCuts * GetProductionCuts() const
G4UserSteppingAction * GetRegionalSteppingAction() const
Definition: G4Region.cc:155
G4GLOB_DLL std::ostream G4cerr
std::vector< G4LogicalVolume * >::iterator GetRootLogicalVolumeIterator()
Here is the call graph for this function:

◆ GeometryHasBeenModified()

void G4RunManagerKernel::GeometryHasBeenModified ( )
inline

Definition at line 164 of file G4RunManagerKernel.hh.

165  { geometryNeedsToBeClosed = true; }
Here is the caller graph for this function:

◆ GetCurrentWorld()

G4VPhysicalVolume* G4RunManagerKernel::GetCurrentWorld ( ) const
inline

Definition at line 212 of file G4RunManagerKernel.hh.

213  { return currentWorld; }
G4VPhysicalVolume * currentWorld
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetEventManager()

G4EventManager* G4RunManagerKernel::GetEventManager ( ) const
inline

Definition at line 178 of file G4RunManagerKernel.hh.

179  { return eventManager; }
G4EventManager * eventManager
Here is the caller graph for this function:

◆ GetNumberOfParallelWorld()

G4int G4RunManagerKernel::GetNumberOfParallelWorld ( ) const
inline

Definition at line 204 of file G4RunManagerKernel.hh.

205  { return numberOfParallelWorld; }
Here is the caller graph for this function:

◆ GetNumberOfStaticAllocators()

G4int G4RunManagerKernel::GetNumberOfStaticAllocators ( ) const
inline

Definition at line 222 of file G4RunManagerKernel.hh.

223  { return numberOfStaticAllocators; }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPhysicsList()

G4VUserPhysicsList* G4RunManagerKernel::GetPhysicsList ( ) const
inline

Definition at line 209 of file G4RunManagerKernel.hh.

210  { return physicsList; }
G4VUserPhysicsList * physicsList

◆ GetPrimaryTransformer()

G4PrimaryTransformer* G4RunManagerKernel::GetPrimaryTransformer ( ) const
inline

Definition at line 186 of file G4RunManagerKernel.hh.

187  { return eventManager->GetPrimaryTransformer(); }
G4EventManager * eventManager
G4PrimaryTransformer * GetPrimaryTransformer() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRunManagerKernel()

G4RunManagerKernel * G4RunManagerKernel::GetRunManagerKernel ( )
static

Definition at line 75 of file G4RunManagerKernel.cc.

76 { return fRunManagerKernel; }
static G4ThreadLocal G4RunManagerKernel * fRunManagerKernel
Here is the caller graph for this function:

◆ GetStackManager()

G4StackManager* G4RunManagerKernel::GetStackManager ( ) const
inline

Definition at line 180 of file G4RunManagerKernel.hh.

181  { return eventManager->GetStackManager(); }
G4EventManager * eventManager
G4StackManager * GetStackManager() const
Here is the call graph for this function:

◆ GetTrackingManager()

G4TrackingManager* G4RunManagerKernel::GetTrackingManager ( ) const
inline

Definition at line 182 of file G4RunManagerKernel.hh.

183  { return eventManager->GetTrackingManager(); }
G4EventManager * eventManager
G4TrackingManager * GetTrackingManager() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVersionString()

const G4String& G4RunManagerKernel::GetVersionString ( ) const
inline

Definition at line 189 of file G4RunManagerKernel.hh.

190  { return versionString; }
Here is the caller graph for this function:

◆ InitializePhysics()

void G4RunManagerKernel::InitializePhysics ( )

Definition at line 513 of file G4RunManagerKernel.cc.

514 {
516  G4ApplicationState currentState = stateManager->GetCurrentState();
517  if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
518  {
519  G4Exception("G4RunManagerKernel::InitializePhysics",
520  "Run0011", JustWarning,
521  "Geant4 kernel is not PreInit or Idle state : Method ignored.");
522  return;
523  }
524 
525  if(!physicsList)
526  {
527  G4Exception("G4RunManagerKernel::InitializePhysics",
528  "Run0012", FatalException,
529  "G4VUserPhysicsList is not defined");
530  return;
531  }
532 
533  if(verboseLevel>1) G4cout << "physicsList->Construct() start." << G4endl;
536 
537  if(verboseLevel>1) G4cout << "physicsList->CheckParticleList() start." << G4endl;
539  //Cannot assume that SetCuts and CheckRegions are thread safe. We need to mutex
540  //Report from valgrind --tool=drd
541  G4AutoLock l(&initphysicsmutex);
542  if ( G4Threading::IsMasterThread() ) {
543  if(verboseLevel>1) G4cout << "physicsList->setCut() start." << G4endl;
544  physicsList->SetCuts();
545 
546  }
547  CheckRegions();
548  l.unlock();
549 
550 /*******************
551 // static G4bool createIsomerOnlyOnce = false;
552 // if(G4Threading::IsMultithreadedApplication() && G4Threading::IsMasterThread())
553 // {
554 // if(!createIsomerOnlyOnce)
555 // {
556 // createIsomerOnlyOnce = true;
557 // G4ParticleDefinition* gion = G4ParticleTable::GetParticleTable()->GetGenericIon();
558 // if(gion)
559 // {
560 // G4ParticleTable::GetParticleTable()->GetIonTable()->CreateAllIsomer();
561 // PropagateGenericIonID();
562 // }
563 // }
564 // }
565 *********************/
566 
567  physicsInitialized = true;
568  if(geometryInitialized && currentState!=G4State_Idle)
569  { stateManager->SetNewState(G4State_Idle); }
570 }
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
G4bool SetNewState(G4ApplicationState requestedState)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void UseCoupledTransportation(G4bool vl=true)
G4VUserPhysicsList * physicsList
#define G4endl
Definition: G4ios.hh:61
G4bool IsMasterThread()
Definition: G4Threading.cc:136
G4ApplicationState GetCurrentState() const
G4ApplicationState
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PhysicsHasBeenModified()

void G4RunManagerKernel::PhysicsHasBeenModified ( )
inline

Definition at line 170 of file G4RunManagerKernel.hh.

171  { physicsNeedsToBeReBuilt = true; }
Here is the caller graph for this function:

◆ PropagateGenericIonID()

void G4RunManagerKernel::PropagateGenericIonID ( )
protected

Definition at line 629 of file G4RunManagerKernel.cc.

630 {
632  if(gion)
633  {
634  //G4ParticleTable::GetParticleTable()->GetIonTable()->CreateAllIsomer();
635  G4int gionId = gion->GetParticleDefinitionID();
637  pItr->reset(false);
638  while( (*pItr)() )
639  {
640  G4ParticleDefinition* particle = pItr->value();
641  if(particle->IsGeneralIon()) particle->SetParticleDefinitionID(gionId);
642  }
643  }
644 }
void SetParticleDefinitionID(G4int id=-1)
G4ParticleDefinition * GetGenericIon() const
G4int GetParticleDefinitionID() const
int G4int
Definition: G4Types.hh:78
void reset(G4bool ifSkipIon=true)
G4bool IsGeneralIon() const
static G4ParticleTable * GetParticleTable()
G4PTblDicIterator * GetIterator() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetNavigator()

void G4RunManagerKernel::ResetNavigator ( )
protected

Definition at line 653 of file G4RunManagerKernel.cc.

654 {
656  { geometryNeedsToBeClosed = false; return; }
657 
658  // We have to tweak the navigator's state in case a geometry has been
659  // modified between runs. By the following calls we ensure that navigator's
660  // state is reset properly. It is required the geometry to be closed
661  // and previous optimisations to be cleared.
662 
664  if(verboseLevel>1) G4cout << "Start closing geometry." << G4endl;
665 
666  geomManager->OpenGeometry();
668 
669  geometryNeedsToBeClosed = false;
670 }
G4GLOB_DLL std::ostream G4cout
static G4GeometryManager * GetInstance()
#define G4endl
Definition: G4ios.hh:61
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=0)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunInitialization()

G4bool G4RunManagerKernel::RunInitialization ( G4bool  fakeRun = false)

Definition at line 572 of file G4RunManagerKernel.cc.

573 {
575  G4ApplicationState currentState = stateManager->GetCurrentState();
576 
577  if(!geometryInitialized)
578  {
579  G4Exception("G4RunManagerKernel::RunInitialization",
580  "Run0021",
581  JustWarning,
582  "Geometry has not yet initialized : method ignored.");
583  return false;
584  }
585 
586  if(!physicsInitialized)
587  {
588  G4Exception("G4RunManagerKernel::RunInitialization",
589  "Run0022",
590  JustWarning,
591  "Physics has not yet initialized : method ignored.");
592  return false;
593  }
594 
595  if( currentState != G4State_Idle )
596  {
597  G4Exception("G4RunManagerKernel::RunInitialization",
598  "Run0023",
599  JustWarning,
600  "Geant4 kernel not in Idle state : method ignored.");
601  return false;
602  }
603 
605 
608  UpdateRegion();
609  BuildPhysicsTables(fakeRun);
610 
612  {
613  ResetNavigator();
614  // CheckRegularGeometry();
615  // Notify the VisManager as well
617  {
619  if(pVVisManager) pVVisManager->GeometryHasChanged();
620  }
621  }
622 
624 
625  stateManager->SetNewState(G4State_GeomClosed);
626  return true;
627 }
virtual void GeometryHasChanged()=0
virtual void SetupShadowProcess() const
G4PrimaryTransformer * GetPrimaryTransformer() const
static G4VVisManager * GetConcreteInstance()
static G4StateManager * GetStateManager()
G4bool SetNewState(G4ApplicationState requestedState)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4bool IsMasterThread()
Definition: G4Threading.cc:136
void BuildPhysicsTables(G4bool fakeRun)
G4ApplicationState GetCurrentState() const
G4ApplicationState
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunTermination()

void G4RunManagerKernel::RunTermination ( )

Definition at line 646 of file G4RunManagerKernel.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGeometryToBeOptimized()

void G4RunManagerKernel::SetGeometryToBeOptimized ( G4bool  vl)
inline

Definition at line 195 of file G4RunManagerKernel.hh.

196  {
197  if(geometryToBeOptimized != vl)
198  {
201  }
202  }
Here is the caller graph for this function:

◆ SetNumberOfParallelWorld()

void G4RunManagerKernel::SetNumberOfParallelWorld ( G4int  i)
inline

Definition at line 206 of file G4RunManagerKernel.hh.

Here is the caller graph for this function:

◆ SetPhysics()

void G4RunManagerKernel::SetPhysics ( G4VUserPhysicsList uPhys)

Definition at line 449 of file G4RunManagerKernel.cc.

450 {
451  physicsList = uPhys;
452 
453  if(runManagerKernelType==workerRMK) return;
454 
455  SetupPhysics();
457  if(verboseLevel>1)
458  {
459  G4cout << "List of instantiated particles ============================================" << G4endl;
461  for(G4int i=0;i<nPtcl;i++)
462  {
464  G4cout << pd->GetParticleName() << " ";
465  if(i%10==9) G4cout << G4endl;
466  }
467  G4cout << G4endl;
468  }
469 }
void DumpTable(const G4String &particle_name="ALL")
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static G4ParticleTable * GetParticleTable()
G4VUserPhysicsList * physicsList
#define G4endl
Definition: G4ios.hh:61
G4ParticleDefinition * GetParticle(G4int index) const
G4int entries() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPrimaryTransformer()

void G4RunManagerKernel::SetPrimaryTransformer ( G4PrimaryTransformer pt)
inline

Definition at line 184 of file G4RunManagerKernel.hh.

G4EventManager * eventManager
void SetPrimaryTransformer(G4PrimaryTransformer *tf)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetScoreSplitter()

void G4RunManagerKernel::SetScoreSplitter ( )
private

Definition at line 909 of file G4RunManagerKernel.cc.

910 {
914 
915  // Ensure that Process is added only once to the particles' process managers
916  static G4ThreadLocal bool InitSplitter=false;
917  if( ! InitSplitter ) {
918  InitSplitter = true;
919 
920  theParticleIterator->reset();
921  while( (*theParticleIterator)() )
922  {
923  G4ParticleDefinition* particle = theParticleIterator->value();
924  G4ProcessManager* pmanager = particle->GetProcessManager();
925  if(pmanager)
926  { pmanager->AddDiscreteProcess(pSplitter); }
927  }
928 
929  if(verboseLevel>0)
930  {
931  G4cout << "G4RunManagerKernel -- G4ScoreSplittingProcess is appended to all particles." << G4endl;
932  }
933  }
934 }
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
#define G4ThreadLocal
Definition: tls.hh:89
G4GLOB_DLL std::ostream G4cout
void reset(G4bool ifSkipIon=true)
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61
G4PTblDicIterator * GetIterator() const
#define theParticleIterator
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupDefaultRegion()

void G4RunManagerKernel::SetupDefaultRegion ( )
protected

Definition at line 238 of file G4RunManagerKernel.cc.

239 {
240  if(runManagerKernelType==workerRMK) return;
241 
242  // Remove old world logical volume from the default region, if exist
244  {
245  if(defaultRegion->GetNumberOfRootVolumes()>size_t(1))
246  {
247  G4Exception("G4RunManager::SetupDefaultRegion",
248  "Run0005",
250  "Default world region should have a unique logical volume.");
251  }
252  std::vector<G4LogicalVolume*>::iterator lvItr
254  defaultRegion->RemoveRootLogicalVolume(*lvItr,false);
255  if(verboseLevel>1) G4cout
256  << "Obsolete world logical volume is removed from the default region." << G4endl;
257  }
258 
259 }
size_t GetNumberOfRootVolumes() const
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
void RemoveRootLogicalVolume(G4LogicalVolume *lv, G4bool scan=true)
Definition: G4Region.cc:319
std::vector< G4LogicalVolume * >::iterator GetRootLogicalVolumeIterator()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupPhysics()

void G4RunManagerKernel::SetupPhysics ( )
protected

Definition at line 476 of file G4RunManagerKernel.cc.

477 {
479 
481 
482  // For sanity reason
485  if(gion)
488 
490  pItr->reset();
491  while( (*pItr)() )
492  {
493  G4ParticleDefinition* particle = pItr->value();
494  if(!(particle->IsGeneralIon())) particle->SetParticleDefinitionID();
495  }
496 
497  if(gion)
498  {
499  G4int gionId = gion->GetParticleDefinitionID();
500  pItr->reset(false);
501  while( (*pItr)() )
502  {
503  G4ParticleDefinition* particle = pItr->value();
504  if(particle->IsGeneralIon()) particle->SetParticleDefinitionID(gionId);
505  }
506  }
507 }
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void InitializeLightIons()
Definition: G4IonTable.cc:178
void SetParticleDefinitionID(G4int id=-1)
void SetReadiness(G4bool val=true)
G4ParticleDefinition * GetGenericIon() const
G4int GetParticleDefinitionID() const
int G4int
Definition: G4Types.hh:78
static void ConstructParticle()
void reset(G4bool ifSkipIon=true)
G4IonTable * GetIonTable() const
G4bool IsGeneralIon() const
static G4ParticleTable * GetParticleTable()
G4VUserPhysicsList * physicsList
virtual void ConstructParticle()=0
G4PTblDicIterator * GetIterator() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupShadowProcess()

void G4RunManagerKernel::SetupShadowProcess ( ) const
protectedvirtual

Reimplemented in G4MTRunManagerKernel, and G4WorkerRunManagerKernel.

Definition at line 936 of file G4RunManagerKernel.cc.

937 {
940  theParticleIterator->reset();
941  //loop on particles and get process manager from there list of processes
942  while((*theParticleIterator)())
943  {
944  G4ParticleDefinition* pd = theParticleIterator->value();
946  if(pm)
947  {
948  G4ProcessVector& procs = *(pm->GetProcessList());
949  for ( G4int idx = 0 ; idx<procs.size() ; ++idx)
950  {
951  const G4VProcess* masterP = procs[idx]->GetMasterProcess();
952  if ( ! masterP )
953  {
954  //Process does not have an associated shadow master process
955  //We are in master mode or sequential
956  procs[idx]->SetMasterProcess(const_cast<G4VProcess*>(procs[idx]));
957  }
958  }
959  }
960  }
961 }
G4ProcessVector * GetProcessList() const
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
void reset(G4bool ifSkipIon=true)
G4int size() const
static G4ParticleTable * GetParticleTable()
G4PTblDicIterator * GetIterator() const
#define theParticleIterator
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerboseLevel()

void G4RunManagerKernel::SetVerboseLevel ( G4int  vl)
inline

Definition at line 192 of file G4RunManagerKernel.hh.

193  { verboseLevel = vl; }
Here is the caller graph for this function:

◆ UpdateRegion()

void G4RunManagerKernel::UpdateRegion ( )

Definition at line 672 of file G4RunManagerKernel.cc.

673 {
675  G4ApplicationState currentState = stateManager->GetCurrentState();
676  if( currentState != G4State_Idle )
677  {
678  G4Exception("G4RunManagerKernel::UpdateRegion",
679  "Run0024",
680  JustWarning,
681  "Geant4 kernel not in Idle state : method ignored.");
682  return;
683  }
684 
685  if(runManagerKernelType==workerRMK) return;
686 
687  CheckRegions();
688 
690 
692 }
void UpdateMaterialList(G4VPhysicalVolume *currentWorld=0)
G4VPhysicalVolume * currentWorld
static G4RegionStore * GetInstance()
static G4StateManager * GetStateManager()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4ProductionCutsTable * GetProductionCutsTable()
void UpdateCoupleTable(G4VPhysicalVolume *currentWorld)
G4ApplicationState GetCurrentState() const
G4ApplicationState
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WorkerDefineWorldVolume()

void G4RunManagerKernel::WorkerDefineWorldVolume ( G4VPhysicalVolume worldVol,
G4bool  topologyIsChanged = true 
)

Definition at line 337 of file G4RunManagerKernel.cc.

339 {
341  G4ApplicationState currentState = stateManager->GetCurrentState();
342  if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
343  {
344  G4Exception("G4RunManagerKernel::DefineWorldVolume",
345  "DefineWorldVolumeAtIncorrectState",
346  JustWarning,
347  "Geant4 kernel is not PreInit or Idle state : Method ignored.");
348  if(verboseLevel>1) G4cerr << "Current application state is "
349  << stateManager->GetStateString(currentState) << G4endl;
350  return;
351  }
352 
353  currentWorld = worldVol;
356  G4MTRunManager::masterWorlds_t masterWorlds= masterRM->GetMasterWorlds();
357  G4MTRunManager::masterWorlds_t::iterator itrMW = masterWorlds.begin();
358  for(;itrMW!=masterWorlds.end();itrMW++)
359  {
360  if((*itrMW).first == 0)
361  {
362  if((*itrMW).second != currentWorld)
363  {
364  G4Exception("G4RunManagerKernel::WorkerDefineWorldVolume","RUN3091",
365  FatalException,"Mass world is inconsistent");
366  }
367  transM->SetWorldForTracking((*itrMW).second);
368  }
369  else
370  {
371  transM->RegisterWorld((*itrMW).second);
372  }
373  }
374 
375  if(topologyIsChanged) geometryNeedsToBeClosed = true;
376 
377  // Notify the VisManager as well
379  {
381  if(pVVisManager) pVVisManager->GeometryHasChanged();
382  }
383 
384  geometryInitialized = true;
385  if(physicsInitialized && currentState!=G4State_Idle)
386  { stateManager->SetNewState(G4State_Idle); }
387 }
virtual void GeometryHasChanged()=0
std::map< G4int, G4VPhysicalVolume * > masterWorlds_t
G4VPhysicalVolume * currentWorld
static G4VVisManager * GetConcreteInstance()
G4String GetStateString(G4ApplicationState aState) const
static masterWorlds_t & GetMasterWorlds()
static G4StateManager * GetStateManager()
G4bool SetNewState(G4ApplicationState requestedState)
static G4MTRunManager * GetMasterRunManager()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61
G4bool IsMasterThread()
Definition: G4Threading.cc:136
G4bool RegisterWorld(G4VPhysicalVolume *aWorld)
void SetWorldForTracking(G4VPhysicalVolume *theWorld)
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:

◆ WorkerUpdateWorldVolume()

void G4RunManagerKernel::WorkerUpdateWorldVolume ( )

Definition at line 320 of file G4RunManagerKernel.cc.

321 {
324  G4MTRunManager::masterWorlds_t masterWorlds= masterRM->GetMasterWorlds();
325  G4MTRunManager::masterWorlds_t::iterator itrMW = masterWorlds.begin();
326  for(;itrMW!=masterWorlds.end();itrMW++)
327  {
328  G4VPhysicalVolume* wv = (*itrMW).second;
329  G4VPhysicalVolume* pWorld
331  ->IsWorldExisting(wv->GetName());
332  if(!pWorld)
333  { transM->RegisterWorld(wv); }
334  }
335 }
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
std::map< G4int, G4VPhysicalVolume * > masterWorlds_t
static masterWorlds_t & GetMasterWorlds()
static G4MTRunManager * GetMasterRunManager()
static G4TransportationManager * GetTransportationManager()
const G4String & GetName() const
G4bool RegisterWorld(G4VPhysicalVolume *aWorld)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ currentWorld

G4VPhysicalVolume* G4RunManagerKernel::currentWorld
private

Definition at line 148 of file G4RunManagerKernel.hh.

◆ defaultExceptionHandler

G4ExceptionHandler* G4RunManagerKernel::defaultExceptionHandler
private

Definition at line 157 of file G4RunManagerKernel.hh.

◆ defaultRegion

G4Region* G4RunManagerKernel::defaultRegion
protected

Definition at line 160 of file G4RunManagerKernel.hh.

◆ defaultRegionForParallelWorld

G4Region* G4RunManagerKernel::defaultRegionForParallelWorld
protected

Definition at line 161 of file G4RunManagerKernel.hh.

◆ eventManager

G4EventManager* G4RunManagerKernel::eventManager
private

Definition at line 156 of file G4RunManagerKernel.hh.

◆ fRunManagerKernel

G4ThreadLocal G4RunManagerKernel * G4RunManagerKernel::fRunManagerKernel = 0
staticprivate

Definition at line 76 of file G4RunManagerKernel.hh.

◆ geometryInitialized

G4bool G4RunManagerKernel::geometryInitialized
private

Definition at line 149 of file G4RunManagerKernel.hh.

◆ geometryNeedsToBeClosed

G4bool G4RunManagerKernel::geometryNeedsToBeClosed
protected

Definition at line 162 of file G4RunManagerKernel.hh.

◆ geometryToBeOptimized

G4bool G4RunManagerKernel::geometryToBeOptimized
private

Definition at line 151 of file G4RunManagerKernel.hh.

◆ numberOfParallelWorld

G4int G4RunManagerKernel::numberOfParallelWorld
private

Definition at line 154 of file G4RunManagerKernel.hh.

◆ numberOfStaticAllocators

G4int G4RunManagerKernel::numberOfStaticAllocators
private

Definition at line 219 of file G4RunManagerKernel.hh.

◆ physicsInitialized

G4bool G4RunManagerKernel::physicsInitialized
private

Definition at line 150 of file G4RunManagerKernel.hh.

◆ physicsList

G4VUserPhysicsList* G4RunManagerKernel::physicsList
private

Definition at line 147 of file G4RunManagerKernel.hh.

◆ physicsNeedsToBeReBuilt

G4bool G4RunManagerKernel::physicsNeedsToBeReBuilt
private

Definition at line 152 of file G4RunManagerKernel.hh.

◆ runManagerKernelType

RMKType G4RunManagerKernel::runManagerKernelType
protected

Definition at line 90 of file G4RunManagerKernel.hh.

◆ verboseLevel

G4int G4RunManagerKernel::verboseLevel
private

Definition at line 153 of file G4RunManagerKernel.hh.

◆ versionString

G4String G4RunManagerKernel::versionString
private

Definition at line 158 of file G4RunManagerKernel.hh.


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