Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // >> 23 // >> 24 // $Id: G4TransportationManager.hh,v 1.2 2003/11/03 17:15:21 gcosmo Exp $ >> 25 // GEANT4 tag $Name: geant4-08-00 $ >> 26 // 26 // class G4TransportationManager 27 // class G4TransportationManager 27 // 28 // 28 // Class description: 29 // Class description: 29 // 30 // 30 // A singleton class which stores the (volume) 31 // A singleton class which stores the (volume) navigator used by 31 // the transportation process to do the geomet 32 // the transportation process to do the geometrical tracking. 32 // It also stores a pointer to the propagator 33 // It also stores a pointer to the propagator used in a (magnetic) 33 // field and to the field manager. 34 // field and to the field manager. 34 // The class instance is created before main() 35 // The class instance is created before main() is called, and 35 // in turn creates the navigator and the rest. 36 // in turn creates the navigator and the rest. 36 37 37 // Created: 10 March 1997, J. Apostolakis 38 // Created: 10 March 1997, J. Apostolakis 38 // Reviewed: 26 April 2006, G. Cosmo << 39 // ------------------------------------------- 39 // -------------------------------------------------------------------- >> 40 40 #ifndef G4TransportationManager_hh 41 #ifndef G4TransportationManager_hh 41 #define G4TransportationManager_hh 42 #define G4TransportationManager_hh 42 43 43 #include "G4Navigator.hh" 44 #include "G4Navigator.hh" 44 #include "G4SafetyHelper.hh" << 45 << 46 #include <vector> << 47 45 48 class G4PropagatorInField; 46 class G4PropagatorInField; 49 class G4GeometryMessenger; 47 class G4GeometryMessenger; 50 class G4FieldManager; 48 class G4FieldManager; 51 class G4VPhysicalVolume; << 52 49 53 class G4TransportationManager 50 class G4TransportationManager 54 { 51 { 55 public: // with description 52 public: // with description 56 53 57 static G4TransportationManager* GetTransp 54 static G4TransportationManager* GetTransportationManager(); 58 // Retrieve the static instance << 59 static G4TransportationManager* GetInstan << 60 // Retrieve singleton instance pointer. << 61 << 62 inline G4PropagatorInField* GetPropagator << 63 inline void SetPropagatorInField(G4Propag << 64 inline G4FieldManager* GetFieldManager() << 65 void SetFieldManager( G4FieldManager* new << 66 // Accessors for field handling << 67 55 68 inline G4Navigator* GetNavigatorForTracki << 56 inline G4Navigator* GetNavigatorForTracking() const; 69 void SetNavigatorForTracking( G4Navigator << 57 inline G4PropagatorInField* GetPropagatorInField() const; 70 // Accessors for the navigator for trac << 58 inline G4FieldManager* GetFieldManager() const; 71 << 59 72 inline void SetWorldForTracking(G4VPhysic << 60 inline void SetNavigatorForTracking( G4Navigator* newNavigator ); 73 // Set the world volume for tracking << 61 inline void SetPropagatorInField( G4PropagatorInField* newFieldPropagator ); 74 // This method is to be invoked by G4Ru << 62 void SetFieldManager( G4FieldManager* newFieldManager ); 75 << 76 inline std::size_t GetNoActiveNavigators( << 77 inline std::vector<G4Navigator*>::iterato << 78 // Return an iterator to the list of ac << 79 << 80 inline std::size_t GetNoWorlds() const; << 81 inline std::vector<G4VPhysicalVolume*>::i << 82 // Return an iterator to the list of re << 83 << 84 inline G4SafetyHelper* GetSafetyHelper() << 85 // Return the pointer to the navigation << 86 << 87 G4VPhysicalVolume* GetParallelWorld ( con << 88 // Return an exact copy of the tracking << 89 // existing just return the pointer << 90 << 91 G4VPhysicalVolume* IsWorldExisting ( cons << 92 // Verify existance or not of an istanc << 93 // same name in the collection << 94 << 95 G4Navigator* GetNavigator ( const G4Strin << 96 G4Navigator* GetNavigator ( G4VPhysicalVo << 97 // Return a navigator associated to eit << 98 // or the pointer to world physical vol << 99 // create it and register it in the col << 100 << 101 G4bool RegisterWorld( G4VPhysicalVolume* << 102 void DeRegisterNavigator( G4Navigator* aN << 103 G4int ActivateNavigator( G4Navigator* aN << 104 void DeActivateNavigator( G4Navigator* aN << 105 void InactivateAll(); << 106 // Methods for handling navigators. Nav << 107 // first, i.e. position 0 in the collec << 108 << 109 static G4Navigator* GetFirstTrackingNavig << 110 static void SetFirstTrackingNavigator(G4N << 111 // Retrieve/set first navigator pointer << 112 // << 113 // It will be used as a template for cl << 114 // navigator of additional threads. << 115 << 116 public: // without description << 117 << 118 void ClearParallelWorlds(); << 119 // Clear collection of navigators and d << 120 // associated with parallel worlds. Int << 121 // by the RunManager when the entire ge << 122 63 123 ~G4TransportationManager(); 64 ~G4TransportationManager(); 124 // Destructor << 125 65 126 protected: 66 protected: 127 67 128 G4TransportationManager(); << 68 G4TransportationManager(); 129 // Singleton. Protected constructor << 69 130 << 131 private: << 132 << 133 void ClearNavigators(); << 134 // Clear collection of navigators and d << 135 void DeRegisterWorld( G4VPhysicalVolume* << 136 // Register/de-register an already allo << 137 // The pointed object is not deleted. << 138 << 139 private: 70 private: 140 71 141 std::vector<G4Navigator*> fNavigators; << 72 G4Navigator* fNavigatorForTracking ; 142 // The collection of all navigators reg << 73 G4PropagatorInField* fPropagatorInField; 143 std::vector<G4Navigator*> fActiveNavigato << 74 G4FieldManager* fFieldManager; 144 // The collection of only active naviga << 75 G4GeometryMessenger* fGeomMessenger; 145 std::vector<G4VPhysicalVolume*> fWorlds; << 146 // The collection of worlds associated << 147 << 148 G4PropagatorInField* fPropagatorInField; << 149 G4FieldManager* fFieldManager; << 150 G4GeometryMessenger* fGeomMessenger; << 151 G4SafetyHelper* fSafetyHelper; << 152 << 153 static G4ThreadLocal G4TransportationMana << 154 << 155 static G4Navigator* fFirstTrackingNavigat << 156 << 157 public: << 158 76 159 static constexpr G4int kMassNavigatorId = << 77 static G4TransportationManager* fTransportationManager; 160 }; 78 }; 161 79 162 #include "G4TransportationManager.icc" 80 #include "G4TransportationManager.icc" 163 81 164 #endif 82 #endif 165 83