Geant4-11
Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
G4HelixMixedStepper Class Reference

#include <G4HelixMixedStepper.hh>

Inheritance diagram for G4HelixMixedStepper:
G4MagHelicalStepper G4MagIntegratorStepper

Public Member Functions

G4double DistChord () const
 
void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])
 
 G4HelixMixedStepper (G4Mag_EqRhs *EqRhs, G4int StepperNumber=-1, G4double Angle_threshold=-1.0)
 
G4double GetAngleThreshold ()
 
G4EquationOfMotionGetEquationOfMotion ()
 
const G4EquationOfMotionGetEquationOfMotion () const
 
unsigned long GetfNoRHSCalls ()
 
G4int GetNumberOfStateVariables () const
 
G4int GetNumberOfVariables () const
 
G4int IntegrationOrder ()
 
G4int IntegratorOrder () const
 
G4bool IsFSAL () const
 
void NormalisePolarizationVector (G4double vec[12])
 
void NormaliseTangentVector (G4double vec[6])
 
void PrintCalls ()
 
void ResetfNORHSCalls ()
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void RightHandSide (const G4double y[], G4double dydx[], G4double field[]) const
 
void SetAngleThreshold (G4double val)
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
G4MagIntegratorStepperSetupStepper (G4Mag_EqRhs *EqRhs, G4int StepperName)
 
void SetVerbose (G4int newvalue)
 
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
 
 ~G4HelixMixedStepper ()
 

Protected Member Functions

void AdvanceHelix (const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)
 
G4double GetAngCurve () const
 
G4double GetCurve () const
 
G4double GetInverseCurve (const G4double Momentum, const G4double Bmag)
 
G4double GetRadHelix () const
 
void LinearStep (const G4double yIn[], G4double h, G4double yHelix[]) const
 
void MagFieldEvaluate (const G4double y[], G4ThreeVector &Bfield)
 
void SetAngCurve (const G4double Ang)
 
void SetCurve (const G4double Curve)
 
void SetFSAL (G4bool flag=true)
 
void SetIntegrationOrder (G4int order)
 
void SetRadHelix (const G4double Rad)
 

Private Attributes

G4double fAngCurve = 0.0
 
G4double fAngle_threshold = -1.0
 
G4EquationOfMotionfEquation_Rhs = nullptr
 
G4int fIntegrationOrder = -1
 
G4bool fIsFSAL = false
 
const G4int fNoIntegrationVariables = 0
 
unsigned long fNoRHSCalls = 0UL
 
const G4int fNoStateVariables = 0
 
G4int fNumCallsHelix = 0
 
G4int fNumCallsRK4 = 0
 
G4Mag_EqRhsfPtrMagEqOfMot = nullptr
 
G4double frCurve = 0.0
 
G4double frHelix = 0.0
 
G4MagIntegratorStepperfRK4Stepper = nullptr
 
G4int fStepperNumber = -1
 
G4int fVerbose = 0
 
G4ThreeVector yFinal
 
G4ThreeVector yInitial
 
G4ThreeVector yMidPoint
 

Static Private Attributes

static const G4double fUnitConstant = 0.299792458*(GeV/(tesla*m))
 

Detailed Description

Definition at line 62 of file G4HelixMixedStepper.hh.

Constructor & Destructor Documentation

◆ G4HelixMixedStepper()

G4HelixMixedStepper::G4HelixMixedStepper ( G4Mag_EqRhs EqRhs,
G4int  StepperNumber = -1,
G4double  Angle_threshold = -1.0 
)

Definition at line 64 of file G4HelixMixedStepper.cc.

68 : G4MagHelicalStepper(EqRhs)
69{
70 if( angleThreshold < 0.0 )
71 {
72 fAngle_threshold = (1.0/3.0)*pi;
73 }
74 else
75 {
76 fAngle_threshold = angleThreshold;
77 }
78
79 if(stepperNumber<0)
80 {
81 // stepperNumber = 4; // Default is RK4 (original)
82 stepperNumber = 745; // Default is DormandPrince745 (ie DoPri5)
83 // stepperNumber = 8; // Default is CashKarp
84 }
85
86 fStepperNumber = stepperNumber; // Store the choice
88}
static constexpr double pi
Definition: G4SIunits.hh:55
G4MagIntegratorStepper * fRK4Stepper
G4MagIntegratorStepper * SetupStepper(G4Mag_EqRhs *EqRhs, G4int StepperName)
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)

References fAngle_threshold, fRK4Stepper, fStepperNumber, pi, and SetupStepper().

◆ ~G4HelixMixedStepper()

G4HelixMixedStepper::~G4HelixMixedStepper ( )

Definition at line 91 of file G4HelixMixedStepper.cc.

92{
93 delete fRK4Stepper;
94 if (fVerbose>0) { PrintCalls(); }
95}

References fRK4Stepper, fVerbose, and PrintCalls().

Member Function Documentation

◆ AdvanceHelix()

void G4MagHelicalStepper::AdvanceHelix ( const G4double  yIn[],
G4ThreeVector  Bfld,
G4double  h,
G4double  yHelix[],
G4double  yHelix2[] = 0 
)
protectedinherited

Definition at line 57 of file G4MagHelicalStepper.cc.

62{
63 // const G4int nvar = 6;
64
65 // OLD const G4double approc_limit = 0.05;
66 // OLD approc_limit = 0.05 gives max.error=x^5/5!=(0.05)^5/5!=2.6*e-9
67 // NEW approc_limit = 0.005 gives max.error=x^5/5!=2.6*e-14
68
69 const G4double approc_limit = 0.005;
70 G4ThreeVector Bnorm, B_x_P, vperp, vpar;
71
72 G4double B_d_P;
73 G4double B_v_P;
74 G4double Theta;
75 G4double R_1;
76 G4double R_Helix;
77 G4double CosT2, SinT2, CosT, SinT;
78 G4ThreeVector positionMove, endTangent;
79
80 G4double Bmag = Bfld.mag();
81 const G4double* pIn = yIn+3;
82 G4ThreeVector initVelocity = G4ThreeVector( pIn[0], pIn[1], pIn[2]);
83 G4double velocityVal = initVelocity.mag();
84 G4ThreeVector initTangent = (1.0/velocityVal) * initVelocity;
85
86 R_1 = GetInverseCurve(velocityVal,Bmag);
87
88 // for too small magnetic fields there is no curvature
89 // (include momentum here) FIXME
90
91 if( (std::fabs(R_1) < 1e-10)||(Bmag<1e-12) )
92 {
93 LinearStep( yIn, h, yHelix );
94
95 // Store and/or calculate parameters for chord distance
96
97 SetAngCurve(1.);
98 SetCurve(h);
99 SetRadHelix(0.);
100 }
101 else
102 {
103 Bnorm = (1.0/Bmag)*Bfld;
104
105 // calculate the direction of the force
106
107 B_x_P = Bnorm.cross(initTangent);
108
109 // parallel and perp vectors
110
111 B_d_P = Bnorm.dot(initTangent); // this is the fraction of P parallel to B
112
113 vpar = B_d_P * Bnorm; // the component parallel to B
114 vperp= initTangent - vpar; // the component perpendicular to B
115
116 B_v_P = std::sqrt( 1 - B_d_P * B_d_P); // Fraction of P perp to B
117
118 // calculate the stepping angle
119
120 Theta = R_1 * h; // * B_v_P;
121
122 // Trigonometrix
123
124 if( std::fabs(Theta) > approc_limit )
125 {
126 SinT = std::sin(Theta);
127 CosT = std::cos(Theta);
128 }
129 else
130 {
131 G4double Theta2 = Theta*Theta;
132 G4double Theta3 = Theta2 * Theta;
133 G4double Theta4 = Theta2 * Theta2;
134 SinT = Theta - 1.0/6.0 * Theta3;
135 CosT = 1 - 0.5 * Theta2 + 1.0/24.0 * Theta4;
136 }
137
138 // the actual "rotation"
139
140 G4double R = 1.0 / R_1;
141
142 positionMove = R * ( SinT * vperp + (1-CosT) * B_x_P) + h * vpar;
143 endTangent = CosT * vperp + SinT * B_x_P + vpar;
144
145 // Store the resulting position and tangent
146
147 yHelix[0] = yIn[0] + positionMove.x();
148 yHelix[1] = yIn[1] + positionMove.y();
149 yHelix[2] = yIn[2] + positionMove.z();
150 yHelix[3] = velocityVal * endTangent.x();
151 yHelix[4] = velocityVal * endTangent.y();
152 yHelix[5] = velocityVal * endTangent.z();
153
154 // Store 2*h step Helix if exist
155
156 if(yHelix2)
157 {
158 SinT2 = 2.0 * SinT * CosT;
159 CosT2 = 1.0 - 2.0 * SinT * SinT;
160 endTangent = (CosT2 * vperp + SinT2 * B_x_P + vpar);
161 positionMove = R * ( SinT2 * vperp + (1-CosT2) * B_x_P) + h*2 * vpar;
162
163 yHelix2[0] = yIn[0] + positionMove.x();
164 yHelix2[1] = yIn[1] + positionMove.y();
165 yHelix2[2] = yIn[2] + positionMove.z();
166 yHelix2[3] = velocityVal * endTangent.x();
167 yHelix2[4] = velocityVal * endTangent.y();
168 yHelix2[5] = velocityVal * endTangent.z();
169 }
170
171 // Store and/or calculate parameters for chord distance
172
173 G4double ptan=velocityVal*B_v_P;
174
175 G4double particleCharge = fPtrMagEqOfMot->FCof() / (eplus*c_light);
176 R_Helix =std::abs( ptan/(fUnitConstant * particleCharge*Bmag));
177
178 SetAngCurve(std::abs(Theta));
179 SetCurve(std::abs(R));
180 SetRadHelix(R_Helix);
181 }
182}
static constexpr double eplus
Definition: G4SIunits.hh:184
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83
double z() const
double x() const
double y() const
Hep3Vector cross(const Hep3Vector &) const
double dot(const Hep3Vector &) const
double mag() const
static const G4double fUnitConstant
void SetCurve(const G4double Curve)
void SetRadHelix(const G4double Rad)
G4double GetInverseCurve(const G4double Momentum, const G4double Bmag)
void LinearStep(const G4double yIn[], G4double h, G4double yHelix[]) const
void SetAngCurve(const G4double Ang)
G4double FCof() const
Definition: G4Mag_EqRhs.hh:62
float c_light
Definition: hepunit.py:256

References source.hepunit::c_light, CLHEP::Hep3Vector::cross(), CLHEP::Hep3Vector::dot(), eplus, G4Mag_EqRhs::FCof(), G4MagHelicalStepper::fPtrMagEqOfMot, G4MagHelicalStepper::fUnitConstant, G4MagHelicalStepper::GetInverseCurve(), G4MagHelicalStepper::LinearStep(), CLHEP::Hep3Vector::mag(), G4MagHelicalStepper::SetAngCurve(), G4MagHelicalStepper::SetCurve(), G4MagHelicalStepper::SetRadHelix(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by G4ExactHelixStepper::DumbStepper(), G4HelixExplicitEuler::DumbStepper(), G4HelixHeum::DumbStepper(), G4HelixImplicitEuler::DumbStepper(), DumbStepper(), G4HelixSimpleRunge::DumbStepper(), G4HelixExplicitEuler::Stepper(), G4ExactHelixStepper::Stepper(), and Stepper().

◆ DistChord()

G4double G4HelixMixedStepper::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 178 of file G4HelixMixedStepper.cc.

179{
180 // Implementation : must check whether h/R > 2 pi !!
181 // If( h/R < pi) use G4LineSection::DistLine
182 // Else DistChord=R_helix
183 //
184 G4double distChord;
185 G4double Ang_curve=GetAngCurve();
186
187 if(Ang_curve<=pi)
188 {
189 distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
190 }
191 else
192 {
193 if(Ang_curve<twopi)
194 {
195 distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
196 }
197 else
198 {
199 distChord=2.*GetRadHelix();
200 }
201 }
202
203 return distChord;
204}
static constexpr double twopi
Definition: G4SIunits.hh:56
G4double GetRadHelix() const
G4double GetAngCurve() const

References G4MagHelicalStepper::GetAngCurve(), G4MagHelicalStepper::GetRadHelix(), pi, and twopi.

◆ DumbStepper()

void G4HelixMixedStepper::DumbStepper ( const G4double  y[],
G4ThreeVector  Bfld,
G4double  h,
G4double  yout[] 
)
virtual

Implements G4MagHelicalStepper.

Definition at line 169 of file G4HelixMixedStepper.cc.

173{
174 AdvanceHelix(yIn, Bfld, h, yOut);
175}
void AdvanceHelix(const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)

References G4MagHelicalStepper::AdvanceHelix().

◆ GetAngCurve()

G4double G4MagHelicalStepper::GetAngCurve ( ) const
inlineprotectedinherited

◆ GetAngleThreshold()

G4double G4HelixMixedStepper::GetAngleThreshold ( )
inline

Definition at line 99 of file G4HelixMixedStepper.hh.

99{ return fAngle_threshold; }

References fAngle_threshold.

◆ GetCurve()

G4double G4MagHelicalStepper::GetCurve ( ) const
inlineprotectedinherited

◆ GetEquationOfMotion() [1/2]

G4EquationOfMotion * G4MagIntegratorStepper::GetEquationOfMotion ( )
inlineinherited

◆ GetEquationOfMotion() [2/2]

const G4EquationOfMotion * G4MagIntegratorStepper::GetEquationOfMotion ( ) const
inlineinherited

◆ GetfNoRHSCalls()

unsigned long G4MagIntegratorStepper::GetfNoRHSCalls ( )
inlineinherited

◆ GetInverseCurve()

G4double G4MagHelicalStepper::GetInverseCurve ( const G4double  Momentum,
const G4double  Bmag 
)
inlineprotectedinherited

◆ GetNumberOfStateVariables()

G4int G4MagIntegratorStepper::GetNumberOfStateVariables ( ) const
inlineinherited

◆ GetNumberOfVariables()

G4int G4MagIntegratorStepper::GetNumberOfVariables ( ) const
inlineinherited

◆ GetRadHelix()

G4double G4MagHelicalStepper::GetRadHelix ( ) const
inlineprotectedinherited

◆ IntegrationOrder()

G4int G4MagIntegratorStepper::IntegrationOrder ( )
inlineinherited

◆ IntegratorOrder()

G4int G4HelixMixedStepper::IntegratorOrder ( ) const
inlinevirtual

Implements G4MagIntegratorStepper.

Definition at line 100 of file G4HelixMixedStepper.hh.

100{ return 4; }

◆ IsFSAL()

G4bool G4MagIntegratorStepper::IsFSAL ( ) const
inlineinherited

◆ LinearStep()

void G4MagHelicalStepper::LinearStep ( const G4double  yIn[],
G4double  h,
G4double  yHelix[] 
) const
inlineprotectedinherited

◆ MagFieldEvaluate()

void G4MagHelicalStepper::MagFieldEvaluate ( const G4double  y[],
G4ThreeVector Bfield 
)
inlineprotectedinherited

◆ NormalisePolarizationVector()

void G4MagIntegratorStepper::NormalisePolarizationVector ( G4double  vec[12])
inlineinherited

◆ NormaliseTangentVector()

void G4MagIntegratorStepper::NormaliseTangentVector ( G4double  vec[6])
inlineinherited

◆ PrintCalls()

void G4HelixMixedStepper::PrintCalls ( )

Definition at line 207 of file G4HelixMixedStepper.cc.

208{
209 G4cout << "In HelixMixedStepper::Number of calls to smallStepStepper = "
210 << fNumCallsRK4
211 << " and Number of calls to Helix = " << fNumCallsHelix << G4endl;
212}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

References fNumCallsHelix, fNumCallsRK4, G4cout, and G4endl.

Referenced by ~G4HelixMixedStepper().

◆ ResetfNORHSCalls()

void G4MagIntegratorStepper::ResetfNORHSCalls ( )
inlineinherited

◆ RightHandSide() [1/2]

void G4MagIntegratorStepper::RightHandSide ( const G4double  y[],
G4double  dydx[] 
) const
inlineinherited

◆ RightHandSide() [2/2]

void G4MagIntegratorStepper::RightHandSide ( const G4double  y[],
G4double  dydx[],
G4double  field[] 
) const
inlineinherited

◆ SetAngCurve()

void G4MagHelicalStepper::SetAngCurve ( const G4double  Ang)
inlineprotectedinherited

◆ SetAngleThreshold()

void G4HelixMixedStepper::SetAngleThreshold ( G4double  val)
inline

Definition at line 98 of file G4HelixMixedStepper.hh.

98{ fAngle_threshold = val; }

References fAngle_threshold.

◆ SetCurve()

void G4MagHelicalStepper::SetCurve ( const G4double  Curve)
inlineprotectedinherited

◆ SetEquationOfMotion()

void G4MagIntegratorStepper::SetEquationOfMotion ( G4EquationOfMotion newEquation)
inlineinherited

◆ SetFSAL()

void G4MagIntegratorStepper::SetFSAL ( G4bool  flag = true)
inlineprotectedinherited

◆ SetIntegrationOrder()

void G4MagIntegratorStepper::SetIntegrationOrder ( G4int  order)
inlineprotectedinherited

◆ SetRadHelix()

void G4MagHelicalStepper::SetRadHelix ( const G4double  Rad)
inlineprotectedinherited

◆ SetupStepper()

G4MagIntegratorStepper * G4HelixMixedStepper::SetupStepper ( G4Mag_EqRhs EqRhs,
G4int  StepperName 
)

Definition at line 216 of file G4HelixMixedStepper.cc.

217{
218 G4MagIntegratorStepper* pStepper;
219 if (fVerbose>0) G4cout << " G4HelixMixedStepper: ";
220 switch ( StepperNumber )
221 {
222 // Robust, classic method
223 case 4:
224 pStepper = new G4ClassicalRK4( pE );
225 if (fVerbose>0) G4cout << "G4ClassicalRK4";
226 break;
227
228 // Steppers with embedded estimation of error
229 case 8:
230 pStepper = new G4CashKarpRKF45( pE );
231 if (fVerbose>0) G4cout << "G4CashKarpRKF45";
232 break;
233 case 13:
234 pStepper = new G4NystromRK4( pE );
235 if (fVerbose>0) G4cout << "G4NystromRK4";
236 break;
237
238 // Lowest order RK Stepper - experimental
239 case 1:
240 pStepper = new G4ImplicitEuler( pE );
241 if (fVerbose>0) G4cout << "G4ImplicitEuler";
242 break;
243
244 // Lower order RK Steppers - ok overall, good for uneven fields
245 case 2:
246 pStepper = new G4SimpleRunge( pE );
247 if (fVerbose>0) G4cout << "G4SimpleRunge";
248 break;
249 case 3:
250 pStepper = new G4SimpleHeum( pE );
251 if (fVerbose>0) G4cout << "G4SimpleHeum";
252 break;
253 case 23:
254 pStepper = new G4BogackiShampine23( pE );
255 if (fVerbose>0) G4cout << "G4BogackiShampine23";
256 break;
257
258 // Higher order RK Steppers
259 // for smoother fields and high accuracy requirements
260 case 45:
261 pStepper = new G4BogackiShampine45( pE );
262 if (fVerbose>0) G4cout << "G4BogackiShampine45";
263 break;
264 case 145:
265 pStepper = new G4TsitourasRK45( pE );
266 if (fVerbose>0) G4cout << "G4TsitourasRK45";
267 break;
268 case 745:
269 pStepper = new G4DormandPrince745( pE );
270 if (fVerbose>0) G4cout << "G4DormandPrince745";
271 break;
272
273 // Helical Steppers
274 case 6:
275 pStepper = new G4HelixImplicitEuler( pE );
276 if (fVerbose>0) G4cout << "G4HelixImplicitEuler";
277 break;
278 case 7:
279 pStepper = new G4HelixSimpleRunge( pE );
280 if (fVerbose>0) G4cout << "G4HelixSimpleRunge";
281 break;
282 case 5:
283 pStepper = new G4HelixExplicitEuler( pE );
284 if (fVerbose>0) G4cout << "G4HelixExplicitEuler";
285 break; // Since Helix Explicit is used for long steps,
286 // this is useful only to measure overhead.
287 // Exact Helix - likely good only for cases of
288 // i) uniform field (potentially over small distances)
289 // ii) segmented uniform field (maybe)
290 case 9:
291 pStepper = new G4ExactHelixStepper( pE );
292 if (fVerbose>0) G4cout << "G4ExactHelixStepper";
293 break;
294 case 10:
295 pStepper = new G4RKG3_Stepper( pE );
296 if (fVerbose>0) G4cout << "G4RKG3_Stepper";
297 break;
298
299 // Low Order Steppers - not good except for very weak fields
300 case 11:
301 pStepper = new G4ExplicitEuler( pE );
302 if (fVerbose>0) G4cout << "G4ExplicitEuler";
303 break;
304 case 12:
305 pStepper = new G4ImplicitEuler( pE );
306 if (fVerbose>0) G4cout << "G4ImplicitEuler";
307 break;
308
309 case 0:
310 case -1:
311 default:
312 pStepper = new G4DormandPrince745( pE ); // Was G4ClassicalRK4( pE );
313 if (fVerbose>0) G4cout << "G4DormandPrince745 (Default)";
314 break;
315 }
316
317 if(fVerbose>0)
318 {
319 G4cout << " chosen as stepper for small steps in G4HelixMixedStepper."
320 << G4endl;
321 }
322
323 return pStepper;
324}

References fVerbose, G4cout, and G4endl.

Referenced by G4HelixMixedStepper().

◆ SetVerbose()

void G4HelixMixedStepper::SetVerbose ( G4int  newvalue)
inline

Definition at line 91 of file G4HelixMixedStepper.hh.

91{ fVerbose = newvalue; }

References fVerbose.

◆ Stepper()

void G4HelixMixedStepper::Stepper ( const G4double  y[],
const G4double  dydx[],
G4double  h,
G4double  yout[],
G4double  yerr[] 
)
virtual

Reimplemented from G4MagHelicalStepper.

Definition at line 98 of file G4HelixMixedStepper.cc.

103{
104 // Estimation of the Stepping Angle
105 //
106 G4ThreeVector Bfld;
107 MagFieldEvaluate(yInput, Bfld);
108
109 G4double Bmag = Bfld.mag();
110 const G4double* pIn = yInput+3;
111 G4ThreeVector initVelocity = G4ThreeVector( pIn[0], pIn[1], pIn[2] );
112 G4double velocityVal = initVelocity.mag();
113
114 const G4double R_1 = std::abs(GetInverseCurve(velocityVal,Bmag));
115 // curv = inverse Radius
116 G4double Ang_curve = R_1 * Step;
117 // SetAngCurve(Ang_curve);
118 // SetCurve(std::abs(1/R_1));
119
120 if(Ang_curve < fAngle_threshold)
121 {
122 ++fNumCallsRK4;
123 fRK4Stepper->Stepper(yInput,dydx,Step,yOut,yErr);
124 }
125 else
126 {
127 constexpr G4int nvar = 6 ;
128 constexpr G4int nvarMax = 8 ;
129 G4double yTemp[nvarMax], yIn[nvarMax], yTemp2[nvarMax];
130 G4ThreeVector Bfld_midpoint;
131
132 SetAngCurve(Ang_curve);
133 SetCurve(std::abs(1.0/R_1));
135
136 // Saving yInput because yInput and yOut can be aliases for same array
137 //
138 for(G4int i=0; i<nvar; ++i)
139 {
140 yIn[i]=yInput[i];
141 }
142
143 G4double halfS = Step * 0.5;
144
145 // 1. Do first half step and full step
146 //
147 AdvanceHelix(yIn, Bfld, halfS, yTemp, yTemp2); // yTemp2 for s=2*h (halfS)
148
149 MagFieldEvaluate(yTemp, Bfld_midpoint) ;
150
151 // 2. Do second half step - with revised field
152 // NOTE: Could avoid this call if 'Bfld_midpoint == Bfld'
153 // or diff 'almost' zero
154 //
155 AdvanceHelix(yTemp, Bfld_midpoint, halfS, yOut);
156 // Not requesting y at s=2*h (halfS)
157
158 // 3. Estimate the integration error
159 // should be (nearly) zero if Bfield= constant
160 //
161 for(G4int i=0; i<nvar; ++i)
162 {
163 yErr[i] = yOut[i] - yTemp2[i];
164 }
165 }
166}
int G4int
Definition: G4Types.hh:85
void MagFieldEvaluate(const G4double y[], G4ThreeVector &Bfield)
virtual void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])=0

References G4MagHelicalStepper::AdvanceHelix(), fAngle_threshold, fNumCallsHelix, fNumCallsRK4, fRK4Stepper, G4MagHelicalStepper::GetInverseCurve(), CLHEP::Hep3Vector::mag(), G4MagHelicalStepper::MagFieldEvaluate(), G4MagHelicalStepper::SetAngCurve(), G4MagHelicalStepper::SetCurve(), and G4MagIntegratorStepper::Stepper().

Field Documentation

◆ fAngCurve

G4double G4MagHelicalStepper::fAngCurve = 0.0
privateinherited

Definition at line 120 of file G4MagHelicalStepper.hh.

◆ fAngle_threshold

G4double G4HelixMixedStepper::fAngle_threshold = -1.0
private

◆ fEquation_Rhs

G4EquationOfMotion* G4MagIntegratorStepper::fEquation_Rhs = nullptr
privateinherited

Definition at line 124 of file G4MagIntegratorStepper.hh.

◆ fIntegrationOrder

G4int G4MagIntegratorStepper::fIntegrationOrder = -1
privateinherited

Definition at line 134 of file G4MagIntegratorStepper.hh.

◆ fIsFSAL

G4bool G4MagIntegratorStepper::fIsFSAL = false
privateinherited

Definition at line 136 of file G4MagIntegratorStepper.hh.

◆ fNoIntegrationVariables

const G4int G4MagIntegratorStepper::fNoIntegrationVariables = 0
privateinherited

Definition at line 125 of file G4MagIntegratorStepper.hh.

◆ fNoRHSCalls

unsigned long G4MagIntegratorStepper::fNoRHSCalls = 0UL
mutableprivateinherited

Definition at line 128 of file G4MagIntegratorStepper.hh.

◆ fNoStateVariables

const G4int G4MagIntegratorStepper::fNoStateVariables = 0
privateinherited

Definition at line 126 of file G4MagIntegratorStepper.hh.

◆ fNumCallsHelix

G4int G4HelixMixedStepper::fNumCallsHelix = 0
private

Definition at line 117 of file G4HelixMixedStepper.hh.

Referenced by PrintCalls(), and Stepper().

◆ fNumCallsRK4

G4int G4HelixMixedStepper::fNumCallsRK4 = 0
private

Definition at line 116 of file G4HelixMixedStepper.hh.

Referenced by PrintCalls(), and Stepper().

◆ fPtrMagEqOfMot

G4Mag_EqRhs* G4MagHelicalStepper::fPtrMagEqOfMot = nullptr
privateinherited

Definition at line 116 of file G4MagHelicalStepper.hh.

Referenced by G4MagHelicalStepper::AdvanceHelix().

◆ frCurve

G4double G4MagHelicalStepper::frCurve = 0.0
privateinherited

Definition at line 121 of file G4MagHelicalStepper.hh.

◆ frHelix

G4double G4MagHelicalStepper::frHelix = 0.0
privateinherited

Definition at line 122 of file G4MagHelicalStepper.hh.

◆ fRK4Stepper

G4MagIntegratorStepper* G4HelixMixedStepper::fRK4Stepper = nullptr
private

Definition at line 104 of file G4HelixMixedStepper.hh.

Referenced by G4HelixMixedStepper(), Stepper(), and ~G4HelixMixedStepper().

◆ fStepperNumber

G4int G4HelixMixedStepper::fStepperNumber = -1
private

Definition at line 106 of file G4HelixMixedStepper.hh.

Referenced by G4HelixMixedStepper().

◆ fUnitConstant

const G4double G4MagHelicalStepper::fUnitConstant = 0.299792458*(GeV/(tesla*m))
staticprivateinherited

Definition at line 113 of file G4MagHelicalStepper.hh.

Referenced by G4MagHelicalStepper::AdvanceHelix().

◆ fVerbose

G4int G4HelixMixedStepper::fVerbose = 0
private

Definition at line 114 of file G4HelixMixedStepper.hh.

Referenced by SetupStepper(), SetVerbose(), and ~G4HelixMixedStepper().

◆ yFinal

G4ThreeVector G4MagHelicalStepper::yFinal
privateinherited

Definition at line 123 of file G4MagHelicalStepper.hh.

◆ yInitial

G4ThreeVector G4MagHelicalStepper::yInitial
privateinherited

Definition at line 123 of file G4MagHelicalStepper.hh.

◆ yMidPoint

G4ThreeVector G4MagHelicalStepper::yMidPoint
privateinherited

Definition at line 123 of file G4MagHelicalStepper.hh.


The documentation for this class was generated from the following files: