47 fBfield(false), fEfield(false), fGfield(false),
48 fgradB(false), fSpin(false),
49 charge(0.), mass(0.), magMoment(0.), spin(0.),
50 ElectroMagCof(0.), omegac(0.), anomaly(0.),
117 G4double momentum_mag_square = y[3]*y[3] + y[4]*y[4] + y[5]*y[5];
118 G4double inv_momentum_magnitude = 1.0 / std::sqrt( momentum_mag_square );
127 dydx[0] = y[3]*inv_momentum_magnitude;
128 dydx[1] = y[4]*inv_momentum_magnitude;
129 dydx[2] = y[5]*inv_momentum_magnitude;
135 G4double field[18] = {0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
145 dydx[3] += cof1*(y[4]*field[2] - y[5]*field[1]);
146 dydx[4] += cof1*(y[5]*field[0] - y[3]*field[2]);
147 dydx[5] += cof1*(y[3]*field[1] - y[4]*field[0]);
165 dydx[3] += cof1*cof2*field[3];
166 dydx[4] += cof1*cof2*field[4];
167 dydx[5] += cof1*cof2*field[5];
185 dydx[3] += field[6]*cof2*cof3/
c_light;
186 dydx[4] += field[7]*cof2*cof3/
c_light;
187 dydx[5] += field[8]*cof2*cof3/
c_light;
195 field[10] = Field[1];
196 field[11] = Field[2];
197 field[12] = Field[3];
198 field[13] = Field[4];
199 field[14] = Field[5];
200 field[15] = Field[6];
201 field[16] = Field[7];
202 field[17] = Field[8];
205 field[10] = Field[10];
206 field[11] = Field[11];
207 field[12] = Field[12];
208 field[13] = Field[13];
209 field[14] = Field[14];
210 field[15] = Field[15];
211 field[16] = Field[16];
212 field[17] = Field[17];
228 dydx[3] +=
magMoment*(y[9]*field[ 9]+y[10]*field[10]+y[11]*field[11])
229 *inv_momentum_magnitude*Energy;
230 dydx[4] +=
magMoment*(y[9]*field[12]+y[10]*field[13]+y[11]*field[14])
231 *inv_momentum_magnitude*Energy;
232 dydx[5] +=
magMoment*(y[9]*field[15]+y[10]*field[16]+y[11]*field[17])
233 *inv_momentum_magnitude*Energy;
242 dydx[7] = inverse_velocity;
269 u *= inv_momentum_magnitude;
278 if (
charge == 0.) pcharge = 1.;
282 if (Spin.
mag2() != 0.) {
292 pcharge*
omegac*( uce*(u*(Spin*EField) - EField*(Spin*u)) );
296 dydx[ 9] = dSpin.
x();
297 dydx[10] = dSpin.
y();
298 dydx[11] = dSpin.
z();
static constexpr double hbar_Planck
void EvaluateRhsGivenB(const G4double y[], const G4double Field[], G4double dydx[]) const
static constexpr double c_squared
Hep3Vector cross(const Hep3Vector &) const
static constexpr double eplus
static constexpr double c_light
G4RepleteEofM(G4Field *, G4int nvar=8)
G4double GetMagneticDipoleMoment() const
void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double mass)
G4double GetCharge() const
G4bool IsGravityActive() const