Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4TransportationManager.hh
이 파일의 문서화 페이지로 가기
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: G4TransportationManager.hh 103219 2017-03-22 11:30:15Z gcosmo $
28 //
29 // class G4TransportationManager
30 //
31 // Class description:
32 //
33 // A singleton class which stores the (volume) navigator used by
34 // the transportation process to do the geometrical tracking.
35 // It also stores a pointer to the propagator used in a (magnetic)
36 // field and to the field manager.
37 // The class instance is created before main() is called, and
38 // in turn creates the navigator and the rest.
39 
40 // Created: 10 March 1997, J. Apostolakis
41 // Reviewed: 26 April 2006, G. Cosmo
42 // --------------------------------------------------------------------
43 
44 #ifndef G4TransportationManager_hh
45 #define G4TransportationManager_hh
46 
47 #include "G4Navigator.hh"
48 #include "G4SafetyHelper.hh"
49 
50 #include <vector>
51 
54 class G4FieldManager;
55 class G4VPhysicalVolume;
56 
58 {
59  public: // with description
60 
62  // Retrieve the static instance
64  // Retrieve singleton instance pointer.
65 
67  inline void SetPropagatorInField( G4PropagatorInField* newFieldPropagator );
68  inline G4FieldManager* GetFieldManager() const;
69  void SetFieldManager( G4FieldManager* newFieldManager );
70  // Accessors for field handling
71 
72  inline G4Navigator* GetNavigatorForTracking() const;
73  void SetNavigatorForTracking( G4Navigator* newNavigator );
74  // Accessors for the navigator for tracking
75 
76  inline void SetWorldForTracking(G4VPhysicalVolume* theWorld);
77  // Set the world volume for tracking
78  // This method is to be invoked by G4RunManagerKernel.
79 
80  inline size_t GetNoActiveNavigators() const;
81  inline std::vector<G4Navigator*>::iterator GetActiveNavigatorsIterator();
82  // Return an iterator to the list of active navigators
83 
84  inline size_t GetNoWorlds() const;
85  inline std::vector<G4VPhysicalVolume*>::iterator GetWorldsIterator();
86  // Return an iterator to the list of registered worlds
87 
88  inline G4SafetyHelper* GetSafetyHelper() const;
89  // Return the pointer to the navigation safety helper instance
90 
91  G4VPhysicalVolume* GetParallelWorld ( const G4String& worldName );
92  // Return an exact copy of the tracking world volume. If already
93  // existing just return the pointer
94 
95  G4VPhysicalVolume* IsWorldExisting ( const G4String& worldName );
96  // Verify existance or not of an istance of the world volume with
97  // same name in the collection
98 
99  G4Navigator* GetNavigator ( const G4String& worldName );
101  // Return a navigator associated to either the world volume name
102  // or the pointer to world physical volume. If not existing already
103  // create it and register it in the collection
104 
106  void DeRegisterNavigator( G4Navigator* aNavigator );
107  G4int ActivateNavigator( G4Navigator* aNavigator );
108  void DeActivateNavigator( G4Navigator* aNavigator );
109  void InactivateAll();
110  // Methods for handling navigators. Navigator for tracking is always the
111  // first, i.e. position 0 in the collection and cannot be de-registered
112 
113  public: // without description
114 
115  void ClearParallelWorlds();
116  // Clear collection of navigators and delete allocated objects
117  // associated with parallel worlds. Internal method called only
118  // by the RunManager when the entire geometry is rebuilt from scratch.
119 
121  // Destructor
122 
123  protected:
124 
126  // Singleton. Protected constructor
127 
128  private:
129 
130  void ClearNavigators();
131  // Clear collection of navigators and delete allocated objects
132  void DeRegisterWorld( G4VPhysicalVolume* aWorld );
133  // Register/de-register an already allocated world volume.
134  // The pointed object is not deleted.
135 
136  private:
137 
138  std::vector<G4Navigator*> fNavigators;
139  // The collection of all navigators registered
140  std::vector<G4Navigator*> fActiveNavigators;
141  // The collection of only active navigators
142  std::vector<G4VPhysicalVolume*> fWorlds;
143  // The collection of worlds associated to the registered navigators
144 
149 
151 };
152 
153 #include "G4TransportationManager.icc"
154 
155 #endif
G4SafetyHelper * GetSafetyHelper() const
static G4TransportationManager * GetInstanceIfExist()
std::vector< G4Navigator * >::iterator GetActiveNavigatorsIterator()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
G4Navigator * GetNavigatorForTracking() const
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
#define G4ThreadLocal
Definition: tls.hh:69
G4GeometryMessenger * fGeomMessenger
void SetFieldManager(G4FieldManager *newFieldManager)
void DeRegisterWorld(G4VPhysicalVolume *aWorld)
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
bool G4bool
Definition: G4Types.hh:79
G4FieldManager * GetFieldManager() const
void SetPropagatorInField(G4PropagatorInField *newFieldPropagator)
G4bool RegisterWorld(G4VPhysicalVolume *aWorld)
void SetWorldForTracking(G4VPhysicalVolume *theWorld)
size_t GetNoWorlds() const
std::vector< G4Navigator * > fActiveNavigators
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigator(const G4String &worldName)
int G4int
Definition: G4Types.hh:78
size_t GetNoActiveNavigators() const
G4int ActivateNavigator(G4Navigator *aNavigator)
std::vector< G4VPhysicalVolume * > fWorlds
G4PropagatorInField * fPropagatorInField
G4PropagatorInField * GetPropagatorInField() const
void SetNavigatorForTracking(G4Navigator *newNavigator)
void DeRegisterNavigator(G4Navigator *aNavigator)
void DeActivateNavigator(G4Navigator *aNavigator)
static G4ThreadLocal G4TransportationManager * fTransportationManager
std::vector< G4Navigator * > fNavigators