00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4ErrorPropagator.hh 69766 2013-05-14 14:33:55Z gcosmo $ 00028 // 00029 // 00030 // Class Description: 00031 // 00032 // Manages the propagation of tracks. Creates a G4Track, asks to 00033 // propagate it and takes also care to propagate the errors. 00034 // Stops the track when GEANT4 stops it or a G4ErrorTarget is reached. 00035 00036 // History: 00037 // - Created: P. Arce 00038 // -------------------------------------------------------------------- 00039 00040 #ifndef G4ErrorPropagator_hh 00041 #define G4ErrorPropagator_hh 00042 00043 #include "globals.hh" 00044 #include "G4ErrorPropagatorData.hh" 00045 #include "G4SteppingManager.hh" 00046 00047 class G4eErrorMatrix; 00048 class G4Track; 00049 class G4ErrorTrajState; 00050 class G4ErrorFreeTrajState; 00051 class G4ErrorTarget; 00052 #include "globals.hh" 00053 00054 class G4ErrorPropagator 00055 { 00056 public: // with description 00057 00058 G4ErrorPropagator(); 00059 ~G4ErrorPropagator(){} 00060 00061 G4Track* InitG4Track( G4ErrorTrajState& initialTS ); 00062 // Creates a G4Track from a G4ErrorTrajState 00063 00064 G4int Propagate( G4ErrorTrajState* currentTS, 00065 const G4ErrorTarget* target, 00066 G4ErrorMode mode = G4ErrorMode_PropForwards); 00067 // Steers the GEANT4 propagation of a track: 00068 // the particle will be extrapolated until the Target is reached. 00069 // The final G4Track parameters will be passed to theFinalTrajState 00070 00071 G4int PropagateOneStep( G4ErrorTrajState* currentTS ); 00072 // Propagates a G4Track by one step, and then returns control to the user 00073 00074 G4int MakeOneStep( G4ErrorFreeTrajState* currentTS_FREE ); 00075 // Advance one step 00076 00077 G4ErrorFreeTrajState* InitFreeTrajState( G4ErrorTrajState* currentTS ); 00078 // Creates theCurrentTS_FREE (transforms the user G4ErrorSurfaceTrajState 00079 // or copies the G4ErrorFreeTrajState) 00080 00081 void GetFinalTrajState( G4ErrorTrajState* currentTS, G4ErrorFreeTrajState* currentTS_FREE, const G4ErrorTarget* target ); 00082 // After steps are done, convert the G4ErrorFreeTrajState used for error 00083 // propagation to the class of origin (G4ErrorFreeTrajState or 00084 // G4eTrajStatOnSurface) 00085 00086 void InvokePreUserTrackingAction( G4Track* fpTrack ); 00087 // Invoke the G4UserTrackingAction::PreUserTrackingAction 00088 void InvokePostUserTrackingAction( G4Track* fpTrack ); 00089 // Invoke the G4UserTrackingAction::PostUserTrackingAction 00090 00091 G4bool CheckIfLastStep( G4Track* aTrack ); 00092 // Check if it is the last step for error propagation: 00093 // - G4ErrorState is G4ErrorState_StoppedAtTarget 00094 // - Track is OutOfWorld 00095 // - G4TrackStatus is fStopAndKill 00096 00097 // Get and Set methods 00098 00099 const G4ErrorTrajState* GetInitialTrajState() const 00100 { return theInitialTrajState; } 00101 00102 G4double GetStepLength() const 00103 { return theStepLength; } 00104 00105 void SetStepLength( const G4double sl ) 00106 { theStepLength = sl; } 00107 00108 void SetStepN( const G4int sn ) 00109 { theStepN = sn; } 00110 00111 private: 00112 00113 G4int MakeSteps( G4ErrorFreeTrajState* currentTS_FREE ); 00114 // Advance steps until target is reached 00115 00116 private: 00117 00118 G4double theStepLength; 00119 00120 G4ErrorTrajState* theInitialTrajState; 00121 00122 G4int theStepN; 00123 00124 G4Track* theG4Track; 00125 00126 G4SteppingManager* fpSteppingManager; 00127 00128 G4int verbose; 00129 00130 G4bool thePropIsInitialized; 00131 00132 }; 00133 00134 #endif