Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ExactHelixStepper Class Reference

#include <G4ExactHelixStepper.hh>

+ Inheritance diagram for G4ExactHelixStepper:

Public Member Functions

 G4ExactHelixStepper (G4Mag_EqRhs *EqRhs)
 
 ~G4ExactHelixStepper ()
 
 G4ExactHelixStepper (const G4ExactHelixStepper &)=delete
 
G4ExactHelixStepperoperator= (const G4ExactHelixStepper &)=delete
 
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
 
void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])
 
G4double DistChord () const
 
virtual G4int IntegratorOrder () const
 
- Public Member Functions inherited from G4MagHelicalStepper
 G4MagHelicalStepper (G4Mag_EqRhs *EqRhs)
 
virtual ~G4MagHelicalStepper ()
 
 G4MagHelicalStepper (const G4MagHelicalStepper &)=delete
 
G4MagHelicalStepperoperator= (const G4MagHelicalStepper &)=delete
 
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])
 
virtual void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])=0
 
G4double DistChord () const
 
- Public Member Functions inherited from G4MagIntegratorStepper
 G4MagIntegratorStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, G4bool isFSAL=false)
 
virtual ~G4MagIntegratorStepper ()=default
 
 G4MagIntegratorStepper (const G4MagIntegratorStepper &)=delete
 
G4MagIntegratorStepperoperator= (const G4MagIntegratorStepper &)=delete
 
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])=0
 
virtual G4double DistChord () const =0
 
void NormaliseTangentVector (G4double vec[6])
 
void NormalisePolarizationVector (G4double vec[12])
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void RightHandSide (const G4double y[], G4double dydx[], G4double field[]) const
 
G4int GetNumberOfVariables () const
 
G4int GetNumberOfStateVariables () const
 
virtual G4int IntegratorOrder () const =0
 
G4int IntegrationOrder ()
 
G4EquationOfMotionGetEquationOfMotion ()
 
const G4EquationOfMotionGetEquationOfMotion () const
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
unsigned long GetfNoRHSCalls ()
 
void ResetfNORHSCalls ()
 
G4bool IsFSAL () const
 

Additional Inherited Members

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

Detailed Description

Definition at line 51 of file G4ExactHelixStepper.hh.

Constructor & Destructor Documentation

◆ G4ExactHelixStepper() [1/2]

G4ExactHelixStepper::G4ExactHelixStepper ( G4Mag_EqRhs EqRhs)

Definition at line 37 of file G4ExactHelixStepper.cc.

38 : G4MagHelicalStepper(EqRhs),
39 fBfieldValue(DBL_MAX, DBL_MAX, DBL_MAX)
40{
41}
#define DBL_MAX
Definition: templates.hh:62

◆ ~G4ExactHelixStepper()

G4ExactHelixStepper::~G4ExactHelixStepper ( )

Definition at line 43 of file G4ExactHelixStepper.cc.

44{
45}

◆ G4ExactHelixStepper() [2/2]

G4ExactHelixStepper::G4ExactHelixStepper ( const G4ExactHelixStepper )
delete

Member Function Documentation

◆ DistChord()

G4double G4ExactHelixStepper::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 95 of file G4ExactHelixStepper.cc.

96{
97 // Implementation : must check whether h/R > pi !!
98 // If( h/R < pi) DistChord=h/2*std::tan(Ang_curve/4)
99 // Else DistChord=R_helix
100
101 G4double distChord;
102 G4double Ang_curve=GetAngCurve();
103
104 if (Ang_curve<=pi)
105 {
106 distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
107 }
108 else if(Ang_curve<twopi)
109 {
110 distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
111 }
112 else
113 {
114 distChord=2.*GetRadHelix();
115 }
116
117 return distChord;
118}
double G4double
Definition: G4Types.hh:83
G4double GetRadHelix() const
G4double GetAngCurve() const

◆ DumbStepper()

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

Implements G4MagHelicalStepper.

Definition at line 77 of file G4ExactHelixStepper.cc.

81{
82 // Assuming a constant field: solution is a helix
83
84 AdvanceHelix(yIn, Bfld, h, yOut);
85
86 G4Exception("G4ExactHelixStepper::DumbStepper",
87 "GeomField0002", FatalException,
88 "Should not be called. Stepper must do all the work." );
89}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
void AdvanceHelix(const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)

◆ IntegratorOrder()

G4int G4ExactHelixStepper::IntegratorOrder ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 123 of file G4ExactHelixStepper.cc.

124{
125 return 1;
126}

◆ operator=()

G4ExactHelixStepper & G4ExactHelixStepper::operator= ( const G4ExactHelixStepper )
delete

◆ Stepper()

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

Reimplemented from G4MagHelicalStepper.

Definition at line 50 of file G4ExactHelixStepper.cc.

55{
56 const G4int nvar = 6;
57
58 G4int i;
59 G4ThreeVector Bfld_value;
60
61 MagFieldEvaluate(yInput, Bfld_value);
62 AdvanceHelix(yInput, Bfld_value, hstep, yOut);
63
64 // We are assuming a constant field: helix is exact
65 //
66 for(i=0; i<nvar; ++i)
67 {
68 yErr[i] = 0.0 ;
69 }
70
71 fBfieldValue = Bfld_value;
72}
int G4int
Definition: G4Types.hh:85
void MagFieldEvaluate(const G4double y[], G4ThreeVector &Bfield)

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