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.";
153 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
154 ManagedManagers[ifsm]->FlushModels();
162 std::vector<G4VPhysicalVolume*> worldDone;
169 for (
size_t i=0; i<regions->size(); i++)
171 world = (*regions)[i]->GetWorldPhysical();
172 if (world ==
nullptr)
177 for (
size_t ii=0; ii<worldDone.size(); ii++)
if (worldDone[ii] == world) {newWorld =
false;
break;}
180 worldDone.push_back(world);
184 G4cout <<
"\n * Mass Geometry with ";
186 G4cout <<
"\n * Parallel Geometry with ";
191 std::vector<G4ParticleDefinition*> particlesKnown;
192 for (
size_t ip=0; ip<fFSMPVector.size(); ip++)
193 if (fFSMPVector[ip]->GetWorldVolume() == world)
195 G4cout <<
" o G4FastSimulationProcess: '" << fFSMPVector[ip]->GetProcessName() <<
"'" <<
G4endl;
196 G4cout <<
" Attached to:";
198 for (
G4int iParticle=0; iParticle<particles->
entries(); iParticle++)
202 if (processes->
contains(fFSMPVector[ip])) {
G4cout <<
" " << particle->
GetParticleName(); findG4FSMP =
true; particlesKnown.push_back(particle);}
206 if (!findG4FSMP)
G4cout <<
" o G4FastSimulationProcess: (none)" <<
G4endl;
209 DisplayRegion(worldRegion, 1, particlesKnown);
215void G4GlobalFastSimulationManager::DisplayRegion(
G4Region* region,
G4int depth, std::vector<G4ParticleDefinition*>& particlesKnown)
const
218 for (
G4int I=0; I<depth; I++) indent +=
" ";
229 G4cout <<
" ; applicable to:";
231 for (
G4int iParticle=0; iParticle<particles->
entries(); iParticle++)
237 for (
size_t l=0; l<particlesKnown.size();l++)
if(particlesKnown[l] == particles->
GetParticle(iParticle)) {known =
true;
break;}
238 if (!known)
G4cout <<
"[!!]";
247 for (
size_t ip=0; ip<physVolStore->size(); ip++)
254 if (thisVolMotherRegion == region)
270 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) ManagedManagers[ifsm]->ListModels(aName);
277 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
282 G4cout <<
"Current Envelopes for Fast Simulation:\n";
284 ManagedManagers[ifsm]->ListTitle();
287 else ManagedManagers[ifsm]->ListModels();
292 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
293 if(aName == ManagedManagers[ifsm]-> GetEnvelope()->GetName())
295 ManagedManagers[ifsm]->ListModels();
303 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
304 ManagedManagers[ifsm]->ListModels(aPD);
313 bool foundPrevious(
false);
314 for (
size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
316 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