00001 // This code implementation is the intellectual property of 00002 // the GEANT4 collaboration. 00003 // 00004 // By copying, distributing or modifying the Program (or any work 00005 // based on the Program) you indicate your acceptance of this statement, 00006 // and all its terms. 00007 // 00008 // $Id: BDSSkewSextStepper.hh,v 1.1 2005/01/22 17:05:31 agapov Exp $ 00009 // GEANT4 tag $Name: $ 00010 // 00011 // 00012 // class BDSSkewSextStepper 00013 // 00014 // Class description: 00015 // 00016 00017 // History: 00018 // - Created. G.Blair 1/11/00 00019 00020 #ifndef BDSSKEWSEXTSTEPPER_HH 00021 #define BDSSKEWSEXTSTEPPER_HH 00022 #include "globals.hh" 00023 #include "G4MagIntegratorStepper.hh" 00024 //#include "G4MagHelicalStepper.hh" 00025 #include "G4Mag_EqRhs.hh" 00026 #include "G4ThreeVector.hh" 00027 #include "G4Navigator.hh" 00028 00029 class BDSSkewSextStepper : public G4MagIntegratorStepper 00030 { 00031 00032 public: // with description 00033 00034 BDSSkewSextStepper(G4Mag_EqRhs *EqRhs); 00035 00036 ~BDSSkewSextStepper(); 00037 00038 void Stepper( const G4double y[], 00039 const G4double dydx[], 00040 const G4double h, 00041 G4double yout[], 00042 G4double yerr[] ); 00043 // The stepper for the Runge Kutta integration. 00044 // The stepsize is fixed, equal to h. 00045 // Integrates ODE starting values y[0 to 6] 00046 // Outputs yout[] and its estimated error yerr[]. 00047 00048 G4double DistChord() const; 00049 // Estimate maximum distance of curved solution and chord ... 00050 00051 void SetBDblPrime(G4double aBDblPrime); 00052 G4double GetBDblPrime(); 00053 00054 void StepperName(); 00055 00056 /* 00057 void DumbStepper( const G4double yInput[], 00058 G4ThreeVector Bfld, 00059 G4double hstep, 00060 G4double yOut[]); 00061 00062 */ 00063 public: // without description 00064 00065 G4int IntegratorOrder()const { return 2; } 00066 00067 protected: 00068 // --- Methods used to implement all the derived classes ----- 00069 00070 void AdvanceHelix( const G4double yIn[], 00071 G4ThreeVector Bfld, 00072 G4double h, 00073 G4double ySkewSext[]); // output 00074 // A first order Step along a sext inside the field. 00075 00076 private: 00077 00078 G4ThreeVector yInitial, yMidPoint, yFinal; 00079 // Data stored in order to find the chord. 00080 00081 G4Mag_EqRhs* fPtrMagEqOfMot; 00082 00083 G4double itsBDblPrime; 00084 // G4ThreeVector itsInitialPoint, itsFinalPoint, itsMidPoint,itsDistVec; 00085 G4double itsDist; 00086 00087 }; 00088 00089 inline void BDSSkewSextStepper::SetBDblPrime(G4double aBDblPrime) 00090 {itsBDblPrime=aBDblPrime; 00091 } 00092 inline G4double BDSSkewSextStepper::GetBDblPrime() 00093 {return itsBDblPrime;} 00094 00095 inline void BDSSkewSextStepper::StepperName() 00096 {G4cout<<"BDSSkewSextStepper"<<G4endl;} 00097 00098 #endif /* BDSSKEWSEXTSTEPPER_HH */