Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4EqGravityField Class Reference

#include <G4EqGravityField.hh>

Inheritance diagram for G4EqGravityField:
Collaboration 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
 
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
 
void SetFieldObj (G4Field *pField)
 

Detailed Description

Definition at line 50 of file G4EqGravityField.hh.

Constructor & Destructor Documentation

G4EqGravityField::G4EqGravityField ( G4UniformGravityField gField)
inline

Definition at line 54 of file G4EqGravityField.hh.

55  : G4EquationOfMotion( gField ) {;}
G4EquationOfMotion(G4Field *Field)
G4EqGravityField::~G4EqGravityField ( )
inline

Definition at line 57 of file G4EqGravityField.hh.

57 {;}

Member Function Documentation

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

Definition at line 52 of file G4EqGravityField.cc.

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

Implements G4EquationOfMotion.

Definition at line 44 of file G4EqGravityField.cc.

47 {
48  fMass = particleMass;
49 }

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