72 if(!fGlobalFastSimulationManager)
75 return fGlobalFastSimulationManager;
87G4GlobalFastSimulationManager::G4GlobalFastSimulationManager()
97 delete fTheFastSimulationMessenger;
98 fTheFastSimulationMessenger = 0;
107 ManagedManagers.push_back(fsmanager);
113 ManagedManagers.
remove(fsmanager);
118 fFSMPVector.push_back(fp);
129 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
130 result = result || ManagedManagers[ifsm]->
133 G4cout <<
"Model " << aName <<
" activated.";
135 G4cout <<
"Model " << aName <<
" not found.";
142 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
143 result = result || ManagedManagers[ifsm]->
145 if (result)
G4cout <<
"Model " << aName <<
" inactivated.";
146 else G4cout <<
"Model " << aName <<
" not found.";
156 std::vector<G4VPhysicalVolume*> worldDone;
163 for (
size_t i=0; i<regions->size(); i++)
165 world = (*regions)[i]->GetWorldPhysical();
166 if (world ==
nullptr)
171 for (
size_t ii=0; ii<worldDone.size(); ii++)
if (worldDone[ii] == world) {newWorld =
false;
break;}
174 worldDone.push_back(world);
178 G4cout <<
"\n * Mass Geometry with ";
180 G4cout <<
"\n * Parallel Geometry with ";
185 std::vector<G4ParticleDefinition*> particlesKnown;
186 for (
size_t ip=0; ip<fFSMPVector.size(); ip++)
187 if (fFSMPVector[ip]->GetWorldVolume() == world)
189 G4cout <<
" o G4FastSimulationProcess: '" << fFSMPVector[ip]->GetProcessName() <<
"'" <<
G4endl;
190 G4cout <<
" Attached to:";
192 for (
G4int iParticle=0; iParticle<particles->
entries(); iParticle++)
196 if (processes->
contains(fFSMPVector[ip])) {
G4cout <<
" " << particle->
GetParticleName(); findG4FSMP =
true; particlesKnown.push_back(particle);}
200 if (!findG4FSMP)
G4cout <<
" o G4FastSimulationProcess: (none)" <<
G4endl;
203 DisplayRegion(worldRegion, 1, particlesKnown);
209void G4GlobalFastSimulationManager::DisplayRegion(
G4Region* region,
G4int depth, std::vector<G4ParticleDefinition*>& particlesKnown)
const
212 for (
G4int I=0; I<depth; I++) indent +=
" ";
223 G4cout <<
" ; applicable to:";
225 for (
G4int iParticle=0; iParticle<particles->
entries(); iParticle++)
231 for (
size_t l=0; l<particlesKnown.size();l++)
if(particlesKnown[l] == particles->
GetParticle(iParticle)) {known =
true;
break;}
232 if (!known)
G4cout <<
"[!!]";
241 for (
size_t ip=0; ip<physVolStore->size(); ip++)
248 if (thisVolMotherRegion == region)
264 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) ManagedManagers[ifsm]->ListModels(aName);
271 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
276 G4cout <<
"Current Envelopes for Fast Simulation:\n";
278 ManagedManagers[ifsm]->ListTitle();
281 else ManagedManagers[ifsm]->ListModels();
286 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
287 if(aName == ManagedManagers[ifsm]-> GetEnvelope()->GetName())
289 ManagedManagers[ifsm]->ListModels();
297 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
298 ManagedManagers[ifsm]->ListModels(aPD);
307 bool foundPrevious(
false);
308 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
310 model = ManagedManagers[ifsm]->
G4GLOB_DLL std::ostream G4cout
const std::vector< G4VFastSimulationModel * > & GetFastSimulationModelList() const
void RemoveFSMP(G4FastSimulationManagerProcess *)
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound=0) const
void ListEnvelopes(const G4String &aName="all", listType aListType=NAMES_ONLY)
void InActivateFastSimulationModel(const G4String &)
~G4GlobalFastSimulationManager()
void ActivateFastSimulationModel(const G4String &)
void AddFSMP(G4FastSimulationManagerProcess *)
void RemoveFastSimulationManager(G4FastSimulationManager *)
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()
static G4GlobalFastSimulationManager * GetInstance()
void AddFastSimulationManager(G4FastSimulationManager *)
G4bool IsRootRegion() const
G4Region * GetRegion() const
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticle(G4int index) const
static G4ParticleTable * GetParticleTable()
static G4PhysicalVolumeStore * GetInstance()
G4ProcessVector * GetProcessList() const
G4bool contains(G4VProcess *aProcess) const
static G4RegionStore * GetInstance()
G4FastSimulationManager * GetFastSimulationManager() const
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
G4LogicalVolume * GetMotherLogical() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const