87 if( (std::fabs(R_1) < 1e-10)||(Bmag<1e-12) )
99 Bnorm = (1.0/Bmag)*Bfld;
103 B_x_P = Bnorm.
cross(initTangent);
107 B_d_P = Bnorm.
dot(initTangent);
109 vpar = B_d_P * Bnorm;
110 vperp= initTangent - vpar;
112 B_v_P = std::sqrt( 1 - B_d_P * B_d_P);
120 if( std::fabs(Theta) > approc_limit )
122 SinT = std::sin(Theta);
123 CosT = std::cos(Theta);
130 SinT = Theta - 1.0/6.0 * Theta3;
131 CosT = 1 - 0.5 * Theta2 + 1.0/24.0 * Theta4;
138 positionMove = R * ( SinT * vperp + (1-CosT) * B_x_P) + h * vpar;
139 endTangent = CosT * vperp + SinT * B_x_P + vpar;
143 yHelix[0] = yIn[0] + positionMove.
x();
144 yHelix[1] = yIn[1] + positionMove.
y();
145 yHelix[2] = yIn[2] + positionMove.
z();
146 yHelix[3] = velocityVal * endTangent.x();
147 yHelix[4] = velocityVal * endTangent.y();
148 yHelix[5] = velocityVal * endTangent.z();
152 if(yHelix2 !=
nullptr)
154 SinT2 = 2.0 * SinT * CosT;
155 CosT2 = 1.0 - 2.0 * SinT * SinT;
156 endTangent = (CosT2 * vperp + SinT2 * B_x_P + vpar);
157 positionMove = R * ( SinT2 * vperp + (1-CosT2) * B_x_P) + h*2 * vpar;
159 yHelix2[0] = yIn[0] + positionMove.
x();
160 yHelix2[1] = yIn[1] + positionMove.
y();
161 yHelix2[2] = yIn[2] + positionMove.
z();
162 yHelix2[3] = velocityVal * endTangent.x();
163 yHelix2[4] = velocityVal * endTangent.y();
164 yHelix2[5] = velocityVal * endTangent.z();
171 G4double particleCharge = fPtrMagEqOfMot->FCof() / (eplus*c_light);
172 R_Helix =std::abs( ptan/(fUnitConstant * particleCharge*Bmag));
190 const G4int nvar = 6;
200 for(
G4int i=0; i<nvar; ++i)
222 for(
G4int i=0; i<nvar; ++i)
224 yErr[i] = yOut[i] - yTemp[i] ;