Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EqGravityField Class Reference

#include <G4EqGravityField.hh>

+ Inheritance diagram for G4EqGravityField:

Public Member Functions

 G4EqGravityField (G4UniformGravityField *gField)
 
 ~G4EqGravityField ()
 
void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double mass)
 
void EvaluateRhsGivenB (const G4double y[], const G4double Field[], G4double dydx[]) const
 
- 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)
 

Detailed Description

Definition at line 42 of file G4EqGravityField.hh.

Constructor & Destructor Documentation

◆ G4EqGravityField()

G4EqGravityField::G4EqGravityField ( G4UniformGravityField gField)

Definition at line 39 of file G4EqGravityField.cc.

◆ ~G4EqGravityField()

G4EqGravityField::~G4EqGravityField ( )

Definition at line 44 of file G4EqGravityField.cc.

45{
46}

Member Function Documentation

◆ EvaluateRhsGivenB()

void G4EqGravityField::EvaluateRhsGivenB ( const G4double  y[],
const G4double  Field[],
G4double  dydx[] 
) const

Definition at line 57 of file G4EqGravityField.cc.

60{
61
62 // Components of y:
63 // 0-2 dr/ds,
64 // 3-5 dp/ds - momentum derivatives
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
69 G4double Energy = std::sqrt(momentum_mag_square + fMass*fMass);
70 G4double cof2 = Energy/c_light;
71 G4double cof1 = inv_momentum_magnitude*fMass;
72 G4double inverse_velocity = Energy*inv_momentum_magnitude/c_light;
73
74 dydx[0] = y[3]*inv_momentum_magnitude; // (d/ds)x = Vx/V
75 dydx[1] = y[4]*inv_momentum_magnitude; // (d/ds)y = Vy/V
76 dydx[2] = y[5]*inv_momentum_magnitude; // (d/ds)z = Vz/V
77
78 dydx[3] = G[0]*cof1*cof2/c_light;
79 dydx[4] = G[1]*cof1*cof2/c_light; // m*g
80 dydx[5] = G[2]*cof1*cof2/c_light;
81
82 // Lab Time of flight
83 //
84 dydx[7] = inverse_velocity;
85
86 return;
87}
double G4double
Definition: G4Types.hh:83

◆ SetChargeMomentumMass()

void G4EqGravityField::SetChargeMomentumMass ( G4ChargeState  particleCharge,
G4double  MomentumXc,
G4double  mass 
)
virtual

Implements G4EquationOfMotion.

Definition at line 49 of file G4EqGravityField.cc.

52{
53 fMass = particleMass;
54}

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