Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GlobalFastSimulationManager Class Reference

#include <G4GlobalFastSimulationManager.hh>

Public Member Functions

G4VFastSimulationModelGetFastSimulationModel (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 G4GlobalFastSimulationManagerGetGlobalFastSimulationManager ()
 
static G4GlobalFastSimulationManagerGetInstance ()
 

Detailed Description

Definition at line 85 of file G4GlobalFastSimulationManager.hh.

Constructor & Destructor Documentation

◆ ~G4GlobalFastSimulationManager()

G4GlobalFastSimulationManager::~G4GlobalFastSimulationManager ( )

Definition at line 96 of file G4GlobalFastSimulationManager.cc.

97{
98 delete fTheFastSimulationMessenger;
99 fTheFastSimulationMessenger = 0;
100}

Member Function Documentation

◆ ActivateFastSimulationModel()

void G4GlobalFastSimulationManager::ActivateFastSimulationModel ( const G4String aName)

Definition at line 127 of file G4GlobalFastSimulationManager.cc.

128{
129 G4bool result = false;
130 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
131 result = result || ManagedManagers[ifsm]->
133 if(result)
134 G4cout << "Model " << aName << " activated.";
135 else
136 G4cout << "Model " << aName << " not found.";
137 G4cout << G4endl;
138}
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by ActivateFastSimulationModel(), and G4FastSimulationMessenger::SetNewValue().

◆ AddFastSimulationManager()

void G4GlobalFastSimulationManager::AddFastSimulationManager ( G4FastSimulationManager fsmanager)

Definition at line 105 of file G4GlobalFastSimulationManager.cc.

107{
108 ManagedManagers.push_back(fsmanager);
109}

◆ AddFSMP()

void G4GlobalFastSimulationManager::AddFSMP ( G4FastSimulationManagerProcess fp)

Definition at line 117 of file G4GlobalFastSimulationManager.cc.

118{
119 fFSMPVector.push_back(fp);
120}

Referenced by G4FastSimulationManagerProcess::G4FastSimulationManagerProcess().

◆ FastSimulationNeedsToBeClosed()

void G4GlobalFastSimulationManager::FastSimulationNeedsToBeClosed ( )

◆ GetFastSimulationModel()

G4VFastSimulationModel * G4GlobalFastSimulationManager::GetFastSimulationModel ( const G4String modelName,
const G4VFastSimulationModel previousFound = 0 
) const

Definition at line 299 of file G4GlobalFastSimulationManager.cc.

301{
302 G4VFastSimulationModel* model = 0;
303 // -- flag used to navigate accross the various managers;
304 bool foundPrevious(false);
305 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
306 {
307 model = ManagedManagers[ifsm]->
308 GetFastSimulationModel(modelName, previousFound, foundPrevious);
309 if (model) break;
310 }
311 return model;
312}
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound=0) const

Referenced by GetFastSimulationModel().

◆ GetGlobalFastSimulationManager()

G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::GetGlobalFastSimulationManager ( )
static

◆ GetInstance()

G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::GetInstance ( )
static

Definition at line 80 of file G4GlobalFastSimulationManager.cc.

81{
83}
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()

◆ InActivateFastSimulationModel()

void G4GlobalFastSimulationManager::InActivateFastSimulationModel ( const G4String aName)

Definition at line 140 of file G4GlobalFastSimulationManager.cc.

141{
142 G4bool result = false;
143 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
144 result = result || ManagedManagers[ifsm]->
146 if (result) G4cout << "Model " << aName << " inactivated.";
147 else G4cout << "Model " << aName << " not found.";
148 G4cout << G4endl;
149}
void InActivateFastSimulationModel(const G4String &)

Referenced by InActivateFastSimulationModel(), and G4FastSimulationMessenger::SetNewValue().

◆ ListEnvelopes() [1/2]

void G4GlobalFastSimulationManager::ListEnvelopes ( const G4ParticleDefinition aPD)

Definition at line 292 of file G4GlobalFastSimulationManager.cc.

293{
294 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
295 ManagedManagers[ifsm]->ListModels(aPD);
296}

◆ ListEnvelopes() [2/2]

void G4GlobalFastSimulationManager::ListEnvelopes ( const G4String aName = "all",
listType  aListType = NAMES_ONLY 
)

Definition at line 256 of file G4GlobalFastSimulationManager.cc.

258{
259 if (theType == ISAPPLICABLE)
260 {
261 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) ManagedManagers[ifsm]->ListModels(aName);
262 return;
263 }
264
265 if(aName == "all")
266 {
267 G4int titled = 0;
268 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
269 {
270 if(theType == NAMES_ONLY)
271 {
272 if(!(titled++))
273 G4cout << "Current Envelopes for Fast Simulation:\n";
274 G4cout << " ";
275 ManagedManagers[ifsm]->ListTitle();
276 G4cout << G4endl;
277 }
278 else ManagedManagers[ifsm]->ListModels();
279 }
280 }
281 else
282 {
283 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
284 if(aName == ManagedManagers[ifsm]-> GetEnvelope()->GetName())
285 {
286 ManagedManagers[ifsm]->ListModels();
287 break;
288 }
289 }
290}
int G4int
Definition: G4Types.hh:66

Referenced by G4FastSimulationMessenger::SetNewValue().

◆ RemoveFastSimulationManager()

void G4GlobalFastSimulationManager::RemoveFastSimulationManager ( G4FastSimulationManager fsmanager)

Definition at line 111 of file G4GlobalFastSimulationManager.cc.

113{
114 ManagedManagers.remove(fsmanager);
115}
T * remove(const T *)

◆ RemoveFSMP()

void G4GlobalFastSimulationManager::RemoveFSMP ( G4FastSimulationManagerProcess fp)

Definition at line 122 of file G4GlobalFastSimulationManager.cc.

123{
124 fFSMPVector.remove(fp);
125}

Referenced by G4FastSimulationManagerProcess::~G4FastSimulationManagerProcess().

◆ ShowSetup()

void G4GlobalFastSimulationManager::ShowSetup ( )

Definition at line 155 of file G4GlobalFastSimulationManager.cc.

156{
157 std::vector<G4VPhysicalVolume*> worldDone;
158 G4VPhysicalVolume* world;
160 // ----------------------------------------------------
161 // -- loop on regions to get the list of world volumes:
162 // ----------------------------------------------------
163 G4cout << "\nFast simulation setup:" << G4endl;
164 for (size_t i=0; i<regions->size(); i++)
165 {
166 world = (*regions)[i]->GetWorldPhysical();
167 G4bool newWorld = true;
168 for (size_t ii=0; ii<worldDone.size(); ii++) if (worldDone[ii] == world) {newWorld = false; break;}
169 if (newWorld)
170 {
171 worldDone.push_back(world);
172 G4Region* worldRegion = world->GetLogicalVolume()->GetRegion();
173 // -- preambule: print physical volume and region names...
174 if (world == G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume())
175 G4cout << "\n * Mass Geometry with ";
176 else
177 G4cout << "\n * Parallel Geometry with ";
178 G4cout << "world volume: `" << world->GetName() << "' [region : `" << worldRegion->GetName() << "']" << G4endl;
179 // -- ... and print G4FSMP(s) attached to this world volume:
180 G4bool findG4FSMP(false);
181 // -- show to what particles this G4FSMP is attached to:
182 std::vector<G4ParticleDefinition*> particlesKnown;
183 for (size_t ip=0; ip<fFSMPVector.size(); ip++)
184 if (fFSMPVector[ip]->GetWorldVolume() == world)
185 {
186 G4cout << " o G4FastSimulationProcess: '" << fFSMPVector[ip]->GetProcessName() << "'" << G4endl;
187 G4cout << " Attached to:";
189 for (G4int iParticle=0; iParticle<particles->entries(); iParticle++)
190 {
191 G4ParticleDefinition* particle = particles->GetParticle(iParticle);
192 G4ProcessVector* processes = particle->GetProcessManager()->GetProcessList();
193 if (processes->contains(fFSMPVector[ip])) {G4cout << " " << particle->GetParticleName(); findG4FSMP = true; particlesKnown.push_back(particle);}
194 }
195 G4cout << G4endl;
196 }
197 if (!findG4FSMP) G4cout << " o G4FastSimulationProcess: (none)" << G4endl;
198 // -- now display the regions in this world volume, with mother<->daughter link shown by indentation:
199 G4cout << " o Region(s) and model(s) setup:" << G4endl;
200 DisplayRegion(worldRegion, 1, particlesKnown);
201 }
202 }
203}
G4Region * GetRegion() const
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4int entries() const
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetParticle(G4int index)
G4ProcessVector * GetProcessList() const
G4bool contains(G4VProcess *aProcess) const
static G4RegionStore * GetInstance()
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const

Referenced by G4FastSimulationMessenger::SetNewValue().


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