Geant4-11
Public Member Functions | Private Attributes
G4EqEMFieldWithEDM Class Referenceabstract

#include <G4EqEMFieldWithEDM.hh>

Inheritance diagram for G4EqEMFieldWithEDM:
G4EquationOfMotion

Public Member Functions

virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const =0
 
void EvaluateRhsGivenB (const G4double y[], const G4double Field[], G4double dydx[]) const
 
void EvaluateRhsReturnB (const G4double y[], G4double dydx[], G4double Field[]) const
 
 G4EqEMFieldWithEDM (G4ElectroMagneticField *emField)
 
G4double GetAnomaly () const
 
G4double GetEta () const
 
G4FieldGetFieldObj ()
 
const G4FieldGetFieldObj () const
 
void GetFieldValue (const G4double Point[4], G4double Field[]) const
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void SetAnomaly (G4double a)
 
void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double mass)
 
void SetEta (G4double n)
 
void SetFieldObj (G4Field *pField)
 
 ~G4EqEMFieldWithEDM ()
 

Private Attributes

G4double anomaly
 
G4double beta
 
G4double charge
 
G4double eta
 
G4double fElectroMagCof
 
G4double fMassCof
 
G4double gamma
 
G4FielditsField = nullptr
 
G4double magMoment
 
G4double mass
 
G4double omegac
 
G4double spin
 

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.

◆ ~G4EqEMFieldWithEDM()

G4EqEMFieldWithEDM::~G4EqEMFieldWithEDM ( )

Definition at line 49 of file G4EqEMFieldWithEDM.cc.

50{
51}

Member Function Documentation

◆ EvaluateRhsGivenB() [1/2]

virtual void G4EquationOfMotion::EvaluateRhsGivenB ( const G4double  y[],
const G4double  B[3],
G4double  dydx[] 
) const
pure virtualinherited

◆ EvaluateRhsGivenB() [2/2]

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
float c_light
Definition: hepunit.py:256

References anomaly, beta, source.hepunit::c_light, charge, eta, fElectroMagCof, fMassCof, gamma, omegac, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ EvaluateRhsReturnB()

void G4EquationOfMotion::EvaluateRhsReturnB ( const G4double  y[],
G4double  dydx[],
G4double  Field[] 
) const
inlineinherited

◆ GetAnomaly()

G4double G4EqEMFieldWithEDM::GetAnomaly ( ) const
inline

Definition at line 63 of file G4EqEMFieldWithEDM.hh.

63{ return anomaly; }

References anomaly.

◆ GetEta()

G4double G4EqEMFieldWithEDM::GetEta ( ) const
inline

Definition at line 67 of file G4EqEMFieldWithEDM.hh.

67{ return eta; }

References eta.

◆ GetFieldObj() [1/2]

G4Field * G4EquationOfMotion::GetFieldObj ( )
inlineinherited

◆ GetFieldObj() [2/2]

const G4Field * G4EquationOfMotion::GetFieldObj ( ) const
inlineinherited

Referenced by G4NystromRK4::GetField().

◆ GetFieldValue()

void G4EquationOfMotion::GetFieldValue ( const G4double  Point[4],
G4double  Field[] 
) const
inlineinherited

◆ RightHandSide()

void G4EquationOfMotion::RightHandSide ( const G4double  y[],
G4double  dydx[] 
) const
inlineinherited

◆ SetAnomaly()

void G4EqEMFieldWithEDM::SetAnomaly ( G4double  a)
inline

Definition at line 62 of file G4EqEMFieldWithEDM.hh.

62{ anomaly = a; }

References anomaly.

◆ 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
65
67
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}
static constexpr double eplus
Definition: G4SIunits.hh:184
G4double GetCharge() const
G4double GetMagneticDipoleMoment() const
G4double GetSpin() const
float hbar_Planck
Definition: hepunit.py:263
float c_squared
Definition: hepunit.py:257
T sqr(const T &x)
Definition: templates.hh:128

References anomaly, beta, source.hepunit::c_light, source.hepunit::c_squared, charge, eplus, fElectroMagCof, fMassCof, gamma, G4ChargeState::GetCharge(), G4ChargeState::GetMagneticDipoleMoment(), G4ChargeState::GetSpin(), source.hepunit::hbar_Planck, magMoment, mass, omegac, spin, and sqr().

◆ SetEta()

void G4EqEMFieldWithEDM::SetEta ( G4double  n)
inline

Definition at line 66 of file G4EqEMFieldWithEDM.hh.

References eta, and CLHEP::detail::n.

◆ SetFieldObj()

void G4EquationOfMotion::SetFieldObj ( G4Field pField)
inlineinherited

Field Documentation

◆ anomaly

G4double G4EqEMFieldWithEDM::anomaly
private

◆ beta

G4double G4EqEMFieldWithEDM::beta
private

Definition at line 78 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), and SetChargeMomentumMass().

◆ charge

G4double G4EqEMFieldWithEDM::charge
private

Definition at line 72 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), and SetChargeMomentumMass().

◆ eta

G4double G4EqEMFieldWithEDM::eta
private

Definition at line 77 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), GetEta(), and SetEta().

◆ fElectroMagCof

G4double G4EqEMFieldWithEDM::fElectroMagCof
private

Definition at line 74 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), and SetChargeMomentumMass().

◆ fMassCof

G4double G4EqEMFieldWithEDM::fMassCof
private

Definition at line 75 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), and SetChargeMomentumMass().

◆ gamma

G4double G4EqEMFieldWithEDM::gamma
private

Definition at line 78 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), and SetChargeMomentumMass().

◆ itsField

G4Field* G4EquationOfMotion::itsField = nullptr
privateinherited

Definition at line 90 of file G4EquationOfMotion.hh.

◆ magMoment

G4double G4EqEMFieldWithEDM::magMoment
private

Definition at line 72 of file G4EqEMFieldWithEDM.hh.

Referenced by SetChargeMomentumMass().

◆ mass

G4double G4EqEMFieldWithEDM::mass
private

Definition at line 72 of file G4EqEMFieldWithEDM.hh.

Referenced by SetChargeMomentumMass().

◆ omegac

G4double G4EqEMFieldWithEDM::omegac
private

Definition at line 77 of file G4EqEMFieldWithEDM.hh.

Referenced by EvaluateRhsGivenB(), and SetChargeMomentumMass().

◆ spin

G4double G4EqEMFieldWithEDM::spin
private

Definition at line 72 of file G4EqEMFieldWithEDM.hh.

Referenced by SetChargeMomentumMass().


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