51 G4Exception(
"G4BFieldIntegrationDriver::G4BFieldIntegrationDriver",
53 "Works only with G4Mag_EqRhs");
63 std::unique_ptr<G4VIntegrationDriver> smallStepDriver,
64 std::unique_ptr<G4VIntegrationDriver> largeStepDriver)
65 : fSmallStepDriver(std::move(smallStepDriver)),
66 fLargeStepDriver(std::move(largeStepDriver)),
67 fCurrDriver(fSmallStepDriver.
get()),
68 fEquation(toMagneticEquation(fCurrDriver->GetEquationOfMotion()))
73 G4Exception(
"G4BFieldIntegrationDriver Constructor:",
86 if (chordDistance < 2 * radius)
105 epsStep, chordDistance);
111 fEquation = toMagneticEquation(equation);
123 const G4double Bmag2 = field[0] * field[0]
124 + field[1] * field[1]
125 + field[2] * field[2] ;
134 return std::sqrt(momentum2 / Bmag2) * fCof_inv;
142 G4double positionTime[4]= { pos.
x(), pos.
y(), pos.
z(),
151 const auto toFraction = [&](
double value) {
return value / totSteps * 100; };
153 G4cout <<
"============= G4BFieldIntegrationDriver statistics ===========\n"
154 <<
"total steps " << totSteps <<
" "
156 <<
"largeDriverSteps " << toFraction(fLargeDriverSteps) <<
"\n"
157 <<
"======================================\n";