/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/include/BDSDecStepper.hh

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 BDSDecStepper
00009 //
00010 // Class description:
00011 // stepper for pure decapole magnetic field
00012 
00013 // History:
00014 //
00015 
00016 #ifndef BDSDECSTEPPER_HH
00017 #define BDSDECSTEPPER_HH
00018 #include "globals.hh"
00019 #include "G4MagIntegratorStepper.hh"
00020 #include "G4Mag_EqRhs.hh"
00021 #include "G4ThreeVector.hh"
00022 #include "G4Navigator.hh"
00023 
00024 class BDSDecStepper : public G4MagIntegratorStepper
00025 {
00026 
00027 public:  // with description
00028 
00029   BDSDecStepper(G4Mag_EqRhs *EqRhs);
00030 
00031   ~BDSDecStepper();
00032 
00033   void Stepper( const G4double y[],
00034                 const G4double dydx[],
00035                 const G4double h,
00036                 G4double yout[],
00037                 G4double yerr[]  );
00038   // The stepper for the Runge Kutta integration.
00039   // The stepsize is fixed, equal to h.
00040   // Integrates ODE starting values y[0 to 6]
00041   // Outputs yout[] and its estimated error yerr[].
00042 
00043   G4double DistChord()   const;
00044   // Estimate maximum distance of curved solution and chord ... 
00045  
00046   void SetBQuadPrime(G4double aBQuadPrime);
00047   G4double GetBQuadPrime();
00048 
00049   void StepperName();
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                      G4ThreeVector Bfld,
00060                      G4double  h,
00061                      G4double  yDec[]);    // output 
00062   // A first order Step along a dec inside the field.
00063 
00064 private:
00065   
00066   G4Mag_EqRhs*  fPtrMagEqOfMot;
00067 
00068   G4double itsBQuadPrime;
00069 
00070   G4ThreeVector yInitial, yMidPoint, yFinal;
00071   // Data stored in order to find the chord.
00072 
00073   G4double itsDist;
00074 
00075 };
00076 
00077 inline  void BDSDecStepper::SetBQuadPrime(G4double aBQuadPrime)
00078 {itsBQuadPrime=aBQuadPrime;
00079 }
00080 
00081 inline G4double BDSDecStepper::GetBQuadPrime()
00082 {return itsBQuadPrime;}
00083 
00084 inline void BDSDecStepper::StepperName()
00085 {G4cout<<"BDSDecStepper"<<G4endl;}
00086 
00087 #endif /* BDSDECSTEPPER_HH */

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7