File indexing completed on 2025-01-18 09:58:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 inline void
0032 G4MagHelicalStepper::LinearStep( const G4double yIn[],
0033 G4double h,
0034 G4double yLinear[]) const
0035 {
0036
0037
0038 G4double momentum_val = std::sqrt(yIn[3]*yIn[3]+yIn[4]*yIn[4]+yIn[5]*yIn[5]);
0039 G4double inv_momentum = 1.0 / momentum_val;
0040 G4double yDir[3];
0041
0042 for( auto i = 0; i < 3; ++i )
0043 {
0044 yDir[i] = inv_momentum * yIn[i+3];
0045 yLinear[i] = yIn[i] + h * yDir[i];
0046 yLinear[i+3] = yIn[i+3];
0047 }
0048 }
0049
0050 inline void
0051 G4MagHelicalStepper::MagFieldEvaluate(const G4double y[],
0052 G4ThreeVector& Bfield )
0053 {
0054 G4double B[3];
0055 GetEquationOfMotion()->GetFieldValue(y, B);
0056 Bfield = G4ThreeVector( B[0], B[1], B[2] );
0057 }
0058
0059 inline G4double
0060 G4MagHelicalStepper::GetInverseCurve(const G4double Momentum,
0061 const G4double Bmag)
0062 {
0063 constexpr G4double chargeFactor = 1.0 / (CLHEP::eplus*CLHEP::c_light);
0064
0065 G4double inv_momentum = 1.0 / Momentum ;
0066 G4double particleCharge = fPtrMagEqOfMot->FCof() * chargeFactor;
0067 G4double fCoefficient = -fUnitConstant * particleCharge * inv_momentum;
0068
0069 return fCoefficient*Bmag;
0070 }
0071
0072 inline void G4MagHelicalStepper::SetAngCurve(const G4double Ang)
0073 {
0074 fAngCurve=Ang;
0075 }
0076
0077 inline G4double G4MagHelicalStepper::GetAngCurve() const
0078 {
0079 return fAngCurve;
0080 }
0081
0082 inline void G4MagHelicalStepper::SetCurve(const G4double Curve)
0083 {
0084 frCurve=Curve;
0085 }
0086
0087 inline G4double G4MagHelicalStepper::GetCurve() const
0088 {
0089 return frCurve;
0090 }
0091
0092 inline void G4MagHelicalStepper::SetRadHelix(const G4double Rad)
0093 {
0094 frHelix=Rad;
0095 }
0096
0097 inline G4double G4MagHelicalStepper::GetRadHelix() const
0098 {
0099 return frHelix;
0100 }