Geant4  10.00.p02
G4GlobalFastSimulationManager.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4GlobalFastSimulationManager.hh 68056 2013-03-13 14:44:48Z gcosmo $
28 //
29 //
30 //---------------------------------------------------------------
31 //
32 // G4GlobalFastSimulationManager.hh
33 //
34 // Description:
35 // A singleton class which manages the Fast Simulation managers
36 // attached to envelopes.
37 //
38 // History:
39 // June 98: Verderi && MoraDeFreitas - "G4ParallelWorld" becomes
40 // "G4FlavoredParallelWorld"; some method name changes;
41 // GetFlavoredWorldForThis now returns a
42 // G4FlavoredParallelWorld pointer.
43 // Feb 98: Verderi && MoraDeFreitas - First Implementation.
44 //
45 //---------------------------------------------------------------
46 
47 #ifndef G4GlobalFastSimulationManager_hh
48 #define G4GlobalFastSimulationManager_hh
49 
50 #include "globals.hh"
52 
56 
57 
59 
60 enum listType {
64 };
65 
66 
67 // Class Description:
68 // This a singleton class which provides the management of the G4FastSimulationManager
69 // objects and some ghost facilities.
70 //
71 // You can get access to it by:
72 //
73 // #include "G4GlobalFastSimulationManager.hh"
74 // ...
75 // ...
76 // G4GlobalFastSimulationManager* globalFSM;
77 // globalFSM = G4GlobalFastSimulationManager::getGlobalFastSimulationManager();
78 // ...
79 // ...
80 //
81 // Presently, you will mainly need to use the GlobalFastSimulationManager if you use ghost
82 // geometries.
83 //
84 
86 {
87 
88 public: // With description
89 
91  // Provides a global access to the GlobalFastSimulationManager
93  // Same as GetGlobalFastSimulationManager()
94 
96  const G4VFastSimulationModel* previousFound = 0) const;
97  // Iterative fetch of G4VFastSimulationModel objects by name:
98  // o returns the G4VFastSimulationModel* of model with name modelName;
99  // o returns 0 if no model found;
100  // o usage:
101  // myModel = gblManager->GetFastSimulationModel("MyModel");
102  // o note for the case of several models having the same name:
103  // - to get the first "MyModel" model:
104  // myModel1 = gblManager->GetFastSimulationModel("MyModel", 0);
105  // - to get the next one:
106  // myModel2 = gblManager->GetFastSimulationModel("MyModel", myModel1);
107  // - and so on.
108  // - When gblManager->GetFastSimulationModel("MyModel", myModel_n)
109  // returns a null pointer, no extra model with name "MyModel" exist.
110 
111 
112 public: // Without description
113 
114  // Destructor
116 
117  //
118  // G4FastSimulationManager(Process)'s management, no intended for general use.
119  //
120  // Methods for a G4FastSimulationManager to register itself
121  //
124  //
125  // G4FastSimulationManagerProcess bookeeping:
126  //
129 
130 
131  // Flag that the Parameterisation must be closed.
133 
134 
135 public: // With description
136  void ShowSetup();
137  // Show the fast simulation setup : world(s), region(s), model(s) and links between them.
138  // Requires the geometry to be closed.
139 
140 
141 public: // Without description
142 
143  void ListEnvelopes(const G4String& aName = "all",
144  listType aListType = NAMES_ONLY);
145  void ListEnvelopes(const G4ParticleDefinition* );
146 
149 
150 
151 
152 private:
153  // Private construtor insures singleton class
155 
156  // recursive display of regions, models, etc...
157  void DisplayRegion(G4Region* motherRegion, G4int depth, std::vector<G4ParticleDefinition*>& particles) const;
158 
159  // The single instance.
164 };
165 
166 #endif
167 // end of #ifndef G4GlobalFastSimulationManager_hh
void RemoveFSMP(G4FastSimulationManagerProcess *)
G4FastSimulationVector< G4FastSimulationManagerProcess > fFSMPVector
G4FastSimulationMessenger * fTheFastSimulationMessenger
void InActivateFastSimulationModel(const G4String &)
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound=0) const
void ListEnvelopes(const G4String &aName="all", listType aListType=NAMES_ONLY)
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()
G4FastSimulationVector< G4FastSimulationManager > ManagedManagers
void RemoveFastSimulationManager(G4FastSimulationManager *)
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
static G4ThreadLocal G4GlobalFastSimulationManager * fGlobalFastSimulationManager
static G4GlobalFastSimulationManager * GetInstance()
void DisplayRegion(G4Region *motherRegion, G4int depth, std::vector< G4ParticleDefinition * > &particles) const
void AddFastSimulationManager(G4FastSimulationManager *)
void AddFSMP(G4FastSimulationManagerProcess *)