/home/cern/BDSIM_new/include/BDSRK4Stepper.hh

00001 
00002 #ifndef BDSRK4Stepper_h
00003 #define BDSRK4Stepper_h 1
00004 
00005 
00006 #include "globals.hh"
00007 #include "G4MagIntegratorStepper.hh"
00008 #include "G4EquationOfMotion.hh"
00009 #include "G4Mag_EqRhs.hh"
00010 #include "G4ThreeVector.hh"
00011 #include "G4Navigator.hh"
00012 
00013 class BDSRK4Stepper : public G4MagIntegratorStepper
00014 {
00015   
00016 public:  
00017   
00018   BDSRK4Stepper(G4EquationOfMotion *EqRhs, int nvar=6);
00019 
00020   
00021   ~BDSRK4Stepper();
00022   
00023   void Stepper( const G4double y[],
00024                 const G4double dydx[],
00025                 const G4double h,
00026                 G4double yout[],
00027                 G4double yerr[]  );
00028   // The stepper for the Runge Kutta integration.
00029   // The stepsize is fixed, equal to h.
00030   // Integrates ODE starting values y[0 to 6]
00031   // Outputs yout[] and its estimated error yerr[].
00032   
00033   G4double DistChord()   const;
00034   // Estimate maximum distance of curved solution and chord ... 
00035   
00036     
00037   void StepperName();
00038   
00039   void SetVolLength(G4double aVolLength);
00040   
00041   
00042   G4int IntegratorOrder()const { return 2; }
00043 
00044   protected:
00045   //  --- Methods used to implement all the derived classes -----
00046   
00047   void AdvanceHelix( const G4double  yIn[],
00048                      const G4double dydx[],
00049                      const G4double  h,
00050                      G4double  yRK[]);    // output 
00051   // A first order Step along a quad inside the field.
00052   
00053 private:
00054   
00055   G4ThreeVector yInitial, yMidPoint, yFinal;
00056   // Data stored in order to find the chord.
00057   
00058     G4EquationOfMotion* itsEqRhs;
00059   //    G4ThreeVector itsInitialPoint, itsFinalPoint, itsMidPoint,itsDistVec;
00060   G4double itsDist;
00061   
00062   G4double itsVolLength;
00063   
00064   G4double *yt, *dydx, *dydxt, *dydxm, *dydxr, *yTemp, *yIn;
00065 
00066 };
00067 
00068 inline  void BDSRK4Stepper::SetVolLength(G4double aVolLength)
00069 {itsVolLength=aVolLength;
00070 }
00071 inline void BDSRK4Stepper::StepperName()
00072 {G4cout<<"BDSRK4Stepper"<<G4endl;}
00073 
00074 #endif

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3