Geant4 10.7.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 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 ( )

◆ GetFastSimulationModel()

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

Definition at line 302 of file G4GlobalFastSimulationManager.cc.

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

296{
297 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
298 ManagedManagers[ifsm]->ListModels(aPD);
299}

◆ ListEnvelopes() [2/2]

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

Definition at line 259 of file G4GlobalFastSimulationManager.cc.

261{
262 if (theType == ISAPPLICABLE)
263 {
264 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++) ManagedManagers[ifsm]->ListModels(aName);
265 return;
266 }
267
268 if(aName == "all")
269 {
270 G4int titled = 0;
271 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
272 {
273 if(theType == NAMES_ONLY)
274 {
275 if(!(titled++))
276 G4cout << "Current Envelopes for Fast Simulation:\n";
277 G4cout << " ";
278 ManagedManagers[ifsm]->ListTitle();
279 G4cout << G4endl;
280 }
281 else ManagedManagers[ifsm]->ListModels();
282 }
283 }
284 else
285 {
286 for (size_t ifsm=0; ifsm<ManagedManagers.size(); ifsm++)
287 if(aName == ManagedManagers[ifsm]-> GetEnvelope()->GetName())
288 {
289 ManagedManagers[ifsm]->ListModels();
290 break;
291 }
292 }
293}
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 154 of file G4GlobalFastSimulationManager.cc.

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