77 G4double A[3] = {dPdS[0], dPdS[1], dPdS[2]};
79 m_iPoint[0]=R[0]; m_iPoint[1]=R[1]; m_iPoint[2]=R[2];
95 if( std::fabs(newmom2 - oldmom2) > perMillion * oldmom2 ) {
96 m_mom = sqrt(newmom2) ;
98 m_cof = m_fEq->
FCof()*m_imom;
102 CheckCachedMomemtum(
P, m_mom );
103 CheckFieldPosition(
P, m_fldPosition );
108 G4double K1[3] = { m_imom*dPdS[3], m_imom*dPdS[4], m_imom*dPdS[5] };
112 G4double p[4] = {R[0]+S5*(A[0]+S4*K1[0]),
113 R[1]+S5*(A[1]+S4*K1[1]),
114 R[2]+S5*(A[2]+S4*K1[2]),
118 G4double A2[3] = {A[0]+S5*K1[0],A[1]+S5*K1[1],A[2]+S5*K1[2]};
119 G4double K2[3] = {(A2[1]*m_lastField[2]-A2[2]*m_lastField[1])*m_cof,
120 (A2[2]*m_lastField[0]-A2[0]*m_lastField[2])*m_cof,
121 (A2[0]*m_lastField[1]-A2[1]*m_lastField[0])*m_cof};
123 m_mPoint[0]=p[0]; m_mPoint[1]=p[1]; m_mPoint[2]=p[2];
127 G4double A3[3] = {A[0]+S5*K2[0],A[1]+S5*K2[1],A[2]+S5*K2[2]};
128 G4double K3[3] = {(A3[1]*m_lastField[2]-A3[2]*m_lastField[1])*m_cof,
129 (A3[2]*m_lastField[0]-A3[0]*m_lastField[2])*m_cof,
130 (A3[0]*m_lastField[1]-A3[1]*m_lastField[0])*m_cof};
134 p[0] = R[0]+S*(A[0]+S5*K3[0]);
135 p[1] = R[1]+S*(A[1]+S5*K3[1]);
136 p[2] = R[2]+S*(A[2]+S5*K3[2]);
140 G4double A4[3] = {A[0]+S*K3[0],A[1]+S*K3[1],A[2]+S*K3[2]};
141 G4double K4[3] = {(A4[1]*m_lastField[2]-A4[2]*m_lastField[1])*m_cof,
142 (A4[2]*m_lastField[0]-A4[0]*m_lastField[2])*m_cof,
143 (A4[0]*m_lastField[1]-A4[1]*m_lastField[0])*m_cof};
147 Po[0] =
P[0]+S*(A[0]+S6*(K1[0]+K2[0]+K3[0]));
148 Po[1] =
P[1]+S*(A[1]+S6*(K1[1]+K2[1]+K3[1]));
149 Po[2] =
P[2]+S*(A[2]+S6*(K1[2]+K2[2]+K3[2]));
151 m_fPoint[0]=Po[0]; m_fPoint[1]=Po[1]; m_fPoint[2]=Po[2];
155 Po[3] = A[0]+S6*(K1[0]+K4[0]+2.*(K2[0]+K3[0]));
156 Po[4] = A[1]+S6*(K1[1]+K4[1]+2.*(K2[1]+K3[1]));
157 Po[5] = A[2]+S6*(K1[2]+K4[2]+2.*(K2[2]+K3[2]));
161 Err[3] = S*std::fabs(K1[0]-K2[0]-K3[0]+K4[0]);
162 Err[4] = S*std::fabs(K1[1]-K2[1]-K3[1]+K4[1]);
163 Err[5] = S*std::fabs(K1[2]-K2[2]-K3[2]+K4[2]);
173 G4double normF = m_mom/std::sqrt(Po[3]*Po[3]+Po[4]*Po[4]+Po[5]*Po[5]);
174 Po [3]*=normF; Po[4]*=normF; Po[5]*=normF;
177 Po[6]=
P[6]; Po[7]=
P[7];
static constexpr double perMillion
double A(double temperature)