#include <G4GlobalFastSimulationManager.hh>
Public Member Functions | |
G4VFastSimulationModel * | GetFastSimulationModel (const G4String &modelName, const G4VFastSimulationModel *previousFound=0) const |
~G4GlobalFastSimulationManager () | |
void | AddFastSimulationManager (G4FastSimulationManager *) |
void | RemoveFastSimulationManager (G4FastSimulationManager *) |
void | AddFSMP (G4FastSimulationManagerProcess *) |
void | RemoveFSMP (G4FastSimulationManagerProcess *) |
void | FastSimulationNeedsToBeClosed () |
void | ShowSetup () |
void | ListEnvelopes (const G4String &aName="all", listType aListType=NAMES_ONLY) |
void | ListEnvelopes (const G4ParticleDefinition *) |
void | ActivateFastSimulationModel (const G4String &) |
void | InActivateFastSimulationModel (const G4String &) |
Static Public Member Functions | |
static G4GlobalFastSimulationManager * | GetGlobalFastSimulationManager () |
static G4GlobalFastSimulationManager * | GetInstance () |
Definition at line 85 of file G4GlobalFastSimulationManager.hh.
G4GlobalFastSimulationManager::~G4GlobalFastSimulationManager | ( | ) |
void G4GlobalFastSimulationManager::ActivateFastSimulationModel | ( | const G4String & | ) |
Definition at line 127 of file G4GlobalFastSimulationManager.cc.
References G4cout, and G4endl.
Referenced by G4FastSimulationMessenger::SetNewValue().
00128 { 00129 G4bool result = false; 00130 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) 00131 result = result || ManagedManagers[ifsm]-> 00132 ActivateFastSimulationModel(aName); 00133 if(result) 00134 G4cout << "Model " << aName << " activated."; 00135 else 00136 G4cout << "Model " << aName << " not found."; 00137 G4cout << G4endl; 00138 }
void G4GlobalFastSimulationManager::AddFastSimulationManager | ( | G4FastSimulationManager * | ) |
void G4GlobalFastSimulationManager::AddFSMP | ( | G4FastSimulationManagerProcess * | ) |
Definition at line 117 of file G4GlobalFastSimulationManager.cc.
Referenced by G4FastSimulationManagerProcess::G4FastSimulationManagerProcess().
void G4GlobalFastSimulationManager::FastSimulationNeedsToBeClosed | ( | ) |
G4VFastSimulationModel * G4GlobalFastSimulationManager::GetFastSimulationModel | ( | const G4String & | modelName, | |
const G4VFastSimulationModel * | previousFound = 0 | |||
) | const |
Definition at line 299 of file G4GlobalFastSimulationManager.cc.
00301 { 00302 G4VFastSimulationModel* model = 0; 00303 // -- flag used to navigate accross the various managers; 00304 bool foundPrevious(false); 00305 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) 00306 { 00307 model = ManagedManagers[ifsm]-> 00308 GetFastSimulationModel(modelName, previousFound, foundPrevious); 00309 if (model) break; 00310 } 00311 return model; 00312 }
G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::GetGlobalFastSimulationManager | ( | ) | [static] |
Definition at line 71 of file G4GlobalFastSimulationManager.cc.
Referenced by G4FastSimulationManager::G4FastSimulationManager(), G4FastSimulationManagerProcess::G4FastSimulationManagerProcess(), GetInstance(), G4FastSimulationManager::~G4FastSimulationManager(), and G4FastSimulationManagerProcess::~G4FastSimulationManagerProcess().
00072 { 00073 if(!fGlobalFastSimulationManager) 00074 fGlobalFastSimulationManager = new G4GlobalFastSimulationManager; 00075 00076 return fGlobalFastSimulationManager; 00077 }
G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::GetInstance | ( | ) | [static] |
Definition at line 80 of file G4GlobalFastSimulationManager.cc.
References GetGlobalFastSimulationManager().
00081 { 00082 return G4GlobalFastSimulationManager::GetGlobalFastSimulationManager(); 00083 }
void G4GlobalFastSimulationManager::InActivateFastSimulationModel | ( | const G4String & | ) |
Definition at line 140 of file G4GlobalFastSimulationManager.cc.
References G4cout, and G4endl.
Referenced by G4FastSimulationMessenger::SetNewValue().
00141 { 00142 G4bool result = false; 00143 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) 00144 result = result || ManagedManagers[ifsm]-> 00145 InActivateFastSimulationModel(aName); 00146 if (result) G4cout << "Model " << aName << " inactivated."; 00147 else G4cout << "Model " << aName << " not found."; 00148 G4cout << G4endl; 00149 }
void G4GlobalFastSimulationManager::ListEnvelopes | ( | const G4ParticleDefinition * | ) |
Definition at line 292 of file G4GlobalFastSimulationManager.cc.
00293 { 00294 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) 00295 ManagedManagers[ifsm]->ListModels(aPD); 00296 }
void G4GlobalFastSimulationManager::ListEnvelopes | ( | const G4String & | aName = "all" , |
|
listType | aListType = NAMES_ONLY | |||
) |
Definition at line 256 of file G4GlobalFastSimulationManager.cc.
References G4cout, ISAPPLICABLE, and NAMES_ONLY.
Referenced by G4FastSimulationMessenger::SetNewValue().
00258 { 00259 if (theType == ISAPPLICABLE) 00260 { 00261 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) ManagedManagers[ifsm]->ListModels(aName); 00262 return; 00263 } 00264 00265 if(aName == "all") 00266 { 00267 G4int titled = 0; 00268 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) 00269 { 00270 if(theType == NAMES_ONLY) 00271 { 00272 if(!(titled++)) 00273 G4cout << "Current Envelopes for Fast Simulation:\n"; 00274 G4cout << " "; 00275 ManagedManagers[ifsm]->ListTitle(); 00276 G4cout << G4endl; 00277 } 00278 else ManagedManagers[ifsm]->ListModels(); 00279 } 00280 } 00281 else 00282 { 00283 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) 00284 if(aName == ManagedManagers[ifsm]-> GetEnvelope()->GetName()) 00285 { 00286 ManagedManagers[ifsm]->ListModels(); 00287 break; 00288 } 00289 } 00290 }
void G4GlobalFastSimulationManager::RemoveFastSimulationManager | ( | G4FastSimulationManager * | ) |
Definition at line 112 of file G4GlobalFastSimulationManager.cc.
References G4FastSimulationVector< T >::remove().
00113 { 00114 ManagedManagers.remove(fsmanager); 00115 }
void G4GlobalFastSimulationManager::RemoveFSMP | ( | G4FastSimulationManagerProcess * | ) |
Definition at line 122 of file G4GlobalFastSimulationManager.cc.
References G4FastSimulationVector< T >::remove().
Referenced by G4FastSimulationManagerProcess::~G4FastSimulationManagerProcess().
00123 { 00124 fFSMPVector.remove(fp); 00125 }
void G4GlobalFastSimulationManager::ShowSetup | ( | ) |
Definition at line 155 of file G4GlobalFastSimulationManager.cc.
References G4ProcessVector::contains(), G4ParticleTable::entries(), G4cout, G4endl, G4RegionStore::GetInstance(), G4Region::GetName(), G4ParticleTable::GetParticle(), G4ParticleTable::GetParticleTable(), G4ProcessManager::GetProcessList(), G4ParticleDefinition::GetProcessManager(), and G4TransportationManager::GetTransportationManager().
Referenced by G4FastSimulationMessenger::SetNewValue().
00156 { 00157 std::vector<G4VPhysicalVolume*> worldDone; 00158 G4VPhysicalVolume* world; 00159 G4RegionStore* regions = G4RegionStore::GetInstance(); 00160 // ---------------------------------------------------- 00161 // -- loop on regions to get the list of world volumes: 00162 // ---------------------------------------------------- 00163 G4cout << "\nFast simulation setup:" << G4endl; 00164 for (size_t i=0; i<regions->size(); i++) 00165 { 00166 world = (*regions)[i]->GetWorldPhysical(); 00167 G4bool newWorld = true; 00168 for (size_t ii=0; ii<worldDone.size(); ii++) if (worldDone[ii] == world) {newWorld = false; break;} 00169 if (newWorld) 00170 { 00171 worldDone.push_back(world); 00172 G4Region* worldRegion = world->GetLogicalVolume()->GetRegion(); 00173 // -- preambule: print physical volume and region names... 00174 if (world == G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()) 00175 G4cout << "\n * Mass Geometry with "; 00176 else 00177 G4cout << "\n * Parallel Geometry with "; 00178 G4cout << "world volume: `" << world->GetName() << "' [region : `" << worldRegion->GetName() << "']" << G4endl; 00179 // -- ... and print G4FSMP(s) attached to this world volume: 00180 G4bool findG4FSMP(false); 00181 // -- show to what particles this G4FSMP is attached to: 00182 std::vector<G4ParticleDefinition*> particlesKnown; 00183 for (size_t ip=0; ip<fFSMPVector.size(); ip++) 00184 if (fFSMPVector[ip]->GetWorldVolume() == world) 00185 { 00186 G4cout << " o G4FastSimulationProcess: '" << fFSMPVector[ip]->GetProcessName() << "'" << G4endl; 00187 G4cout << " Attached to:"; 00188 G4ParticleTable* particles = G4ParticleTable::GetParticleTable(); 00189 for (G4int iParticle=0; iParticle<particles->entries(); iParticle++) 00190 { 00191 G4ParticleDefinition* particle = particles->GetParticle(iParticle); 00192 G4ProcessVector* processes = particle->GetProcessManager()->GetProcessList(); 00193 if (processes->contains(fFSMPVector[ip])) {G4cout << " " << particle->GetParticleName(); findG4FSMP = true; particlesKnown.push_back(particle);} 00194 } 00195 G4cout << G4endl; 00196 } 00197 if (!findG4FSMP) G4cout << " o G4FastSimulationProcess: (none)" << G4endl; 00198 // -- now display the regions in this world volume, with mother<->daughter link shown by indentation: 00199 G4cout << " o Region(s) and model(s) setup:" << G4endl; 00200 DisplayRegion(worldRegion, 1, particlesKnown); 00201 } 00202 } 00203 }