Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TMagFieldEquation< T_Field > Class Template Reference

#include <G4TMagFieldEquation.hh>

+ Inheritance diagram for G4TMagFieldEquation< T_Field >:

Public Member Functions

 G4TMagFieldEquation (T_Field *f)
 
virtual ~G4TMagFieldEquation ()
 
void GetFieldValue (const G4double Point[4], G4double Field[]) const
 
void TEvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const
 
 __attribute__ ((always_inline)) void RightHandSide(const G4double y[]
 
 GetFieldValue (PositionAndTime, Field)
 
 TEvaluateRhsGivenB (y, Field, dydx)
 
- Public Member Functions inherited from G4Mag_UsualEqRhs
 G4Mag_UsualEqRhs (G4MagneticField *MagField)
 
virtual ~G4Mag_UsualEqRhs ()
 
void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const
 
virtual void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double mass)
 
- Public Member Functions inherited from G4Mag_EqRhs
 G4Mag_EqRhs (G4MagneticField *magField)
 
virtual ~G4Mag_EqRhs ()
 
virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const =0
 
G4double FCof () const
 
virtual void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double mass)
 
- Public Member Functions inherited from G4EquationOfMotion
 G4EquationOfMotion (G4Field *Field)
 
virtual ~G4EquationOfMotion ()
 
virtual void EvaluateRhsGivenB (const G4double y[], const G4double B[3], G4double dydx[]) const =0
 
virtual void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)=0
 
void RightHandSide (const G4double y[], G4double dydx[]) const
 
void EvaluateRhsReturnB (const G4double y[], G4double dydx[], G4double Field[]) const
 
void GetFieldValue (const G4double Point[4], G4double Field[]) const
 
const G4FieldGetFieldObj () const
 
G4FieldGetFieldObj ()
 
void SetFieldObj (G4Field *pField)
 

Public Attributes

G4double dydx []
 
G4double PositionAndTime [4]
 
 PositionAndTime [0] = y[0]
 

Detailed Description

template<class T_Field>
class G4TMagFieldEquation< T_Field >

Definition at line 44 of file G4TMagFieldEquation.hh.

Constructor & Destructor Documentation

◆ G4TMagFieldEquation()

template<class T_Field >
G4TMagFieldEquation< T_Field >::G4TMagFieldEquation ( T_Field *  f)
inline

Definition at line 48 of file G4TMagFieldEquation.hh.

50 {
51 itsField = f;
52 }

◆ ~G4TMagFieldEquation()

template<class T_Field >
virtual G4TMagFieldEquation< T_Field >::~G4TMagFieldEquation ( )
inlinevirtual

Definition at line 54 of file G4TMagFieldEquation.hh.

54{;}

Member Function Documentation

◆ __attribute__()

template<class T_Field >
G4TMagFieldEquation< T_Field >::__attribute__ ( (always_inline)  ) const

◆ GetFieldValue() [1/2]

template<class T_Field >
void G4TMagFieldEquation< T_Field >::GetFieldValue ( const G4double  Point[4],
G4double  Field[] 
) const
inline

Definition at line 56 of file G4TMagFieldEquation.hh.

58 {
59 itsField->T_Field::GetFieldValue(Point, Field);
60 }

◆ GetFieldValue() [2/2]

template<class T_Field >
G4TMagFieldEquation< T_Field >::GetFieldValue ( PositionAndTime  ,
Field   
)

◆ TEvaluateRhsGivenB() [1/2]

template<class T_Field >
void G4TMagFieldEquation< T_Field >::TEvaluateRhsGivenB ( const G4double  y[],
const G4double  B[3],
G4double  dydx[] 
) const
inline

Definition at line 62 of file G4TMagFieldEquation.hh.

65 {
66 G4double momentum_mag_square = y[3]*y[3] + y[4]*y[4] + y[5]*y[5];
67 G4double inv_momentum_magnitude = 1.0 / std::sqrt( momentum_mag_square );
68 G4double cof = FCof()*inv_momentum_magnitude;
69
70 dydx[0] = y[3]*inv_momentum_magnitude; // (d/ds)x = Vx/V
71 dydx[1] = y[4]*inv_momentum_magnitude; // (d/ds)y = Vy/V
72 dydx[2] = y[5]*inv_momentum_magnitude; // (d/ds)z = Vz/V
73
74 dydx[3] = cof*(y[4]*B[2] - y[5]*B[1]) ; // Ax = a*(Vy*Bz - Vz*By)
75 dydx[4] = cof*(y[5]*B[0] - y[3]*B[2]) ; // Ay = a*(Vz*Bx - Vx*Bz)
76 dydx[5] = cof*(y[3]*B[1] - y[4]*B[0]) ; // Az = a*(Vx*By - Vy*Bx)
77
78 return ;
79 }
double B(double temperature)
double G4double
Definition: G4Types.hh:83
G4double FCof() const
Definition: G4Mag_EqRhs.hh:62

◆ TEvaluateRhsGivenB() [2/2]

template<class T_Field >
G4TMagFieldEquation< T_Field >::TEvaluateRhsGivenB ( ,
Field  ,
dydx   
)

Member Data Documentation

◆ dydx

template<class T_Field >
G4double G4TMagFieldEquation< T_Field >::dydx[]
Initial value:
{
G4double Field[G4maximum_number_of_field_components]

Definition at line 82 of file G4TMagFieldEquation.hh.

Referenced by G4TMagFieldEquation< T_Field >::TEvaluateRhsGivenB().

◆ PositionAndTime [1/2]

template<class T_Field >
G4TMagFieldEquation< T_Field >::PositionAndTime[3] = y[0]

Definition at line 87 of file G4TMagFieldEquation.hh.

◆ PositionAndTime [2/2]

template<class T_Field >
G4double G4TMagFieldEquation< T_Field >::PositionAndTime[4]

Definition at line 86 of file G4TMagFieldEquation.hh.


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