50 fPtrMagEqOfMot(EqRhs), fAngCurve(0.), frCurve(0.), frHelix(0.)
93 if( (std::fabs(R_1) < 1
e-10)||(Bmag<1
e-12) )
105 Bnorm = (1.0/Bmag)*Bfld;
109 B_x_P = Bnorm.
cross(initTangent);
113 B_d_P = Bnorm.
dot(initTangent);
115 vpar = B_d_P * Bnorm;
116 vperp= initTangent - vpar;
118 B_v_P = std::sqrt( 1 - B_d_P * B_d_P);
126 if( std::fabs(Theta) > approc_limit )
128 SinT = std::sin(Theta);
129 CosT = std::cos(Theta);
136 SinT = Theta - 1.0/6.0 * Theta3;
137 CosT = 1 - 0.5 * Theta2 + 1.0/24.0 * Theta4;
144 positionMove = R * ( SinT * vperp + (1-CosT) * B_x_P) + h * vpar;
145 endTangent = CosT * vperp + SinT * B_x_P + vpar;
149 yHelix[0] = yIn[0] + positionMove.
x();
150 yHelix[1] = yIn[1] + positionMove.
y();
151 yHelix[2] = yIn[2] + positionMove.
z();
152 yHelix[3] = velocityVal * endTangent.
x();
153 yHelix[4] = velocityVal * endTangent.
y();
154 yHelix[5] = velocityVal * endTangent.
z();
160 SinT2 = 2.0 * SinT * CosT;
161 CosT2 = 1.0 - 2.0 * SinT * SinT;
162 endTangent = (CosT2 * vperp + SinT2 * B_x_P + vpar);
163 positionMove = R * ( SinT2 * vperp + (1-CosT2) * B_x_P) + h*2 * vpar;
165 yHelix2[0] = yIn[0] + positionMove.
x();
166 yHelix2[1] = yIn[1] + positionMove.
y();
167 yHelix2[2] = yIn[2] + positionMove.
z();
168 yHelix2[3] = velocityVal * endTangent.
x();
169 yHelix2[4] = velocityVal * endTangent.
y();
170 yHelix2[5] = velocityVal * endTangent.
z();
178 R_Helix =std::abs( ptan/(
fUnitConstant * particleCharge*Bmag));
198 const G4int nvar = 6;
210 for(i=0;i<nvar;i++) { yIn[i]=yInput[i]; }
231 yErr[i] = yOut[i] - yTemp[i] ;
CLHEP::Hep3Vector G4ThreeVector
void SetCurve(const G4double Curve)
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)
G4Mag_EqRhs * fPtrMagEqOfMot
G4double GetAngCurve() const
void SetAngCurve(const G4double Ang)
void AdvanceHelix(const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)
double dot(const Hep3Vector &) const
static constexpr double m
G4double GetRadHelix() const
G4double GetInverseCurve(const G4double Momentum, const G4double Bmag)
virtual ~G4MagHelicalStepper()
static constexpr double twopi
void SetRadHelix(const G4double Rad)
static const G4double fUnitConstant
Hep3Vector cross(const Hep3Vector &) const
static constexpr double eplus
virtual void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
static constexpr double c_light
virtual void DumbStepper(const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])=0
static constexpr double pi
void MagFieldEvaluate(const G4double y[], G4ThreeVector &Bfield)
void LinearStep(const G4double yIn[], G4double h, G4double yHelix[]) const
G4double DistChord() const
static constexpr double GeV
static constexpr double tesla