46 :
G4Mag_EqRhs( MagField ), omegac(0.), anomaly(0.0011659208),
47 pcharge(0.), E(0.), gamma(0.), beta(0.)
63 omegac = (eplus/particleMass)*c_light;
65 pcharge = particleCharge;
67 E = std::sqrt(
sqr(MomentumXc)+
sqr(particleMass));
69 gamma = E/particleMass;
71 G4double neutronAnomaly = -2.913042725;
81 G4double inv_momentum_magnitude = 1.0 / std::sqrt( momentum_mag_square );
84 dydx[0] = y[3] * inv_momentum_magnitude;
85 dydx[1] = y[4] * inv_momentum_magnitude;
86 dydx[2] = y[5] * inv_momentum_magnitude;
93 dydx[3] = cof*(y[4]*B[2] - y[5]*B[1]) ;
94 dydx[4] = cof*(y[5]*B[0] - y[3]*B[2]) ;
95 dydx[5] = cof*(y[3]*B[1] - y[4]*B[0]) ;
99 u *= inv_momentum_magnitude;
103 G4double udb = anomaly*beta*gamma/(1.+gamma) * (BField * u);
104 G4double ucb = (anomaly+1./gamma)/beta;
107 dydx[6] = dydx[7] = dydx[8] = 0.0;
115 dSpin = omegac*(ucb*(Spin.
cross(BField))-udb*(Spin.
cross(u)));
117 dSpin = pcharge*omegac*(ucb*(Spin.
cross(BField))-udb*(Spin.
cross(u)));
120 dydx[ 9] = dSpin.
x();
121 dydx[10] = dSpin.
y();
122 dydx[11] = dSpin.
z();
Hep3Vector cross(const Hep3Vector &) const
virtual void SetChargeMomentumMass(G4double particleCharge, G4double MomentumXc, G4double mass)
void SetChargeMomentumMass(G4double particleCharge, G4double MomentumXc, G4double mass)
G4Mag_SpinEqRhs(G4MagneticField *MagField)
void SetAnomaly(G4double a)
void EvaluateRhsGivenB(const G4double y[], const G4double B[3], G4double dydx[]) const