G4EqEMFieldWithSpin Class Reference

#include <G4EqEMFieldWithSpin.hh>

Inheritance diagram for G4EqEMFieldWithSpin:

G4EquationOfMotion

Public Member Functions

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

Detailed Description

Definition at line 48 of file G4EqEMFieldWithSpin.hh.


Constructor & Destructor Documentation

G4EqEMFieldWithSpin::G4EqEMFieldWithSpin ( G4ElectroMagneticField emField  ) 

Definition at line 45 of file G4EqEMFieldWithSpin.cc.

00046   : G4EquationOfMotion( emField ), fElectroMagCof(0.), fMassCof(0.),
00047     omegac(0.), anomaly(0.0011659208), pcharge(0.), E(0.), gamma(0.), beta(0.)
00048 {
00049 }

G4EqEMFieldWithSpin::~G4EqEMFieldWithSpin (  ) 

Definition at line 51 of file G4EqEMFieldWithSpin.cc.

00052 {
00053 } 


Member Function Documentation

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

Definition at line 74 of file G4EqEMFieldWithSpin.cc.

00077 {
00078 
00079    // Components of y:
00080    //    0-2 dr/ds,
00081    //    3-5 dp/ds - momentum derivatives
00082    //    9-11 dSpin/ds = (1/beta) dSpin/dt - spin derivatives
00083 
00084    // The BMT equation, following J.D.Jackson, Classical
00085    // Electrodynamics, Second Edition,
00086    // dS/dt = (e/mc) S \cross
00087    //              [ (g/2-1 +1/\gamma) B
00088    //               -(g/2-1)\gamma/(\gamma+1) (\beta \cdot B)\beta
00089    //               -(g/2-\gamma/(\gamma+1) \beta \cross E ]
00090    // where
00091    // S = \vec{s}, where S^2 = 1
00092    // B = \vec{B}
00093    // \beta = \vec{\beta} = \beta \vec{u} with u^2 = 1
00094    // E = \vec{E}
00095 
00096    G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ;
00097 
00098    G4double Energy   = std::sqrt( pSquared + fMassCof );
00099    G4double cof2     = Energy/c_light ;
00100 
00101    G4double pModuleInverse  = 1.0/std::sqrt(pSquared) ;
00102 
00103    G4double inverse_velocity = Energy * pModuleInverse / c_light;
00104 
00105    G4double cof1     = fElectroMagCof*pModuleInverse ;
00106 
00107    dydx[0] = y[3]*pModuleInverse ;                         
00108    dydx[1] = y[4]*pModuleInverse ;                         
00109    dydx[2] = y[5]*pModuleInverse ;                        
00110 
00111    dydx[3] = cof1*(cof2*Field[3] + (y[4]*Field[2] - y[5]*Field[1])) ;
00112    
00113    dydx[4] = cof1*(cof2*Field[4] + (y[5]*Field[0] - y[3]*Field[2])) ; 
00114  
00115    dydx[5] = cof1*(cof2*Field[5] + (y[3]*Field[1] - y[4]*Field[0])) ;  
00116    
00117    dydx[6] = dydx[8] = 0.;//not used
00118 
00119    // Lab Time of flight
00120    dydx[7] = inverse_velocity;
00121    
00122    G4ThreeVector BField(Field[0],Field[1],Field[2]);
00123    G4ThreeVector EField(Field[3],Field[4],Field[5]);
00124 
00125    EField /= c_light;
00126 
00127    G4ThreeVector u(y[3], y[4], y[5]);
00128    u *= pModuleInverse;
00129 
00130    G4double udb = anomaly*beta*gamma/(1.+gamma) * (BField * u);
00131    G4double ucb = (anomaly+1./gamma)/beta;
00132    G4double uce = anomaly + 1./(gamma+1.);
00133 
00134    G4ThreeVector Spin(y[9],y[10],y[11]);
00135 
00136    G4ThreeVector dSpin
00137      = pcharge*omegac*( ucb*(Spin.cross(BField))-udb*(Spin.cross(u))
00138                                // from Jackson
00139                                // -uce*Spin.cross(u.cross(EField)) );
00140                                // but this form has one less operation
00141                       - uce*(u*(Spin*EField) - EField*(Spin*u)) );
00142 
00143    dydx[ 9] = dSpin.x();
00144    dydx[10] = dSpin.y();
00145    dydx[11] = dSpin.z();
00146 
00147    return ;
00148 }

G4double G4EqEMFieldWithSpin::GetAnomaly (  )  const [inline]

Definition at line 67 of file G4EqEMFieldWithSpin.hh.

00067 { return anomaly; }

void G4EqEMFieldWithSpin::SetAnomaly ( G4double  a  )  [inline]

Definition at line 66 of file G4EqEMFieldWithSpin.hh.

00066 { anomaly = a; }

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

Implements G4EquationOfMotion.

Definition at line 56 of file G4EqEMFieldWithSpin.cc.

References sqr().

00059 {
00060    fElectroMagCof =  eplus*particleCharge*c_light ;
00061    fMassCof = particleMass*particleMass ;
00062 
00063    omegac = (eplus/particleMass)*c_light;
00064 
00065    pcharge = particleCharge;
00066 
00067    E = std::sqrt(sqr(MomentumXc)+sqr(particleMass));
00068    beta  = MomentumXc/E;
00069    gamma = E/particleMass;
00070 
00071 }


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