Geant4 11.2.2
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 () override
 
 G4ExactHelixStepper (const G4ExactHelixStepper &)=delete
 
G4ExactHelixStepperoperator= (const G4ExactHelixStepper &)=delete
 
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
 
void DumbStepper (const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[]) override
 
G4double DistChord () const override
 
G4int IntegratorOrder () const override
 
- Public Member Functions inherited from G4MagHelicalStepper
 G4MagHelicalStepper (G4Mag_EqRhs *EqRhs)
 
 ~G4MagHelicalStepper () override
 
 G4MagHelicalStepper (const G4MagHelicalStepper &)=delete
 
G4MagHelicalStepperoperator= (const G4MagHelicalStepper &)=delete
 
void Stepper (const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
 
G4double DistChord () const override
 
- 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
 
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
 
G4int IntegrationOrder ()
 
G4EquationOfMotionGetEquationOfMotion ()
 
const G4EquationOfMotionGetEquationOfMotion () const
 
void SetEquationOfMotion (G4EquationOfMotion *newEquation)
 
unsigned long GetfNoRHSCalls ()
 
void ResetfNORHSCalls ()
 
G4bool IsFSAL () const
 
G4bool isQSS () const
 
void SetIsQSS (G4bool val)
 

Additional Inherited Members

- Protected Member Functions inherited from G4MagHelicalStepper
void LinearStep (const G4double yIn[], G4double h, G4double yHelix[]) const
 
void AdvanceHelix (const G4double yIn[], const G4ThreeVector &Bfld, G4double h, G4double yHelix[], G4double yHelix2[]=nullptr)
 
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}
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)
#define DBL_MAX
Definition templates.hh:62

◆ ~G4ExactHelixStepper()

G4ExactHelixStepper::~G4ExactHelixStepper ( )
overridedefault

◆ G4ExactHelixStepper() [2/2]

G4ExactHelixStepper::G4ExactHelixStepper ( const G4ExactHelixStepper & )
delete

Member Function Documentation

◆ DistChord()

G4double G4ExactHelixStepper::DistChord ( ) const
overridevirtual

Implements G4MagIntegratorStepper.

Definition at line 93 of file G4ExactHelixStepper.cc.

94{
95 // Implementation : must check whether h/R > pi !!
96 // If( h/R < pi) DistChord=h/2*std::tan(Ang_curve/4)
97 // Else DistChord=R_helix
98
99 G4double distChord;
100 G4double Ang_curve=GetAngCurve();
101
102 if (Ang_curve<=pi)
103 {
104 distChord=GetRadHelix()*(1-std::cos(0.5*Ang_curve));
105 }
106 else if(Ang_curve<twopi)
107 {
108 distChord=GetRadHelix()*(1+std::cos(0.5*(twopi-Ang_curve)));
109 }
110 else
111 {
112 distChord=2.*GetRadHelix();
113 }
114
115 return distChord;
116}
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[] )
overridevirtual

Implements G4MagHelicalStepper.

Definition at line 75 of file G4ExactHelixStepper.cc.

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

◆ IntegratorOrder()

G4int G4ExactHelixStepper::IntegratorOrder ( ) const
overridevirtual

Implements G4MagIntegratorStepper.

Definition at line 121 of file G4ExactHelixStepper.cc.

122{
123 return 1;
124}

◆ operator=()

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

◆ Stepper()

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

Implements G4MagIntegratorStepper.

Definition at line 48 of file G4ExactHelixStepper.cc.

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

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