54 G4double yTemp[8], dydxTemp[6], yIn[8];
58 for(
G4int i=0; i<nvar; ++i)
72 for(
auto i=0; i<3; ++i)
89 for(
G4int i=0; i<nvar; ++i)
91 yErr[i] = yOut[i] - yTemp[i] ;
92 yOut[i] += yErr[i]*by15 ;
119 G4Exception(
"G4RKG3_Stepper::StepWithEst()",
"GeomField0001",
140 G4double K1[7], K2[7], K3[7], K4[7];
141 G4double tTemp[8]={0.0}, yderiv[6]={0.0};
152 mom = std::sqrt(tIn[3]*tIn[3]+tIn[4]*tIn[4]+tIn[5]*tIn[5]);
153 inverse_mom = 1./
mom;
154 for(
auto i=0; i<3; ++i)
156 K1[i] = Step * dydx[i+3]*inverse_mom;
157 tTemp[i] = tIn[i] + Step*(c1*tIn[i+3]*inverse_mom +
c2*K1[i]) ;
158 tTemp[i+3] = tIn[i+3] + c1*K1[i]*
mom ;
163 for(
auto i=0; i<3; ++i)
165 K2[i] = Step * yderiv[i+3]*inverse_mom;
166 tTemp[i+3] = tIn[i+3] + c1*K2[i]*
mom ;
173 for(
auto i=0; i<3; ++i)
175 K3[i] = Step * yderiv[i+3]*inverse_mom;
176 tTemp[i] = tIn[i] + Step*(tIn[i+3]*inverse_mom + c1*K3[i]) ;
177 tTemp[i+3] = tIn[i+3] + K3[i]*
mom ;
184 for(
auto i=0; i<3; ++i)
186 K4[i] = Step * yderiv[i+3]*inverse_mom;
187 tOut[i] = tIn[i] + Step*(tIn[i+3]*inverse_mom+ (K1[i]+K2[i]+K3[i])*c3) ;
188 tOut[i+3] = tIn[i+3] + mom*(K1[i] + 2*K2[i] + 2*K3[i] +K4[i])*c3 ;
206 distChord = distLine;