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()),
73 G4Exception(
"G4BFieldIntegrationDriver Constructor:",
86 if (chordDistance < 2 * radius)
105 epsStep, chordDistance);
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;
151 const auto toFraction = [&](
double value) {
return value / totSteps * 100; };
153 G4cout <<
"============= G4BFieldIntegrationDriver statistics ===========\n"
154 <<
"total steps " << totSteps <<
" "
157 <<
"======================================\n";
static const G4double pos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static constexpr double twopi
static constexpr double eplus
G4GLOB_DLL std::ostream G4cout
G4BFieldIntegrationDriver(std::unique_ptr< G4VIntegrationDriver > smallStepDriver, std::unique_ptr< G4VIntegrationDriver > largeStepDriver)
std::unique_ptr< G4VIntegrationDriver > fSmallStepDriver
G4double CurvatureRadius(const G4FieldTrack &track) const
G4VIntegrationDriver * fCurrDriver
void PrintStatistics() const
virtual void SetEquationOfMotion(G4EquationOfMotion *equation) override
std::unique_ptr< G4VIntegrationDriver > fLargeStepDriver
virtual G4double AdvanceChordLimited(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance) override
void GetFieldValue(const G4FieldTrack &track, G4double Field[]) const
void GetFieldValue(const G4double Point[4], G4double Field[]) const
G4ThreeVector GetPosition() const
G4double GetLabTimeOfFlight() const
G4ThreeVector GetMomentum() const
static constexpr G4int MAX_NUMBER_OF_COMPONENTS
virtual void OnComputeStep()=0
virtual G4double AdvanceChordLimited(G4FieldTrack &track, G4double hstep, G4double eps, G4double chordDistance)=0
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
auto get(Tuple< Elements... > &t) -> decltype(get_height< sizeof...(Elements) - I - 1 >(t))
G4Mag_EqRhs * toMagneticEquation(G4EquationOfMotion *equation)