Geant4 11.1.1
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 &)
 
void Flush ()
 

Static Public Member Functions

static G4GlobalFastSimulationManagerGetGlobalFastSimulationManager ()
 
static G4GlobalFastSimulationManagerGetInstance ()
 

Detailed Description

Definition at line 84 of file G4GlobalFastSimulationManager.hh.

Constructor & Destructor Documentation

◆ ~G4GlobalFastSimulationManager()

G4GlobalFastSimulationManager::~G4GlobalFastSimulationManager ( )

Definition at line 95 of file G4GlobalFastSimulationManager.cc.

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

Member Function Documentation

◆ ActivateFastSimulationModel()

void G4GlobalFastSimulationManager::ActivateFastSimulationModel ( const G4String aName)

Definition at line 126 of file G4GlobalFastSimulationManager.cc.

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

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

◆ AddFastSimulationManager()

void G4GlobalFastSimulationManager::AddFastSimulationManager ( G4FastSimulationManager fsmanager)

Definition at line 104 of file G4GlobalFastSimulationManager.cc.

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

◆ AddFSMP()

void G4GlobalFastSimulationManager::AddFSMP ( G4FastSimulationManagerProcess fp)

Definition at line 116 of file G4GlobalFastSimulationManager.cc.

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

Referenced by G4FastSimulationManagerProcess::G4FastSimulationManagerProcess().

◆ FastSimulationNeedsToBeClosed()

void G4GlobalFastSimulationManager::FastSimulationNeedsToBeClosed ( )

◆ Flush()

void G4GlobalFastSimulationManager::Flush ( )

Definition at line 150 of file G4GlobalFastSimulationManager.cc.

151{
152 // loop over all models (that need flushing?) and flush
153 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
154 ManagedManagers[ifsm]->FlushModels();
155}

◆ GetFastSimulationModel()

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

Definition at line 308 of file G4GlobalFastSimulationManager.cc.

310{
311 G4VFastSimulationModel* model = 0;
312 // -- flag used to navigate accross the various managers;
313 bool foundPrevious(false);
314 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
315 {
316 model = ManagedManagers[ifsm]->
317 GetFastSimulationModel(modelName, previousFound, foundPrevious);
318 if (model) break;
319 }
320 return model;
321}
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 79 of file G4GlobalFastSimulationManager.cc.

80{
82}
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()

◆ InActivateFastSimulationModel()

void G4GlobalFastSimulationManager::InActivateFastSimulationModel ( const G4String aName)

Definition at line 139 of file G4GlobalFastSimulationManager.cc.

140{
141 G4bool result = false;
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.";
147 G4cout << G4endl;
148}
void InActivateFastSimulationModel(const G4String &)

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

◆ ListEnvelopes() [1/2]

void G4GlobalFastSimulationManager::ListEnvelopes ( const G4ParticleDefinition aPD)

Definition at line 301 of file G4GlobalFastSimulationManager.cc.

302{
303 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
304 ManagedManagers[ifsm]->ListModels(aPD);
305}

◆ ListEnvelopes() [2/2]

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

Definition at line 265 of file G4GlobalFastSimulationManager.cc.

267{
268 if (theType == ISAPPLICABLE)
269 {
270 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) ManagedManagers[ifsm]->ListModels(aName);
271 return;
272 }
273
274 if(aName == "all")
275 {
276 G4int titled = 0;
277 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
278 {
279 if(theType == NAMES_ONLY)
280 {
281 if(!(titled++))
282 G4cout << "Current Envelopes for Fast Simulation:\n";
283 G4cout << " ";
284 ManagedManagers[ifsm]->ListTitle();
285 G4cout << G4endl;
286 }
287 else ManagedManagers[ifsm]->ListModels();
288 }
289 }
290 else
291 {
292 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
293 if(aName == ManagedManagers[ifsm]-> GetEnvelope()->GetName())
294 {
295 ManagedManagers[ifsm]->ListModels();
296 break;
297 }
298 }
299}
int G4int
Definition: G4Types.hh:85

Referenced by G4FastSimulationMessenger::SetNewValue().

◆ RemoveFastSimulationManager()

void G4GlobalFastSimulationManager::RemoveFastSimulationManager ( G4FastSimulationManager fsmanager)

Definition at line 110 of file G4GlobalFastSimulationManager.cc.

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

◆ RemoveFSMP()

void G4GlobalFastSimulationManager::RemoveFSMP ( G4FastSimulationManagerProcess fp)

Definition at line 121 of file G4GlobalFastSimulationManager.cc.

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

Referenced by G4FastSimulationManagerProcess::~G4FastSimulationManagerProcess().

◆ ShowSetup()

void G4GlobalFastSimulationManager::ShowSetup ( )

Definition at line 160 of file G4GlobalFastSimulationManager.cc.

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