Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: G4ErrorPropagatorManager.hh,v 1.2 2007/05/29 14:41:35 gcosmo Exp $ >> 28 // GEANT4 tag $Name: geant4-09-02-patch-04 $ 27 // 29 // 28 // Class Description: 30 // Class Description: 29 // 31 // 30 // This is the class manager of the GEANT4e pa 32 // This is the class manager of the GEANT4e package. 31 // It is the main interface for the user to de 33 // It is the main interface for the user to define the setup and 32 // start the propagation. Initializes GEANT4 f 34 // start the propagation. Initializes GEANT4 for the propagation. 33 35 34 // History: 36 // History: 35 // - Created: Pedro Arce, February 2001 37 // - Created: Pedro Arce, February 2001 36 // ------------------------------------------- 38 // -------------------------------------------------------------------- 37 39 38 #ifndef G4ErrorPropagatorManager_hh 40 #ifndef G4ErrorPropagatorManager_hh 39 #define G4ErrorPropagatorManager_hh 41 #define G4ErrorPropagatorManager_hh 40 42 41 #include "globals.hh" 43 #include "globals.hh" 42 #include "G4ErrorPropagatorData.hh" 44 #include "G4ErrorPropagatorData.hh" 43 #include "G4ErrorPropagator.hh" 45 #include "G4ErrorPropagator.hh" 44 #include "G4ApplicationState.hh" 46 #include "G4ApplicationState.hh" 45 47 46 class G4ErrorPropagationNavigator; 48 class G4ErrorPropagationNavigator; 47 class G4ErrorRunManagerHelper; 49 class G4ErrorRunManagerHelper; 48 class G4ErrorTarget; 50 class G4ErrorTarget; 49 class G4ErrorTrajState; 51 class G4ErrorTrajState; 50 52 51 class G4VUserDetectorConstruction; 53 class G4VUserDetectorConstruction; 52 class G4VPhysicalVolume; 54 class G4VPhysicalVolume; 53 class G4VUserPhysicsList; 55 class G4VUserPhysicsList; 54 class G4UserRunAction; 56 class G4UserRunAction; 55 class G4UserEventAction; 57 class G4UserEventAction; 56 class G4UserStackingAction; 58 class G4UserStackingAction; 57 class G4UserTrackingAction; 59 class G4UserTrackingAction; 58 class G4UserSteppingAction; 60 class G4UserSteppingAction; 59 class G4Mag_UsualEqRhs; 61 class G4Mag_UsualEqRhs; 60 class G4Track; 62 class G4Track; 61 63 62 class G4ErrorPropagatorManager 64 class G4ErrorPropagatorManager 63 { 65 { >> 66 64 public: // with description 67 public: // with description >> 68 65 G4ErrorPropagatorManager(); 69 G4ErrorPropagatorManager(); 66 // Initialise data to 0. Starts the G4ErrorR << 70 // Initialise data to 0. Starts the G4ErrorRunManagerHelper and 67 // G4ErrorPropagationNavigator. << 71 // G4ErrorPropagationNavigator. 68 72 69 ~G4ErrorPropagatorManager(); 73 ~G4ErrorPropagatorManager(); 70 74 71 static G4ErrorPropagatorManager* GetErrorPro 75 static G4ErrorPropagatorManager* GetErrorPropagatorManager(); 72 // Get only instance of G4ErrorPropagatorMan << 76 // Get only instance of G4ErrorPropagatorManager. If it does not exists, 73 // creates it << 77 // creates it 74 78 75 void EventTermination(); 79 void EventTermination(); 76 // Set state to G4ErrorState_Init << 80 // Set state to G4ErrorState_Init 77 81 78 void RunTermination(); 82 void RunTermination(); 79 // Set state to G4ErrorState_Init and invoke << 83 // Set state to G4ErrorState_Init and invoke 80 // G4ErrorRunManagerHelper::RunTermination() << 84 // G4ErrorRunManagerHelper::RunTermination() 81 85 82 void InitGeant4e(); 86 void InitGeant4e(); 83 // Initializes Geant4 and Geant4e << 87 // Initializes Geant4 and Geant4e 84 88 85 void InitTrackPropagation(); 89 void InitTrackPropagation(); 86 // Set the propagator step number to 0 and t << 90 // Set the propagator step number to 0 and the G4ErrorState to Propagating 87 << 91 88 G4bool InitFieldForBackwards(); 92 G4bool InitFieldForBackwards(); 89 // Creates the G4ErrorMag_UsualEqRhs, that w << 93 // Creates the G4ErrorMag_UsualEqRhs, that will control backwards tracking 90 94 91 G4int Propagate(G4ErrorTrajState* currentTS, << 95 G4int Propagate( G4ErrorTrajState* currentTS, const G4ErrorTarget* target, G4ErrorMode mode = G4ErrorMode_PropForwards ); 92 G4ErrorMode mode = G4ErrorMo << 96 // Inits track propagation, invokes G4ErrorPropagator::Propagate and 93 // Inits track propagation, invokes G4ErrorP << 97 // terminates "event" 94 // terminates "event" << 98 95 << 99 G4int PropagateOneStep( G4ErrorTrajState* currentTS, 96 G4int PropagateOneStep(G4ErrorTrajState* cur << 100 G4ErrorMode mode = G4ErrorMode_PropForwards ); 97 G4ErrorMode mode = G4 << 101 // Invokes G4ErrorPropagator::PropagateOneStep 98 // Invokes G4ErrorPropagator::PropagateOneSt << 99 102 100 G4bool CloseGeometry(); 103 G4bool CloseGeometry(); 101 // Close Geant4 geometry << 104 // Close Geant4 geometry 102 105 103 void SetUserInitialization(G4VUserDetectorCo 106 void SetUserInitialization(G4VUserDetectorConstruction* userInit); 104 // Invokes G4ErrorRunManagerHelper to constr << 107 // Invokes G4ErrorRunManagerHelper to construct detector and set 105 // world volume << 108 // world volume 106 void SetUserInitialization(G4VPhysicalVolume 109 void SetUserInitialization(G4VPhysicalVolume* userInit); 107 // Invokes G4ErrorRunManagerHelper to set w << 110 // Invokes G4ErrorRunManagerHelper to set world volume 108 void SetUserInitialization(G4VUserPhysicsLis 111 void SetUserInitialization(G4VUserPhysicsList* userInit); 109 // Invokes G4ErrorRunManagerHelper to initia << 112 // Invokes G4ErrorRunManagerHelper to initialize physics 110 113 111 void SetUserAction(G4UserTrackingAction* use 114 void SetUserAction(G4UserTrackingAction* userAction); 112 // Invokes G4EventManager to set a G4UserTra << 115 // Invokes G4EventManager to set a G4UserTrackingAction 113 void SetUserAction(G4UserSteppingAction* use 116 void SetUserAction(G4UserSteppingAction* userAction); 114 // Invokes G4EventManager to set a G4UserSte << 117 // Invokes G4EventManager to set a G4UserSteppingAction 115 118 116 G4String PrintG4ErrorState(); 119 G4String PrintG4ErrorState(); 117 G4String PrintG4ErrorState(G4ErrorState stat << 120 G4String PrintG4ErrorState( G4ErrorState state ); 118 // Print Geant4e state << 121 // Print Geant4e state 119 122 120 G4String PrintG4State(); 123 G4String PrintG4State(); 121 G4String PrintG4State(G4ApplicationState sta << 124 G4String PrintG4State( G4ApplicationState state ); 122 // Print Geant4 state << 125 // Print Geant4 state 123 << 126 124 // Set and Get methods << 127 // Set and Get methods 125 128 126 G4ErrorRunManagerHelper* GetErrorRunManagerH 129 G4ErrorRunManagerHelper* GetErrorRunManagerHelper() const 127 { << 130 { return theG4ErrorRunManagerHelper; } 128 return theG4ErrorRunManagerHelper; << 129 } << 130 131 131 void SetSteppingManagerVerboseLevel(); 132 void SetSteppingManagerVerboseLevel(); 132 133 133 G4ErrorPropagationNavigator* GetErrorPropaga 134 G4ErrorPropagationNavigator* GetErrorPropagationNavigator() const 134 { << 135 { return theG4ErrorPropagationNavigator; } 135 return theG4ErrorPropagationNavigator; << 136 } << 137 136 138 G4ErrorPropagator* GetPropagator() const { r << 137 G4ErrorPropagator* GetPropagator() const >> 138 { return thePropagator; } 139 139 140 private: 140 private: 141 void StartG4ErrorRunManagerHelper(); << 142 // Create a G4ErrorRunManagerHelper if it do << 143 // the G4ErrorPhysicsList << 144 141 >> 142 void StartG4ErrorRunManagerHelper(); >> 143 // Create a G4ErrorRunManagerHelper if it does not exist and set to it >> 144 // the G4ErrorPhysicsList >> 145 145 void StartNavigator(); 146 void StartNavigator(); 146 // create a G4ErrorPropagationNavigator << 147 // create a G4ErrorPropagationNavigator 147 << 148 148 private: 149 private: 149 static G4ThreadLocal G4ErrorPropagatorManage << 150 >> 151 static G4ErrorPropagatorManager* theG4ErrorPropagatorManager; 150 152 151 G4ErrorRunManagerHelper* theG4ErrorRunManage 153 G4ErrorRunManagerHelper* theG4ErrorRunManagerHelper; 152 154 153 G4ErrorPropagator* thePropagator; 155 G4ErrorPropagator* thePropagator; 154 156 155 G4Mag_UsualEqRhs* theEquationOfMotion; 157 G4Mag_UsualEqRhs* theEquationOfMotion; 156 158 157 G4ErrorPropagationNavigator* theG4ErrorPropa 159 G4ErrorPropagationNavigator* theG4ErrorPropagationNavigator; >> 160 158 }; 161 }; 159 162 160 #endif 163 #endif 161 164