100 G4double momentum_mag_square = y[3]*y[3] + y[4]*y[4] + y[5]*y[5];
101 G4double inv_momentum_magnitude = 1.0 / std::sqrt( momentum_mag_square );
105 dydx[0] = y[3]*inv_momentum_magnitude;
106 dydx[1] = y[4]*inv_momentum_magnitude;
107 dydx[2] = y[5]*inv_momentum_magnitude;
109 dydx[3] = cof*(y[4]*
Field[2] - y[5]*
Field[1]) ;
110 dydx[4] = cof*(y[5]*
Field[0] - y[3]*
Field[2]) ;
111 dydx[5] = cof*(y[3]*
Field[1] - y[4]*
Field[0]) ;
118 PositionAndTime[0] = y[0];
119 PositionAndTime[1] = y[1];
120 PositionAndTime[2] = y[2];
122 PositionAndTime[3] = y[7];
123 fEq -> GetFieldValue(PositionAndTime, B) ;
126 #endif // G4CONSTRK4_HH
G4ConstRK4(G4Mag_EqRhs *EquationMotion, G4int numberOfStateVariables=8)
CLHEP::Hep3Vector G4ThreeVector
G4double DistChord() const
double B(double temperature)
G4ConstRK4 & operator=(const G4ConstRK4 &)
G4ThreeVector fFinalPoint
G4ThreeVector fInitialPoint
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
void GetConstField(const G4double y[], G4double Field[])
void RightHandSideConst(const G4double y[], G4double dydx[]) const
G4int IntegratorOrder() const
void DumbStepper(const G4double yIn[], const G4double dydx[], G4double h, G4double yOut[])