36#ifndef G4TMAG_ERROR_STEPPER_HH
37#define G4TMAG_ERROR_STEPPER_HH
48template <
class T_Stepper,
class T_Equation,
unsigned int N>
54 G4int numStateVariables = 12)
56 , fEquation_Rhs(EqRhs) { ; }
65 fEquation_Rhs->T_Equation::RightHandSide(y, dydx);
89 T_Equation* fEquation_Rhs;
94template <
class T_Stepper,
class T_Equation,
unsigned int N >
109 for(
unsigned int i = 0; i <
N; ++i)
110 yInitial[i] = yInput[i];
113 yMiddle[7] = yInput[7];
114 yOneStep[7] = yInput[7];
116 for(
unsigned int i =
N; i < maxvar; ++i)
117 yOutput[i] = yInput[i];
123 static_cast<T_Stepper*
>(
this)->DumbStepper(yInitial, dydx, halfStep,
126 static_cast<T_Stepper*
>(
this)->DumbStepper(yMiddle, dydxMid, halfStep,
131 fMidPoint =
G4ThreeVector(yMiddle[0], yMiddle[1], yMiddle[2]);
134 static_cast<T_Stepper*
>(
this)->DumbStepper(yInitial, dydx, hstep, yOneStep);
135 for(
unsigned int i = 0; i <
N; ++i)
137 yError[i] = yOutput[i] - yOneStep[i];
140 T_Stepper::IntegratorCorrection;
145 fInitialPoint =
G4ThreeVector(yInitial[0], yInitial[1], yInitial[2]);
146 fFinalPoint =
G4ThreeVector(yOutput[0], yOutput[1], yOutput[2]);
152template <
class T_Stepper,
class T_Equation,
unsigned int N >
166 if(fInitialPoint != fFinalPoint)
172 distChord = distLine;
176 distChord = (fMidPoint - fInitialPoint).mag();
G4StepperType
G4StepperType defines the available integrator of particle's equation of motion in Geant4.
@ kTMagErrorStepper
G4TMagErrorStepper.
CLHEP::Hep3Vector G4ThreeVector
static G4double Distline(const G4ThreeVector &OtherPnt, const G4ThreeVector &LinePntA, const G4ThreeVector &LinePntB)
G4MagIntegratorStepper(G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, G4bool isFSAL=false)
G4int GetNumberOfStateVariables() const
G4TMagErrorStepper(const G4TMagErrorStepper &)=delete
G4double DistChord() const override final
G4TMagErrorStepper(T_Equation *EqRhs, G4int numberOfVariables, G4int numStateVariables=12)
G4TMagErrorStepper & operator=(const G4TMagErrorStepper &)=delete
virtual ~G4TMagErrorStepper()=default
void RightHandSide(G4double y[], G4double dydx[])
void Stepper(const G4double yInput[], const G4double dydx[], G4double hstep, G4double yOutput[], G4double yError[]) override final
G4StepperType StepperType() const override