Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4HelixExplicitEuler Class Reference

#include <G4HelixExplicitEuler.hh>

Inheritance diagram for G4HelixExplicitEuler:
Collaboration diagram for G4HelixExplicitEuler:

Public Member Functions

 G4HelixExplicitEuler (G4Mag_EqRhs *EqRhs)
 
 ~G4HelixExplicitEuler ()
 
void Stepper (const G4double y[], const G4double *, G4double h, G4double yout[], G4double yerr[])
 
void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[])
 
G4double DistChord () const
 
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[])
 
G4double DistChord () const
 
- Public Member Functions inherited from G4MagIntegratorStepper
 G4MagIntegratorStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12, bool isFSAL=false)
 
virtual ~G4MagIntegratorStepper ()
 
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
 
G4int IntegrationOrder ()
 
G4EquationOfMotionGetEquationOfMotion ()
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
unsigned long GetfNoRHSCalls ()
 
void ResetfNORHSCalls ()
 
bool IsFSAL ()
 

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 (int order)
 
void SetFSAL (bool flag=true)
 

Detailed Description

Definition at line 48 of file G4HelixExplicitEuler.hh.

Constructor & Destructor Documentation

G4HelixExplicitEuler::G4HelixExplicitEuler ( G4Mag_EqRhs EqRhs)
inline

Definition at line 52 of file G4HelixExplicitEuler.hh.

53  : G4MagHelicalStepper(EqRhs) {}
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)
G4HelixExplicitEuler::~G4HelixExplicitEuler ( )
inline

Definition at line 55 of file G4HelixExplicitEuler.hh.

55 {}

Member Function Documentation

G4double G4HelixExplicitEuler::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 78 of file G4HelixExplicitEuler.cc.

79 {
80  // Implementation : must check whether h/R > 2 pi !!
81  // If( h/R < pi) use G4LineSection::DistLine
82  // Else DistChord=R_helix
83  //
84  G4double distChord;
85  G4double Ang_curve=GetAngCurve();
86 
87 
88  if(Ang_curve<=pi){
89  distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
90  }
91  else
92  if(Ang_curve<twopi){
93  distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
94  }
95  else{
96  distChord=2.*GetRadHelix();
97  }
98 
99  return distChord;
100 
101 }
G4double GetRadHelix() const
static constexpr double twopi
Definition: G4SIunits.hh:76
static constexpr double pi
Definition: G4SIunits.hh:75
double G4double
Definition: G4Types.hh:76
G4double GetAngCurve() const

Here is the call graph for this function:

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

Implements G4MagHelicalStepper.

Definition at line 103 of file G4HelixExplicitEuler.cc.

107 {
108 
109  AdvanceHelix(yIn, Bfld, h, yOut);
110 
111 }
void AdvanceHelix(const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)

Here is the call graph for this function:

G4int G4HelixExplicitEuler::IntegratorOrder ( ) const
inlinevirtual

Implements G4MagIntegratorStepper.

Definition at line 74 of file G4HelixExplicitEuler.hh.

74 { return 1; }
void G4HelixExplicitEuler::Stepper ( const G4double  y[],
const G4double ,
G4double  h,
G4double  yout[],
G4double  yerr[] 
)

Definition at line 43 of file G4HelixExplicitEuler.cc.

49 {
50 
51  //Estimation of the Stepping Angle
52 
53  G4ThreeVector Bfld;
54  MagFieldEvaluate(yInput, Bfld);
55 
56  const G4int nvar = 6 ;
57  G4int i;
58  G4double yTemp[8], yIn[8] ;
59  G4ThreeVector Bfld_midpoint;
60  // Saving yInput because yInput and yOut can be aliases for same array
61  for(i=0;i<nvar;i++) yIn[i]=yInput[i];
62 
63  G4double h = Step * 0.5;
64 
65  // Do full step and two half steps
66  G4double yTemp2[7];
67  AdvanceHelix(yIn, Bfld, h, yTemp2,yTemp);
68  MagFieldEvaluate(yTemp2, Bfld_midpoint) ;
69  AdvanceHelix(yTemp2, Bfld_midpoint, h, yOut);
70 
71  // Error estimation
72  for(i=0;i<nvar;i++) {
73  yErr[i] = yOut[i] - yTemp[i] ;
74  }
75 
76 }
void AdvanceHelix(const G4double yIn[], G4ThreeVector Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=0)
void MagFieldEvaluate(const G4double y[], G4ThreeVector &Bfield)
int G4int
Definition: G4Types.hh:78
Definition: Step.hh:41
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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