00001 /* BDSIM code. Version 1.0 00002 Author: Grahame A. Blair, Royal Holloway, Univ. of London. 00003 */ 00004 00005 #ifndef myQUADSTEPPER_HH 00006 #define myQUADSTEPPER_HH 00007 #include "globals.hh" 00008 #include "G4MagIntegratorStepper.hh" 00009 #include "G4Mag_EqRhs.hh" 00010 #include "G4ThreeVector.hh" 00011 #include "G4Navigator.hh" 00012 00013 class myQuadStepper : public G4MagIntegratorStepper 00014 { 00015 00016 public: // with description 00017 00018 myQuadStepper(G4Mag_EqRhs *EqRhs); 00019 00020 ~myQuadStepper(); 00021 00022 virtual void Stepper( const G4double y[], 00023 const G4double dydx[], 00024 const G4double h, 00025 G4double yout[], 00026 G4double yerr[] ); 00027 00028 virtual G4double DistChord() const; 00029 // Estimate maximum distance of curved solution and chord ... 00030 00031 void SetBGrad(G4double aBfield); 00032 void SetBField(G4double aBfield); 00033 void SetLength(G4double aLength); 00034 void SetAngle(G4double aAngle); 00035 G4double GetBGrad(); 00036 00037 void StepperName(); 00038 00039 public: // without description 00040 00041 virtual G4int IntegratorOrder()const { return 2; } 00042 G4double itsLength; 00043 G4double itsAngle; 00044 protected: 00045 // --- Methods used to implement all the derived classes ----- 00046 00047 void AdvanceHelix( const G4double yIn[], 00048 G4ThreeVector Bfld, 00049 G4double h, 00050 G4double yQuad[]); // 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 G4Mag_EqRhs* fPtrMagEqOfMot; 00059 00060 G4double itsBGrad; 00061 G4double itsBField; 00062 00063 G4double itsDist; 00064 00065 }; 00066 00067 inline void myQuadStepper::SetBGrad(G4double aBGrad) 00068 { 00069 itsBGrad=aBGrad; 00070 } 00071 00072 inline void myQuadStepper::SetBField(G4double aBField) 00073 { 00074 itsBField=aBField; 00075 } 00076 inline void myQuadStepper::SetLength(G4double aLength) 00077 { 00078 itsLength=aLength; 00079 } 00080 inline void myQuadStepper::SetAngle(G4double aAngle) 00081 { 00082 itsAngle=aAngle; 00083 } 00084 00085 inline G4double myQuadStepper::GetBGrad() 00086 { 00087 return itsBGrad; 00088 } 00089 00090 inline void myQuadStepper::StepperName() 00091 {G4cout<<"myQuadStepper"<<G4endl;} 00092 00093 #endif