/home/cern/BDSIM_new/include/BDSHelixStepper.hh

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

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