G4MagHelicalStepper.icc

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 // $Id: G4MagHelicalStepper.icc 69786 2013-05-15 09:38:51Z gcosmo $
00028 //
00029 // Linear Step in regions of no field
00030 //
00031 // --------------------------------------------------------------------
00032 
00033 inline void
00034 G4MagHelicalStepper::LinearStep( const G4double  yIn[],
00035                                        G4double  h,
00036                                        G4double  yLinear[]) const
00037 {
00038   G4double  momentum_val = std::sqrt(yIn[3]*yIn[3] + yIn[4]*yIn[4] + yIn[5]*yIn[5]) ;
00039   G4double  inv_momentum = 1.0 / momentum_val ;
00040   G4double  yDir[3];
00041   // G4double  h_div_momentum = 1.0 / momentum_val ;
00042 
00043   for( G4int i = 0; i < 3; i++ ) {
00044     yDir[i]   = inv_momentum * yIn[i+3];
00045     yLinear[i]   = yIn[i] + h * yDir[i];
00046     // yLinear[i]   = yIn[i] + h_div_momentum * yIn[i+3];
00047     yLinear[i+3] = yIn[i+3];
00048   }
00049 }
00050 
00051 inline void
00052 G4MagHelicalStepper::MagFieldEvaluate(const G4double y[],
00053                                       G4ThreeVector& Bfield )   
00054 {
00055   G4double B[3];
00056   GetEquationOfMotion()->  GetFieldValue(y, B);
00057   Bfield= G4ThreeVector( B[0], B[1], B[2] );
00058 }
00059 
00060 inline G4double
00061 G4MagHelicalStepper::GetInverseCurve(const G4double Momentum,
00062                                       const G4double Bmag)   
00063 {
00064   
00065   G4double  inv_momentum = 1.0 / Momentum ;
00066   G4double particleCharge = fPtrMagEqOfMot->FCof() / (CLHEP::eplus*CLHEP::c_light); 
00067   G4double fCoefficient = -fUnitConstant  * particleCharge*inv_momentum;
00068  
00069   return  fCoefficient*Bmag;
00070 }
00071 inline void G4MagHelicalStepper:: SetAngCurve(const G4double Ang)
00072 {                                                
00073 fAngCurve=Ang; 
00074     
00075 }
00076 
00077 inline G4double G4MagHelicalStepper:: GetAngCurve() const 
00078 {
00079 return fAngCurve;  
00080 
00081 }
00082 
00083 inline void G4MagHelicalStepper:: SetCurve(const G4double Curve)
00084 {
00085  frCurve=Curve;  
00086 }
00087 
00088 inline G4double G4MagHelicalStepper:: GetCurve() const 
00089 {
00090 return frCurve;  
00091 
00092 }
00093 
00094 inline void G4MagHelicalStepper:: SetRadHelix(const G4double Rad)
00095 {
00096  frHelix=Rad;  
00097 }
00098 
00099 inline G4double G4MagHelicalStepper:: GetRadHelix() const 
00100 {
00101 return frHelix;  
00102 
00103 }
00104 
00105 
00106 
00107 

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