G4MagHelicalStepper.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 //
00028 // $Id: G4MagHelicalStepper.hh 69786 2013-05-15 09:38:51Z gcosmo $
00029 //
00030 //
00031 //
00032 // class G4MagHelicalStepper
00033 //
00034 // Class description:
00035 //
00036 // Abstract base class for integrator of particle's equation of motion,
00037 // used in tracking in space dependent magnetic field
00038 
00039 // History:
00040 // - 05.11.98  J.Apostolakis   Creation of new ABC 
00041 // --------------------------------------------------------------------
00042 
00043 #ifndef G4MagHelicalStepper_hh
00044 #define G4MagHelicalStepper_hh
00045 
00046 #include <CLHEP/Units/PhysicalConstants.h>
00047 
00048 #include "G4Types.hh"
00049 #include "G4MagIntegratorStepper.hh"
00050 #include "G4Mag_EqRhs.hh"
00051 #include "G4ThreeVector.hh"
00052 
00053 class G4MagHelicalStepper : public G4MagIntegratorStepper
00054 {
00055   public:  // with description
00056 
00057     G4MagHelicalStepper(G4Mag_EqRhs *EqRhs);
00058     virtual ~G4MagHelicalStepper();
00059   
00060     virtual void Stepper( const G4double y[],    // VIRTUAL for ExactHelix - temporary
00061                   const G4double dydx[],
00062                         G4double h,
00063                         G4double yout[],
00064                         G4double yerr[]  );
00065       // The stepper for the Runge Kutta integration.
00066       // The stepsize is fixed, equal to h.
00067       // Integrates ODE starting values y[0 to 6]
00068       // Outputs yout[] and its estimated error yerr[].
00069   
00070     virtual  void DumbStepper( const G4double y[],
00071                                G4ThreeVector   Bfld,
00072                                G4double  h,
00073                                G4double yout[] ) = 0;
00074       // Performs a 'dump' Step without error calculation.
00075   
00076     G4double DistChord()const ;
00077       // Estimate maximum distance of curved solution and chord ... 
00078 
00079   protected:  // with description
00080 
00081     inline void LinearStep( const G4double  yIn[],
00082                                   G4double  h,
00083                                   G4double  yHelix[]) const;
00084       // A linear Step in regions without magnetic field.
00085 
00086      void AdvanceHelix( const G4double  yIn[],
00087                              G4ThreeVector   Bfld,
00088                              G4double  h,
00089                         G4double  yHelix[],G4double yHelix2[]=0);    // output 
00090       // A first order Step along a helix inside the field.
00091 
00092     inline void MagFieldEvaluate( const G4double y[], G4ThreeVector& Bfield );
00093       // Evaluate the field at a certain point.
00094 
00095   
00096    inline G4double GetInverseCurve( const G4double Momentum, const G4double Bmag );
00097       // Evaluate Inverse of Curvature of Track
00098 
00099       // Store and use the parameters of track : 
00100       // Radius of curve, Stepping angle, Radius of projected helix
00101    inline void SetAngCurve(const G4double Ang);
00102    inline G4double GetAngCurve()const;
00103 
00104    inline void SetCurve(const G4double Curve);
00105    inline G4double GetCurve()const;
00106 
00107    inline void SetRadHelix(const G4double Rad);
00108    inline G4double GetRadHelix()const;
00109 
00110 
00111   protected:  // without description
00112 
00113     // void MagFieldEvaluate( const G4double y[], G4double B[] )   
00114     //  { GetEquationOfMotion()->  GetFieldValue(y, B); }
00115 
00116   private:
00117 
00118     G4MagHelicalStepper(const G4MagHelicalStepper&);
00119     G4MagHelicalStepper& operator=(const G4MagHelicalStepper&);
00120       // Private copy constructor and assignment operator.
00121  
00122     static const G4double fUnitConstant;   //  As in G4Mag_EqRhs.hh/cc where it is not used.
00123   private:
00124    
00125     G4Mag_EqRhs*  fPtrMagEqOfMot;
00126  
00127     // Data stored in order to find the chord.
00128       G4double fAngCurve;
00129       G4double frCurve;
00130       G4double frHelix;
00131     // Data stored in order to find the chord.
00132       G4ThreeVector yInitial, yMidPoint, yFinal;
00133        
00134     
00135 };
00136 
00137 #include  "G4MagHelicalStepper.icc"
00138 
00139 #endif  /* G4MagHelicalStepper_hh */

Generated on Mon May 27 17:48:50 2013 for Geant4 by  doxygen 1.4.7