Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EqEMFieldWithEDM Class Reference

#include <G4EqEMFieldWithEDM.hh>

+ Inheritance diagram for G4EqEMFieldWithEDM:

Public Member Functions

 G4EqEMFieldWithEDM (G4ElectroMagneticField *emField)
 
 ~G4EqEMFieldWithEDM ()
 
void SetChargeMomentumMass (G4ChargeState 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
 
- Public Member Functions inherited from G4EquationOfMotion
 G4EquationOfMotion (G4Field *Field)
 
virtual ~G4EquationOfMotion ()
 
virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const =0
 
virtual void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)=0
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void EvaluateRhsReturnB (const G4double y[], G4double dydx[], G4double Field[]) const
 
void GetFieldValue (const G4double Point[4], G4double Field[]) const
 
const G4FieldGetFieldObj () const
 
G4FieldGetFieldObj ()
 
void SetFieldObj (G4Field *pField)
 

Detailed Description

Definition at line 44 of file G4EqEMFieldWithEDM.hh.

Constructor & Destructor Documentation

◆ G4EqEMFieldWithEDM()

G4EqEMFieldWithEDM::G4EqEMFieldWithEDM ( G4ElectroMagneticField emField)

Definition at line 42 of file G4EqEMFieldWithEDM.cc.

43 : G4EquationOfMotion( emField ), charge(0.), mass(0.), magMoment(0.),
44 spin(0.), fElectroMagCof(0.), fMassCof(0.), omegac(0.),
45 anomaly(0.0011659208), eta(0.), beta(0.), gamma(0.)
46{
47}

◆ ~G4EqEMFieldWithEDM()

G4EqEMFieldWithEDM::~G4EqEMFieldWithEDM ( )

Definition at line 49 of file G4EqEMFieldWithEDM.cc.

50{
51}

Member Function Documentation

◆ EvaluateRhsGivenB()

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

Definition at line 82 of file G4EqEMFieldWithEDM.cc.

85{
86
87 // Components of y:
88 // 0-2 dr/ds,
89 // 3-5 dp/ds - momentum derivatives
90 // 9-11 dSpin/ds = (1/beta) dSpin/dt - spin derivatives
91
92 // The BMT equation, following J.D.Jackson, Classical
93 // Electrodynamics, Second Edition, with additions for EDM
94 // evolution from
95 // M.Nowakowski, et.al. Eur.J.Phys.26, pp 545-560, (2005)
96 // or
97 // Silenko, Phys.Rev.ST Accel.Beams 9:034003, (2006)
98
99 // dS/dt = (e/m) S \cross
100 // MDM: [ (g/2-1 +1/\gamma) B
101 // -(g/2-1)\gamma/(\gamma+1) (\beta \cdot B)\beta
102 // -(g/2-\gamma/(\gamma+1) \beta \cross E
103 //
104 // EDM: eta/2( E - gamma/(gamma+1) \beta (\beta \cdot E)
105 // + \beta \cross B ) ]
106 //
107 // where
108 // S = \vec{s}, where S^2 = 1
109 // B = \vec{B}
110 // \beta = \vec{\beta} = \beta \vec{u} with u^2 = 1
111 // E = \vec{E}
112
113 G4double pSquared = y[3]*y[3] + y[4]*y[4] + y[5]*y[5] ;
114
115 G4double Energy = std::sqrt( pSquared + fMassCof );
116 G4double cof2 = Energy/c_light ;
117
118 G4double pModuleInverse = 1.0/std::sqrt(pSquared) ;
119
120 G4double inverse_velocity = Energy * pModuleInverse / c_light;
121
122 G4double cof1 = fElectroMagCof*pModuleInverse ;
123
124 dydx[0] = y[3]*pModuleInverse ;
125 dydx[1] = y[4]*pModuleInverse ;
126 dydx[2] = y[5]*pModuleInverse ;
127
128 dydx[3] = cof1*(cof2*Field[3] + (y[4]*Field[2] - y[5]*Field[1])) ;
129
130 dydx[4] = cof1*(cof2*Field[4] + (y[5]*Field[0] - y[3]*Field[2])) ;
131
132 dydx[5] = cof1*(cof2*Field[5] + (y[3]*Field[1] - y[4]*Field[0])) ;
133
134 dydx[6] = dydx[8] = 0.;//not used
135
136 // Lab Time of flight
137 dydx[7] = inverse_velocity;
138
139 G4ThreeVector BField(Field[0],Field[1],Field[2]);
140 G4ThreeVector EField(Field[3],Field[4],Field[5]);
141
142 EField /= c_light;
143
144 G4ThreeVector u(y[3], y[4], y[5]);
145 u *= pModuleInverse;
146
147 G4double udb = anomaly*beta*gamma/(1.+gamma) * (BField * u);
148 G4double ucb = (anomaly+1./gamma)/beta;
149 G4double uce = anomaly + 1./(gamma+1.);
150 G4double ude = beta*gamma/(1.+gamma)*(EField*u);
151
152 G4ThreeVector Spin(y[9],y[10],y[11]);
153
154 G4double pcharge;
155 if (charge == 0.) pcharge = 1.;
156 else pcharge = charge;
157
158 G4ThreeVector dSpin(0.,0.,0.);
159 if (Spin.mag2() != 0.)
160 {
161 dSpin = pcharge*omegac*( ucb*(Spin.cross(BField))-udb*(Spin.cross(u))
162 // from Jackson
163 // -uce*Spin.cross(u.cross(EField)) )
164 // but this form has one less operation
165 - uce*(u*(Spin*EField) - EField*(Spin*u))
166 + eta/2.*(Spin.cross(EField) - ude*(Spin.cross(u))
167 // +Spin.cross(u.cross(Bfield))
168 + (u*(Spin*BField) - BField*(Spin*u)) ) );
169 }
170
171 dydx[ 9] = dSpin.x();
172 dydx[10] = dSpin.y();
173 dydx[11] = dSpin.z();
174
175 return;
176}
double G4double
Definition: G4Types.hh:83

◆ GetAnomaly()

G4double G4EqEMFieldWithEDM::GetAnomaly ( ) const
inline

Definition at line 63 of file G4EqEMFieldWithEDM.hh.

63{ return anomaly; }

◆ GetEta()

G4double G4EqEMFieldWithEDM::GetEta ( ) const
inline

Definition at line 67 of file G4EqEMFieldWithEDM.hh.

67{ return eta; }

◆ SetAnomaly()

void G4EqEMFieldWithEDM::SetAnomaly ( G4double  a)
inline

Definition at line 62 of file G4EqEMFieldWithEDM.hh.

62{ anomaly = a; }

◆ SetChargeMomentumMass()

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

Implements G4EquationOfMotion.

Definition at line 54 of file G4EqEMFieldWithEDM.cc.

57{
58 charge = particleCharge.GetCharge();
59 mass = particleMass;
60 magMoment = particleCharge.GetMagneticDipoleMoment();
61 spin = particleCharge.GetSpin();
62
63 fElectroMagCof = eplus*charge*c_light;
64 fMassCof = mass*mass;
65
66 omegac = (eplus/mass)*c_light;
67
68 G4double muB = 0.5*eplus*hbar_Planck/(mass/c_squared);
69
70 G4double g_BMT;
71 if ( spin != 0. ) g_BMT = (std::abs(magMoment)/muB)/spin;
72 else g_BMT = 2.;
73
74 anomaly = (g_BMT - 2.)/2.;
75
76 G4double E = std::sqrt(sqr(MomentumXc)+sqr(mass));
77 beta = MomentumXc/E;
78 gamma = E/mass;
79}
G4double GetCharge() const
G4double GetMagneticDipoleMoment() const
G4double GetSpin() const
T sqr(const T &x)
Definition: templates.hh:128

◆ SetEta()

void G4EqEMFieldWithEDM::SetEta ( G4double  n)
inline

Definition at line 66 of file G4EqEMFieldWithEDM.hh.

66{ eta = n; }

The documentation for this class was generated from the following files: