G4EqEMFieldWithEDM Class Reference

#include <G4EqEMFieldWithEDM.hh>

Inheritance diagram for G4EqEMFieldWithEDM:

G4EquationOfMotion

Public Member Functions

 G4EqEMFieldWithEDM (G4ElectroMagneticField *emField)
 ~G4EqEMFieldWithEDM ()
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
void SetEta (G4double n)
G4double GetEta () const

Detailed Description

Definition at line 49 of file G4EqEMFieldWithEDM.hh.


Constructor & Destructor Documentation

G4EqEMFieldWithEDM::G4EqEMFieldWithEDM ( G4ElectroMagneticField emField  ) 

Definition at line 45 of file G4EqEMFieldWithEDM.cc.

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

G4EqEMFieldWithEDM::~G4EqEMFieldWithEDM (  ) 

Definition at line 52 of file G4EqEMFieldWithEDM.cc.

00053 {
00054 } 


Member Function Documentation

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

Definition at line 75 of file G4EqEMFieldWithEDM.cc.

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

G4double G4EqEMFieldWithEDM::GetAnomaly (  )  const [inline]

Definition at line 68 of file G4EqEMFieldWithEDM.hh.

00068 { return anomaly; }

G4double G4EqEMFieldWithEDM::GetEta (  )  const [inline]

Definition at line 72 of file G4EqEMFieldWithEDM.hh.

00072 { return eta; }

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

Definition at line 67 of file G4EqEMFieldWithEDM.hh.

00067 { anomaly = a; }

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

Implements G4EquationOfMotion.

Definition at line 57 of file G4EqEMFieldWithEDM.cc.

References sqr().

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

void G4EqEMFieldWithEDM::SetEta ( G4double  n  )  [inline]

Definition at line 71 of file G4EqEMFieldWithEDM.hh.

00071 { eta = n; }


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