18#include "BDSGlobalConstants.hh"
19#include "BDSIntegratorMag.hh"
20#include "BDSMagnetStrength.hh"
22#include "BDSUtilities.hh"
25#include "G4ClassicalRK4.hh"
33 G4MagIntegratorStepper(eqOfMIn, nVariablesIn),
35 nVariables(nVariablesIn),
39 backupStepper =
new G4ClassicalRK4(eqOfMIn, nVariablesIn);
42 if (thinElementLength < 0)
45 if (nominalMatrixRelativeMomCut < 0)
49BDSIntegratorMag::~BDSIntegratorMag()
55 const G4ThreeVector& localMom,
58 const G4double momScaling)
63 globalMom*=momScaling;
65 yOut[0] = globalPos.x();
66 yOut[1] = globalPos.y();
67 yOut[2] = globalPos.z();
69 yOut[3] = globalMom.x();
70 yOut[4] = globalMom.y();
71 yOut[5] = globalMom.z();
74 const G4double standardError = 1e-8;
75 G4ThreeVector momUnit = globalMom.unit();
76 momUnit *= standardError;
77 for (G4int i = 0; i < 3; i++)
BDSStep ConvertToGlobalStep(const G4ThreeVector &localPosition, const G4ThreeVector &localDirection, const G4bool useCurvilinear=true) const
static BDSGlobalConstants * Instance()
Access method.
static G4double nominalMatrixRelativeMomCut
static G4double thinElementLength
static G4bool currentTrackIsPrimary
void ConvertToGlobal(const G4ThreeVector &localPos, const G4ThreeVector &localMom, G4double yOut[], G4double yErr[], const G4double momScaling=1.0)
scaling of momentum in case localMom is a unit vector
G4MagIntegratorStepper * backupStepper
BDSIntegratorMag()=delete
Private default constructor to force use of specific constructor.
A simple class to represent the positions of a step.
G4ThreeVector PostStepPoint() const
Accessor.
G4ThreeVector PreStepPoint() const
Accessor.