43 const G4double invMomentum2 = 1.0 / momentum2;
46 const G4double relativeMomentumError2 = momentumError2 * invMomentum2;
48 return std::max(std::sqrt(positionError2),
49 std::sqrt(relativeMomentumError2) * hstep);
59 G4double inv_eps_vel_sq = 1.0 / (eps_rel_max * eps_rel_max);
63 G4double inv_eps_pos_sq = 1.0 / (eps_pos * eps_pos);
68 errpos_sq *= inv_eps_pos_sq;
76 errvel_sq = sumerr_sq / magvel_sq;
80 G4Exception(
"field_utils::relativeError",
"Field001",
82 errvel_sq = sumerr_sq;
84 errvel_sq *= inv_eps_vel_sq;
85 errmax_sq = std::max(errpos_sq, errvel_sq);
100 std::memcpy(dst, src,
sizeof(
G4double) * size);
108 return -c_light * particleCharge * BField / momentum;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double relativeError(const G4double y[], const G4double yerr[], G4double hstep, G4double errorTolerance)
G4double absoluteError(const G4double y[], const G4double yerr[], G4double hstep)
G4double relativeError2(const G4double y[], const G4double yerr[], G4double hstep, G4double errorTolerance)
void copy(G4double dst[], const G4double src[], size_t size=G4FieldTrack::ncompSVEC)
G4double inverseCurvatureRadius(G4double particleCharge, G4double momentum, G4double BField)
G4double getValue2(const ArrayType &array, Value1D value)