00001 /* BDSIM code. Version 1.0 00002 Author: Grahame A. Blair, Royal Holloway, Univ. of London. 00003 Last modified 24.7.2002 00004 Copyright (c) 2002 by G.A.Blair. ALL RIGHTS RESERVED. 00005 */ 00006 00007 // 00008 // class BDSSextStepper 00009 // 00010 // Class description: 00011 // stepper for pure sextupole magnetic field 00012 00013 // History: 00014 // - Created. G.Blair 1/11/00 00015 00016 #ifndef BDSSEXTSTEPPER_HH 00017 #define BDSSEXTSTEPPER_HH 00018 #include "globals.hh" 00019 #include "G4MagIntegratorStepper.hh" 00020 #include "G4Mag_EqRhs.hh" 00021 #include "G4ThreeVector.hh" 00022 00023 class BDSSextStepper : public G4MagIntegratorStepper 00024 { 00025 00026 public: // with description 00027 00028 BDSSextStepper(G4Mag_EqRhs *EqRhs); 00029 00030 ~BDSSextStepper(); 00031 00032 void Stepper( const G4double y[], 00033 const G4double dydx[], 00034 const G4double h, 00035 G4double yout[], 00036 G4double yerr[] ); 00037 // The stepper for the Runge Kutta integration. 00038 // The stepsize is fixed, equal to h. 00039 // Integrates ODE starting values y[0 to 6] 00040 // Outputs yout[] and its estimated error yerr[]. 00041 00042 G4double DistChord() const; 00043 // Estimate maximum distance of curved solution and chord ... 00044 00045 void SetBDblPrime(G4double aBDblPrime); 00046 G4double GetBDblPrime(); 00047 00048 void StepperName(); 00049 00050 public: // without description 00051 00052 G4int IntegratorOrder()const { return 2; } 00053 00054 protected: 00055 // --- Methods used to implement all the derived classes ----- 00056 00057 void AdvanceHelix( const G4double yIn[], 00058 G4ThreeVector Bfld, 00059 G4double h, 00060 G4double ySext[]); // output 00061 // A first order Step along a sext inside the field. 00062 00063 private: 00064 00065 G4Mag_EqRhs* fPtrMagEqOfMot; 00066 00067 G4double itsBDblPrime; 00068 00069 G4ThreeVector yInitial, yMidPoint, yFinal; 00070 // Data stored in order to find the chord. 00071 00072 G4double itsDist; 00073 00074 }; 00075 00076 inline void BDSSextStepper::SetBDblPrime(G4double aBDblPrime) 00077 {itsBDblPrime=aBDblPrime; 00078 } 00079 00080 inline G4double BDSSextStepper::GetBDblPrime() 00081 {return itsBDblPrime;} 00082 00083 inline void BDSSextStepper::StepperName() 00084 {G4cout<<"BDSSextStepper"<<G4endl;} 00085 00086 #endif /* BDSSEXTSTEPPER_HH */