Geant4  10.02.p03
G4GlobalFastSimulationManager Class Reference

#include <G4GlobalFastSimulationManager.hh>

Collaboration diagram for G4GlobalFastSimulationManager:

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 ()
 

Private Member Functions

 G4GlobalFastSimulationManager ()
 
void DisplayRegion (G4Region *motherRegion, G4int depth, std::vector< G4ParticleDefinition *> &particles) const
 

Private Attributes

G4FastSimulationMessengerfTheFastSimulationMessenger
 
G4FastSimulationVector< G4FastSimulationManagerManagedManagers
 
G4FastSimulationVector< G4FastSimulationManagerProcessfFSMPVector
 

Static Private Attributes

static G4ThreadLocal G4GlobalFastSimulationManagerfGlobalFastSimulationManager = 0
 

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 {
100 }
G4FastSimulationMessenger * fTheFastSimulationMessenger
Here is the call graph for this function:

◆ G4GlobalFastSimulationManager()

G4GlobalFastSimulationManager::G4GlobalFastSimulationManager ( )
private

Definition at line 88 of file G4GlobalFastSimulationManager.cc.

Here is the caller graph for this function:

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 }
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ AddFastSimulationManager()

void G4GlobalFastSimulationManager::AddFastSimulationManager ( G4FastSimulationManager fsmanager)

Definition at line 106 of file G4GlobalFastSimulationManager.cc.

107 {
108  ManagedManagers.push_back(fsmanager);
109 }
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddFSMP()

void G4GlobalFastSimulationManager::AddFSMP ( G4FastSimulationManagerProcess fp)

Definition at line 117 of file G4GlobalFastSimulationManager.cc.

118 {
119  fFSMPVector.push_back(fp);
120 }
G4FastSimulationVector< G4FastSimulationManagerProcess > fFSMPVector
Here is the caller graph for this function:

◆ DisplayRegion()

void G4GlobalFastSimulationManager::DisplayRegion ( G4Region motherRegion,
G4int  depth,
std::vector< G4ParticleDefinition *> &  particles 
) const
private

Definition at line 206 of file G4GlobalFastSimulationManager.cc.

207 {
208  G4String indent = " ";
209  for (G4int I=0; I<depth; I++) indent += " ";
210  G4cout << indent << "Region: `" << region->GetName() <<"'" << G4endl;
211  G4FastSimulationManager* fastSimManager = region->GetFastSimulationManager();
212  if (fastSimManager)
213  {
214  indent += " ";
215  G4cout << indent << "Model(s):" << G4endl;
216  indent += " ";
217  for (size_t im=0; im<fastSimManager->GetFastSimulationModelList().size(); im++)
218  {
219  G4cout << indent << "`" << (fastSimManager->GetFastSimulationModelList())[im]->GetName() << "'";
220  G4cout << " ; applicable to:";
222  for (G4int iParticle=0; iParticle<particles->entries(); iParticle++)
223  {
224  if ((fastSimManager->GetFastSimulationModelList())[im]->IsApplicable(*(particles->GetParticle(iParticle))))
225  {
226  G4cout << " " << particles->GetParticle(iParticle)->GetParticleName();
227  G4bool known(false);
228  for (size_t l=0; l<particlesKnown.size();l++) if(particlesKnown[l] == particles->GetParticle(iParticle)) {known = true; break;}
229  if (!known) G4cout << "[!!]";
230  }
231  }
232  G4cout << G4endl;
233  }
234  }
235 
236  // -- all that to check mothership of "region"
238  for (size_t ip=0; ip<physVolStore->size(); ip++)
239  {
240  G4VPhysicalVolume* physVol = (*physVolStore)[ip];
241  if (physVol->GetLogicalVolume()->IsRootRegion())
242  if (physVol->GetMotherLogical())
243  {
244  G4Region* thisVolMotherRegion = physVol->GetMotherLogical()->GetRegion();
245  if (thisVolMotherRegion == region)
246  DisplayRegion(physVol->GetLogicalVolume()->GetRegion(), depth+1, particlesKnown);
247  }
248  }
249 }
int G4int
Definition: G4Types.hh:78
static G4PhysicalVolumeStore * GetInstance()
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4bool IsRootRegion() const
bool G4bool
Definition: G4Types.hh:79
static G4ParticleTable * GetParticleTable()
G4LogicalVolume * GetMotherLogical() const
G4Region * GetRegion() const
#define G4endl
Definition: G4ios.hh:61
void DisplayRegion(G4Region *motherRegion, G4int depth, std::vector< G4ParticleDefinition *> &particles) const
const std::vector< G4VFastSimulationModel * > & GetFastSimulationModelList() const
G4LogicalVolume * GetLogicalVolume() const
G4ParticleDefinition * GetParticle(G4int index) const
G4int entries() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 }
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound=0) const

◆ GetGlobalFastSimulationManager()

G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::GetGlobalFastSimulationManager ( )
static

Definition at line 71 of file G4GlobalFastSimulationManager.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstance()

G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::GetInstance ( void  )
static

Definition at line 80 of file G4GlobalFastSimulationManager.cc.

81 {
83 }
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()
Here is the call graph for this function:

◆ 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 &)
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ ListEnvelopes() [1/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 }
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ ListEnvelopes() [2/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 }
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers

◆ RemoveFastSimulationManager()

void G4GlobalFastSimulationManager::RemoveFastSimulationManager ( G4FastSimulationManager fsmanager)

Definition at line 112 of file G4GlobalFastSimulationManager.cc.

113 {
114  ManagedManagers.remove(fsmanager);
115 }
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
T * remove(const T *)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveFSMP()

void G4GlobalFastSimulationManager::RemoveFSMP ( G4FastSimulationManagerProcess fp)

Definition at line 122 of file G4GlobalFastSimulationManager.cc.

123 {
124  fFSMPVector.remove(fp);
125 }
G4FastSimulationVector< G4FastSimulationManagerProcess > fFSMPVector
T * remove(const T *)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 }
G4FastSimulationVector< G4FastSimulationManagerProcess > fFSMPVector
G4ProcessVector * GetProcessList() const
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
static G4RegionStore * GetInstance()
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4bool contains(G4VProcess *aProcess) const
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
const G4String & GetName() const
static G4ParticleTable * GetParticleTable()
G4Region * GetRegion() const
#define G4endl
Definition: G4ios.hh:61
void DisplayRegion(G4Region *motherRegion, G4int depth, std::vector< G4ParticleDefinition *> &particles) const
G4LogicalVolume * GetLogicalVolume() const
G4ParticleDefinition * GetParticle(G4int index) const
G4int entries() const
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fFSMPVector

G4FastSimulationVector<G4FastSimulationManagerProcess> G4GlobalFastSimulationManager::fFSMPVector
private

Definition at line 163 of file G4GlobalFastSimulationManager.hh.

◆ fGlobalFastSimulationManager

G4ThreadLocal G4GlobalFastSimulationManager * G4GlobalFastSimulationManager::fGlobalFastSimulationManager = 0
staticprivate

Definition at line 160 of file G4GlobalFastSimulationManager.hh.

◆ fTheFastSimulationMessenger

G4FastSimulationMessenger* G4GlobalFastSimulationManager::fTheFastSimulationMessenger
private

Definition at line 161 of file G4GlobalFastSimulationManager.hh.

◆ ManagedManagers

G4FastSimulationVector<G4FastSimulationManager> G4GlobalFastSimulationManager::ManagedManagers
private

Definition at line 162 of file G4GlobalFastSimulationManager.hh.


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