G4EqMagElectricField Class Reference

#include <G4EqMagElectricField.hh>

Inheritance diagram for G4EqMagElectricField:

G4EquationOfMotion

Public Member Functions

 G4EqMagElectricField (G4ElectroMagneticField *emField)
 ~G4EqMagElectricField ()
void SetChargeMomentumMass (G4double particleCharge, G4double MomentumXc, G4double mass)
void EvaluateRhsGivenB (const G4double y[], const G4double Field[], G4double dydx[]) const

Detailed Description

Definition at line 47 of file G4EqMagElectricField.hh.


Constructor & Destructor Documentation

G4EqMagElectricField::G4EqMagElectricField ( G4ElectroMagneticField emField  )  [inline]

Definition at line 51 of file G4EqMagElectricField.hh.

00052       : G4EquationOfMotion( emField ) {;}

G4EqMagElectricField::~G4EqMagElectricField (  )  [inline]

Definition at line 54 of file G4EqMagElectricField.hh.

00054 {;} 


Member Function Documentation

void G4EqMagElectricField::EvaluateRhsGivenB ( const G4double  y[],
const G4double  Field[],
G4double  dydx[] 
) const

Definition at line 57 of file G4EqMagElectricField.cc.

00060 {
00061 
00062    // Components of y:
00063    //    0-2 dr/ds, 
00064    //    3-5 dp/ds - momentum derivatives 
00065 
00066    G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ;
00067 
00068    G4double Energy   = std::sqrt( pSquared + fMassCof );
00069    G4double cof2     = Energy/c_light ;
00070 
00071    G4double pModuleInverse  = 1.0/std::sqrt(pSquared) ;
00072 
00073    //  G4double inverse_velocity = Energy * c_light * pModuleInverse;
00074    G4double inverse_velocity = Energy * pModuleInverse / c_light;
00075 
00076    G4double cof1     = fElectroMagCof*pModuleInverse ;
00077 
00078    //  G4double vDotE = y[3]*Field[3] + y[4]*Field[4] + y[5]*Field[5] ;
00079 
00080 
00081    dydx[0] = y[3]*pModuleInverse ;                         
00082    dydx[1] = y[4]*pModuleInverse ;                         
00083    dydx[2] = y[5]*pModuleInverse ;                        
00084 
00085    dydx[3] = cof1*(cof2*Field[3] + (y[4]*Field[2] - y[5]*Field[1])) ;
00086    
00087    dydx[4] = cof1*(cof2*Field[4] + (y[5]*Field[0] - y[3]*Field[2])) ; 
00088  
00089    dydx[5] = cof1*(cof2*Field[5] + (y[3]*Field[1] - y[4]*Field[0])) ;  
00090 
00091    dydx[6] = 0.;//not used
00092 
00093    // Lab Time of flight
00094    dydx[7] = inverse_velocity;
00095    return ;
00096 }

void G4EqMagElectricField::SetChargeMomentumMass ( G4double  particleCharge,
G4double  MomentumXc,
G4double  mass 
) [virtual]

Implements G4EquationOfMotion.

Definition at line 46 of file G4EqMagElectricField.cc.

00049 {
00050    fElectroMagCof =  eplus*particleCharge*c_light ;
00051    fMassCof = particleMass*particleMass ; 
00052 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:54 2013 for Geant4 by  doxygen 1.4.7