Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4ExactHelixStepper Class Reference

#include <G4ExactHelixStepper.hh>

Inheritance diagram for G4ExactHelixStepper:
G4MagHelicalStepper G4MagIntegratorStepper

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 ()
 
G4double DistChord () const
 
- Public Member Functions inherited from G4MagIntegratorStepper
 G4MagIntegratorStepper (G4EquationOfMotion *Equation, G4int numIntegrationVariables, G4int numStateVariables=12)
 
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
 
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 ( 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 }
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)
#define DBL_MAX
Definition: templates.hh:83
G4ExactHelixStepper::~G4ExactHelixStepper ( )

Definition at line 53 of file G4ExactHelixStepper.cc.

53 {}

Member Function Documentation

G4double G4ExactHelixStepper::DistChord ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 99 of file G4ExactHelixStepper.cc.

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

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 }
G4double GetRadHelix() const
double G4double
Definition: G4Types.hh:76
G4double GetAngCurve() const
void G4ExactHelixStepper::DumbStepper ( const G4double  y[],
G4ThreeVector  Bfld,
G4double  h,
G4double  yout[] 
)
virtual

Implements G4MagHelicalStepper.

Definition at line 81 of file G4ExactHelixStepper.cc.

References G4MagHelicalStepper::AdvanceHelix(), FatalException, and G4Exception().

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 }
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
G4int G4ExactHelixStepper::IntegratorOrder ( ) const
virtual

Implements G4MagIntegratorStepper.

Definition at line 125 of file G4ExactHelixStepper.cc.

126 {
127  return 1;
128 }
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.

References G4MagHelicalStepper::AdvanceHelix(), and G4MagHelicalStepper::MagFieldEvaluate().

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 }
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

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