Geant4 9.6.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 ()
 
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 ()
 
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)
 
virtual ~G4MagIntegratorStepper ()
 
virtual void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[])=0
 
virtual G4double DistChord () const =0
 
virtual void ComputeRightHandSide (const G4double y[], G4double dydx[])
 
void NormaliseTangentVector (G4double vec[6])
 
void NormalisePolarizationVector (G4double vec[12])
 
void RightHandSide (const double y[], double dydx[])
 
G4int GetNumberOfVariables () const
 
G4int GetNumberOfStateVariables () const
 
virtual G4int IntegratorOrder () const =0
 
G4EquationOfMotionGetEquationOfMotion ()
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 

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
 

Detailed Description

Definition at line 49 of file G4ExactHelixStepper.hh.

Constructor & Destructor Documentation

◆ G4ExactHelixStepper()

G4ExactHelixStepper::G4ExactHelixStepper ( G4Mag_EqRhs EqRhs)

Definition at line 45 of file G4ExactHelixStepper.cc.

46 : G4MagHelicalStepper(EqRhs),
47 fBfieldValue(DBL_MAX, DBL_MAX, DBL_MAX),
48 fPtrMagEqOfMot(EqRhs)
49{
50 ;
51}
#define DBL_MAX
Definition: templates.hh:83

◆ ~G4ExactHelixStepper()

G4ExactHelixStepper::~G4ExactHelixStepper ( )

Definition at line 53 of file G4ExactHelixStepper.cc.

53{}

Member Function Documentation

◆ DistChord()

G4double G4ExactHelixStepper::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 99 of file G4ExactHelixStepper.cc.

100{
101 // Implementation : must check whether h/R > pi !!
102 // If( h/R < pi) DistChord=h/2*std::tan(Ang_curve/4)
103 // Else DistChord=R_helix
104
105 G4double distChord;
106 G4double Ang_curve=GetAngCurve();
107
108 if (Ang_curve<=pi)
109 {
110 distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
111 }
112 else if(Ang_curve<twopi)
113 {
114 distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
115 }
116 else
117 {
118 distChord=2.*GetRadHelix();
119 }
120
121 return distChord;
122}
double G4double
Definition: G4Types.hh:64
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 81 of file G4ExactHelixStepper.cc.

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

◆ IntegratorOrder()

G4int G4ExactHelixStepper::IntegratorOrder ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 125 of file G4ExactHelixStepper.cc.

126{
127 return 1;
128}

◆ Stepper()

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

Reimplemented from G4MagHelicalStepper.

Definition at line 56 of file G4ExactHelixStepper.cc.

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

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