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