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 // class G4HelixMixedStepper 00027 // 00028 // Class description: 00029 // 00030 // G4HelixMixedStepper split the Method used for Integration in two: 00031 // 00032 // If Stepping Angle ( h / R_curve) < pi/3 : use Stepper for small step 00033 // 00034 // Else use HelixExplicitEuler Stepper 00035 // 00036 // Stepper for the small step is G4ClassicalRK4 by default, but 00037 // it possible to choose other stepper,like G4CashKarpRK45 or G4RKG3_Stepper, 00038 // by setting StepperNumber : new HelixMixedStepper(EqRhs,N) 00039 // 00040 // N=0 G4ExplicitEuler; N=1 G4ImplicitEuler; 00041 // N=2 G4SimpleRunge; N=3 G4SimpleHeum; 00042 // N=4 G4ClassicalRK4; N=5 G4HelixExplicitEuler; 00043 // N=6 G4HelixExplicitEuler; N=7 G4HelixSimpleRunge; 00044 // N=8 G4CashKarpRK45; N=9 G4ExactHelixStepper; 00045 // N=10 G4RKG3_Stepper; 00046 // 00047 // History: 00048 // Derived from ExactHelicalStepper 18/05/07 00049 // 00050 // ------------------------------------------------------------------- 00051 00052 #ifndef G4HELIXMIXEDSTEPPER_HH 00053 #define G4HELIXMIXEDSTEPPER_HH 00054 00055 #include "G4MagHelicalStepper.hh" 00056 00057 00058 class G4HelixMixedStepper: public G4MagHelicalStepper 00059 { 00060 00061 public: 00062 00063 G4HelixMixedStepper(G4Mag_EqRhs *EqRhs,G4int fStepperNumber=0); 00064 ~G4HelixMixedStepper(); 00065 00066 void Stepper( const G4double y[], 00067 const G4double dydx[], 00068 G4double h, 00069 G4double yout[], 00070 G4double yerr[] ); 00071 // Step 'integration' for step size 'h' 00072 // If SteppingAngle=h/R_curve<pi/3 uses RK4Stepper 00073 // Else Helix Fast Method 00074 00075 00076 void DumbStepper( const G4double y[], 00077 G4ThreeVector Bfld, 00078 G4double h, 00079 G4double yout[]); 00080 G4double DistChord() const; 00081 // Estimate maximum distance of curved solution and chord ... 00082 00083 00084 public: // with description 00085 00086 inline void SetVerbose (G4int newvalue){fVerbose=newvalue;} 00087 00088 public: // without description 00089 void PrintCalls(); 00090 G4MagIntegratorStepper* SetupStepper(G4Mag_EqRhs* EqRhs, G4int StepperName); 00091 00092 00093 G4int IntegratorOrder() const { return 4; } 00094 private: 00095 // Mixed Integration RK4 for 'small' steps 00096 G4MagIntegratorStepper* fRK4Stepper; 00097 00098 private: 00099 // Used for statistic = how many calls to different steppers 00100 G4int fVerbose; 00101 G4int fNumCallsRK4; 00102 G4int fNumCallsHelix; 00103 00104 }; 00105 00106 #endif /* G4HELIXMIXEDSTEPPER_HH */