Geant4 11.2.2
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 () override
 
void SetChargeMomentumMass (G4ChargeState particleCharge, G4double MomentumXc, G4double mass) override
 
void EvaluateRhsGivenB (const G4double y[], const G4double Field[], G4double dydx[]) const override
 
- 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
 
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.

40 : G4EquationOfMotion( gField )
41{
42}
G4EquationOfMotion(G4Field *Field)

◆ ~G4EqGravityField()

G4EqGravityField::~G4EqGravityField ( )
overridedefault

Member Function Documentation

◆ EvaluateRhsGivenB()

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

Definition at line 55 of file G4EqGravityField.cc.

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

◆ SetChargeMomentumMass()

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

Implements G4EquationOfMotion.

Definition at line 47 of file G4EqGravityField.cc.

50{
51 fMass = particleMass;
52}

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